VideoController

interface VideoController


An object that provides playback control for video ads.

Summary

Nested types

Callback for receiving updates on video ad lifecycle events.

Public functions

Unit
mute(mute: Boolean)

Sets the video mute state.

Unit

Pauses the video ad if applicable.

Unit

Play the video ad if applicable.

Unit

Stops video playback.

Public properties

Boolean

Returns true if the video ad is using custom video playback controls.

Boolean

true if the video is currently muted, false otherwise.

VideoController.VideoLifecycleCallbacks?

Callback for receiving video events.

Public functions

mute

fun mute(mute: Boolean): Unit

Sets the video mute state.

This video control method only works when isCustomControlsEnabled returns true.

Parameters
mute: Boolean

true if video should be muted, false for unmuted.

pause

fun pause(): Unit

Pauses 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

fun play(): Unit

Play the video ad if applicable. This method is a no-op if the video is already playing.

This video control method only works when isCustomControlsEnabled returns true.

stop

fun stop(): Unit

Stops 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 in the allowlist to be able to use this API. If you are interested in using this feature, reach out to your account manager.

Public properties

isCustomControlsEnabled

val isCustomControlsEnabledBoolean

Returns true if the video ad is using custom video playback controls. When custom controls are enabled, it is the app's responsibility to render and provide play/pause and mute/unmute controls and call play, pause, and mute at the appropriate times.

Use VideoOptions.Builder.customControlsRequested to enable custom controls.

This feature is currently only available for Ad Manager reservation ads.

isMuted

val isMutedBoolean

true if the video is currently muted, false otherwise.

videoLifecycleCallbacks

var videoLifecycleCallbacksVideoController.VideoLifecycleCallbacks?

Callback for receiving video events.