Class APSMediaBuilder
The APSMediaBuilder assists in creating playlists of fully configurable APSMediaUnits, together with attached, configurable APSMediaOverlays, using JSON files or using a HashMap, both following the same structure.
The media builder also has class methods that assist with the generation of individual APSMediaUnit and APSMediaOverlay objects from corresponding JSON or HashMap structures.
Plugins can be attached to a media builder. Each plugin can dynamically insert, edit or remove units and/or overlays from the generated playlist.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe VMAP standard permits allowing only one ad from a certain ad source.static enumDefines the action that the player should take when resuming playback after an interruption caused by user interaction, that determined the display of the in-app web browser.static interfaceReceives the result ofconfigureFromURL(URL, ConfigureCallback)on the main thread.static classHelper class that is used to get data from an URL asynchronousstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionArray containingAPSMediaUnits that will be scheduled before ones in contentUnits in the generated playlist.Array containing the main contentAPSMediaUnits that will make up the playlist.booleanstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanconfigureFromData(String data) Configures the builder from aStringobject.booleanconfigureFromDictionary(HashMap<String, Object> configuration) Configures the builder from aHashMapinvalid input: '<'String, Object>object.booleanconfigureFromURL(URL url) Configures the builder from a JSON structure.voidConfigures the builder from a JSON structure on a background thread.controlsParametersFromDictionary(HashMap<String, Object> controls) Configures the builder from aHashMapinvalid input: '<'String, Object>object.voidinitWithMediaUnit(APSMediaUnit contentUnit, String vmapURL) voidinitWithMediUnit(APSMediaUnit contentUnit, String vmapURL) Deprecated.Returns a generated playlist ofAPSMediaUnits, based on builder configuration and registered plugins.mediaUnits(boolean preloadPrerolls) static APSMediaOverlayoverlayFromDictionary(HashMap<String, Object> overlayConfigurations) Factory method to generate new instance ofAPSMediaOverlayviaHashMapinvalid input: '<'String, Object>configuration.pointsForOffset(String adOffset) positionFromString(String position) Configures overlay position from a stringvoidsetDesiredAdCategories(ArrayList<String> desiredAdCategories) static APSMediaUnitunitFromDictionary(HashMap<String, Object> unitConfigurations) Configures a new APSMediaUnit from aHashMapinvalid input: '<'String, Object>object.
-
Field Details
-
kAPSMetadataDrmEncodingType
- See Also:
-
kAPSMetadataDrmUrl
- See Also:
-
kAPSMarlinDRMEncoding
- See Also:
-
debugMode
public boolean debugMode -
adBreakTemplate
-
userAgent
-
vmapURL
-
vastURL
-
vastType
-
vastOffset
-
adBreaks
-
defaultAdBreakPositions
-
bumperUnits
Array containing
APSMediaUnits that will be scheduled before ones in contentUnits in the generated playlist. -
exitUnits
-
contentUnits
Array containing the main content
APSMediaUnits that will make up the playlist.
-
-
Constructor Details
-
APSMediaBuilder
public APSMediaBuilder()
-
-
Method Details
-
initWithMediUnit
Deprecated.Initializes builder with a playlist of a single media unit.- Parameters:
contentUnit- object to be played.vmapURL- the URL of a VMAP feed.
-
initWithMediaUnit
-
controlsParametersFromDictionary
public static HashMap<String,Object> controlsParametersFromDictionary(HashMap<String, Object> controls) Configures the builder from a
HashMapinvalid input: '<'String, Object>object.- Parameters:
controls- HashMap of controls configuration values- Returns:
HashMapinvalid input: '<'String, Object>with control parameters
-
positionFromString
Configures overlay position from a string- Parameters:
position- A String that represents the position- Returns:
APSMediaOverlayPosition
-
unitFromDictionary
Configures a new APSMediaUnit from aHashMapinvalid input: '<'String, Object>object.- Parameters:
unitConfigurations- The configuration HashMap.- Returns:
- a new APSMediaUnit object
-
overlayFromDictionary
Factory method to generate new instance ofAPSMediaOverlayviaHashMapinvalid input: '<'String, Object>configuration.- Parameters:
overlayConfigurations- Dictionary overlay configuration.- Returns:
- An instance of
APSMediaOverlayornullif error.
-
configureFromURL
Configures the builder from a JSON structure.
Warning: This method blocks the calling thread on network I/O; preferconfigureFromURL(URL, ConfigureCallback).- Parameters:
url- The URL of the JSON structure to load. This can be a remote file or a local file.- Returns:
trueon succes
-
configureFromURL
Configures the builder from a JSON structure on a background thread.- Parameters:
url- The URL of the JSON structure to load. This can be a remote file or a local file.cb- Called on the main thread withtrueon success; may be null.
-
configureFromData
Configures the builder from aStringobject.
Warning: UTF8 encoding is assumed.- Parameters:
data- Configuration data - UTF8 encoded.- Returns:
trueon succes.
-
configureFromDictionary
-
mediaUnits
Returns a generated playlist of
APSMediaUnits, based on builder configuration and registered plugins.
Warning: This method may execute blocking network I/O on the calling thread.- Returns:
An array of
APSMediaUnits.
-
mediaUnits
-
adBreaksForVMAP
-
pointsForOffset
-
setDesiredAdCategories
-
initWithMediaUnit(com.appscend.media.events.APSMediaUnit, String)instead.