AdsManager

interface AdsManager : BaseManager


An object which handles playing ads after they've been received from the server. After the AdsManager is retrieved from an AdsManagerLoadedEvent, init should be called first. After the LOADED event is fired, start can be called. At any time, destroy can be called to end ad playback.

Summary

Public functions

Unit

Discards current ad break and resumes content.

(Mutable)List<Float!>!

List of content time offsets in seconds at which ad breaks are scheduled.

Unit

Pauses the current ad.

Unit

Resumes the current ad.

Unit

Skips the current ad.

Unit

Starts playing the ads.

Inherited functions

From com.google.ads.interactivemedia.v3.api.player.AdProgressProvider
VideoProgressUpdate!

Returns VideoProgressUpdate describing playback progress of the current ad or VideoProgressUpdate#VIDEO_TIME_NOT_READY if video details are not yet available.

From com.google.ads.interactivemedia.v3.api.BaseManager
Unit

Registers a listener for errors that occur during the ad or stream initialization and playback.

Unit

Registers a listener for ad events that occur during ad or stream initialization and playback.

Unit

Stops the ad and all tracking, then releases all assets that were loaded to play the ad.

Unit

Generic focus endpoint that puts focus on the skip button if present.

AdProgressInfo!

Returns the latest AdProgressInfo for the current playing ad.

Ad!

Get currently playing ad.

Unit

Initializes the ad experience using default rendering settings.

Unit

Initializes the ad experience on the manager.

Unit

Removes a listener for error events.

Unit

Removes a listener for ad events.

Public functions

discardAdBreak

fun discardAdBreak(): Unit

Discards current ad break and resumes content. If there is no current ad then the next ad break is discarded.

getAdCuePoints

fun getAdCuePoints(): (Mutable)List<Float!>!

List of content time offsets in seconds at which ad breaks are scheduled. The list will be empty if no ad breaks are scheduled.

pause

fun pause(): Unit

Pauses the current ad.

resume

fun resume(): Unit

Resumes the current ad.

skip

fun skip(): Unit

Skips the current ad. AdsManager.skip() only skips ads if IMA does not render the 'Skip ad' button.

start

fun start(): Unit

Starts playing the ads. This will be ignored for ads lists, because init will start playback.