An object that provides playback control for video ads.
| class | VideoController.VideoLifecycleCallbacks | An interface for objects that receive callbacks for video events. | |
| float |
getAspectRatio()
This method is deprecated. Use
getAspectRatio().
|
| VideoController.VideoLifecycleCallbacks |
getVideoLifecycleCallbacks()
Returns the previously provided
VideoController.VideoLifecycleCallbacks or null if no instance was
provided.
|
| boolean |
hasVideoContent()
Returns true if the current ad has video content.
|
| boolean |
isClickToExpandEnabled()
Returns true if the video ad is using click to expand behavior.
|
| boolean |
isCustomControlsEnabled()
Returns true if the video ad is using custom player controls.
|
| boolean |
isMuted()
Returns true if the video is currently muted, false otherwise.
|
| void |
mute(boolean mute)
Set the video mute state.
|
| void |
pause()
Pause the video ad if applicable.
|
| void |
play()
Play the video ad if applicable.
|
| void |
setVideoLifecycleCallbacks(VideoController.VideoLifecycleCallbacks
callbacks)
Set a listener that will receive callbacks for video events.
|
| void |
stop()
Stop video playback.
|
This method is deprecated.
Use getAspectRatio().
Returns the aspect ratio of the video. Returns 0 if aspect ratio information is not available.
Returns the previously provided
VideoController.VideoLifecycleCallbacks or null if no instance was
provided.
Returns true if the current ad has video content.
Returns true if the video ad is using click to expand behavior.
Returns true if the video ad is using custom player controls. If custom player
controls are used, then it is the app's responsibility to render provide play/pause and
mute/unmute controls and call play(),
pause(),
and mute(boolean)
at the appropriate times.
Use
setCustomControlsRequested(boolean) to enable custom controls.
Custom controls are currently only available for DoubleClick for Publishers reservations.
Returns true if the video is currently muted, false otherwise.
Set the video mute state.
This video control method only works when
isCustomControlsEnabled() returns true.
| mute | true if video should be muted, false for unmuted |
|---|
Pause the video ad if applicable. This method is a no-op if the video is already paused or the video has ended.
This video control method only works when
isCustomControlsEnabled() returns true.
Play the video ad if applicable. This method is a no-op if the video is already playing or the video has ended.
This video control method only works when
isCustomControlsEnabled() returns true.
Set a listener that will receive callbacks for video events.
| callbacks | the object that is to receive lifecyle callbacks |
|---|
| NullPointerException | if callbacks is null |
|---|
Stop video playback. Subsequent calls to play()
will resume at the beginning of the video. This method is a no-op if the video has
already been stopped.
The ad unit must be whitelisted to be able to use this api. If you are interested in using this feature, reach out to your account manager.