VideoStreamPlayer

public interface VideoStreamPlayer implements ContentProgressProvider VolumeProvider

Defines a set of methods that a video player must implement to be used by the IMA SDK for dynamic ad insertion.

Nested Class Summary

interface VideoStreamPlayer.VideoStreamPlayerCallback Callbacks that the player must fire. 

Public Method Summary

abstract void
abstract int
getVolume()
Returns the volume of the video player as a percentage from 0 to 100.
abstract void
loadUrl(String url, List<HashMap<String, String>> subtitles)
Loads a stream with dynamic ad insertion given the stream url and subtitles array.
abstract void
onAdBreakEnded()
The SDK will call this method when an ad break ends to allow for reenabling seeking, etc.
abstract void
onAdBreakStarted()
The SDK will call this method when an ad break begins to allow for disabling seeking, etc.
abstract void
onAdPeriodEnded()
The SDK will call this method when an ad period ends.
abstract void
onAdPeriodStarted()
The SDK will call this method when an ad period begins.
abstract void
abstract void
seek(long time)
Seeks the stream to the given time.

Inherited Method Summary

Public Methods

public abstract void addCallback (VideoStreamPlayer.VideoStreamPlayerCallback callback)

Parameters
callback

public abstract int getVolume ()

Returns the volume of the video player as a percentage from 0 to 100.

public abstract void loadUrl (String url, List<HashMap<String, String>> subtitles)

Loads a stream with dynamic ad insertion given the stream url and subtitles array. The subtitles array is only used in VOD streams. Each entry in the subtitles array is a HashMap that corresponds to a language. Each map will have a "language" key with a two letter language string value and one or more subtitle key/value pairs. Here's an example the map for English: "language" -> "en" "webvtt" -> "https://example.com/vtt/en.vtt" "ttml" -> "https://example.com/ttml/en.ttml"

Parameters
url
subtitles

public abstract void onAdBreakEnded ()

The SDK will call this method when an ad break ends to allow for reenabling seeking, etc. This should be used to indicate that an ad break is finished playing and that seeking should be re-enabled.

public abstract void onAdBreakStarted ()

The SDK will call this method when an ad break begins to allow for disabling seeking, etc. This should be used to indicate that an ad break is playing for the first time and that seeking should be disabled.

public abstract void onAdPeriodEnded ()

The SDK will call this method when an ad period ends. This should be used to indicate that the media being played is no longer an ad but actually content.

public abstract void onAdPeriodStarted ()

The SDK will call this method when an ad period begins. This should not be used to disable seeking but instead will be called to indicate that the media being played is not content. This will be called even when an ad is played a second time or when seeking into an ad.

public abstract void removeCallback (VideoStreamPlayer.VideoStreamPlayerCallback callback)

Parameters
callback

public abstract void seek (long time)

Seeks the stream to the given time.

Parameters
time The time to which the stream should be seeked in milliseconds.

Send feedback about...

IMA DAI SDK for Android
Need help? Visit our support page.