AdPlaybackController

The object provides an API for controlling ad playback. It allows playing an ad once. To play the ad again, create a new AdPlaybackController instance.

Methods

Methods

Name

Type (Returned)

Description

getAdContentSize ()

PublicAdContentSize

Returns the current ad size.

getAdPlayingState ()

PublicAdPlayingState

Returns the current ad playback state.

getAdSkippableState ()

boolean

Shows if the creative can be skipped.

pauseAd ()

void

Pauses the ad.

playAd ()

void

Starts playing the ad.

Warning

The method can only be called once, all subsequent calls are ignored.

resumeAd ()

void

Resumes playing the ad.

skipAd ()

void

Skips all ads at once (all AdPods). Before calling the method, the player needs to make sure the getAdSkippableState method returns true.

stopAd ()

void

Stops the ad.

subscribe
(AdPlaybackControllerSubscribeMethod)

Subscribes to an ad event.

getAdVolume

number

Returns the current volume in the range [0; 1]. The actual volume is only returned after calling the playAd () method and before destroying the object. Returns 0 at any other time.

setAdVolume

void

Sets the volume in the range [0; 1]. Setting the volume is only available after the ad starts playing (the playAd () method) and before it stops (the AdStopped event).

Alert

Setting it to a value different from zero may pause the video if no video element is activated. This is due to the browser auto play policies. We recommend only a user action turning on the volume.

getAdVolumeAvailabilityState

boolean

Status that shows if ad volume control is available. Acceptable values:

  • true — Available;
  • false — Not available.

The actual status is available immediately after calling the playAd () method and before destroying the object. Returns false at any other time.

Note

The status is returned regardless of whether the volume controls are visible.

getAdPodTimeToSkip

Returns the time until the ad creative can be skipped

getAdRemainingTime

Returns the remaining playback time for the entire ad block.

getAdPodRemainingTime

Returns the remaining playback time for the current ad creative.

getAdDuration

Returns the duration of the entire ad block.

getAdPodDuration

Returns the duration of the current ad creative.