VideoAdPlayer

public interface VideoAdPlayer extends AdProgressProvider, VolumeProvider


Defines the set of methods that a video player must implement to be used by the IMA SDK, as well as a set of callbacks that it must fire. This player should use the callbacks provided while interacting with ads only. VideoAdPlayer interface should be controlled only by IMA SDK and should not be accessed by the application directly. Use AdsManager API to control ad playback.

Summary

Nested types

Callbacks that the player must fire.

Public methods

abstract void

Adds a callback.

abstract void
loadAd(AdMediaInfo adMediaInfo, AdPodInfo adPodInfo)

Loads a video ad hosted at AdMediaInfo.

abstract void
pauseAd(AdMediaInfo adMediaInfo)

Pauses playing the current ad.

abstract void
playAd(AdMediaInfo adMediaInfo)

Starts or resumes playing the video ad referenced by the AdMediaInfo, provided loadAd has already been called for it.

abstract void

Cleans up and releases all resources used by the VideoAdPlayer.

abstract void

Removes a callback.

abstract void
stopAd(AdMediaInfo adMediaInfo)

Stops playing the current ad.

Inherited methods

From com.google.ads.interactivemedia.v3.api.player.AdProgressProvider
abstract 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.player.VolumeProvider
abstract int

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

Public methods

addCallback

abstract void addCallback(VideoAdPlayer.VideoAdPlayerCallback callback)

Adds a callback.

loadAd

abstract void loadAd(AdMediaInfo adMediaInfo, AdPodInfo adPodInfo)

Loads a video ad hosted at AdMediaInfo. This is the first call the VideoAdPlayer will receive for a given Ad Media. The player should store the instance of AdMediaInfo and include it when calling all methods from the VideoAdPlayerCallback. Should only be called by the SDK.

pauseAd

abstract void pauseAd(AdMediaInfo adMediaInfo)

Pauses playing the current ad. Should only be called by the SDK.

playAd

abstract void playAd(AdMediaInfo adMediaInfo)

Starts or resumes playing the video ad referenced by the AdMediaInfo, provided loadAd has already been called for it. Should only be called by the SDK.

release

abstract void release()

Cleans up and releases all resources used by the VideoAdPlayer. Should only be called by the SDK.

removeCallback

abstract void removeCallback(VideoAdPlayer.VideoAdPlayerCallback callback)

Removes a callback.

stopAd

abstract void stopAd(AdMediaInfo adMediaInfo)

Stops playing the current ad. Also used to clean up an ad after completion. Should only be called by the SDK.