AdPlayer
AdPlayer is an interface that describes the functionality of our media player and should be extended to create an SDK-compatible ad player.
Types
Properties
Indicates whether assets should be cached. This flag mirrors the value passed through AdManagerSettings. Your AdPlayer implementation does not need to handle this property unless your player requires custom logic for asset caching.
Indicates whether enqueue mode is enabled. This flag mirrors the value passed through AdManagerSettings. Your AdPlayer implementation may ignore this hint unless it requires custom logic for handling enqueue behavior.
Is buffering while paused. Returns:
true if the player buffers the content while paused and starts from that same point when it resumes;
false if the player does not buffer while paused, and when it resumes the playback starts from the live frame of the stream
Player capabilities as described in the VAST 4.0 document
Player state as described in the VAST 4.+ document
Functions
Adds an AdPlayer.Listener callback.
listener: AdPlayer.Listener callback to be add
Removes a surface previously set to render the video content.
surface - the surface that was used to render the video content
Enqueues a creative URL into the player for an ad pod. This method is invoked once for each media file in the pod. creativeUrlString - The URL of the creative to enqueue. index - The position in the playlist at which to enqueue the creative.
Returns the current playhead of the current track. Note: Implementations must preserve the value with at least millisecond precision.
Returns the total duration of the current track. Note: Implementations must preserve the value with at least millisecond precision.
Loads a creative into the player for the current media file. creativeUrlString - The URL of the creative to load.
Removes an AdPlayer.Listener callback.
listener: AdPlayer.Listener callback to be removed
Skips the current ad.
Sets the video view state for viewability purposes.
videoState - the state of the video view. Possible values: MINIMIZED, COLLAPSED, NORMAL, EXPANDED, FULLSCREEN
Sets a surface to render the video content.
surface - the surface to be used to render the video content
return
the current status for a player. The enum with all possible values is defined here: Status