VideoAdPlayer.VideoAdPlayerCallback

interface VideoAdPlayer.VideoAdPlayerCallback


Callbacks that the player must fire.

Summary

Public functions

Unit
onAdProgress(
    adMediaInfo: AdMediaInfo!,
    videoProgressUpdate: VideoProgressUpdate!
)

Fire this callback periodically as ad playback occurs.

Unit
onBuffering(adMediaInfo: AdMediaInfo!)

Fire this callback when video playback stalls waiting for data.

Unit

Fire this callback when all content has finished playing.

Unit
onEnded(adMediaInfo: AdMediaInfo!)

Fire this callback when the video finishes playing.

Unit
onError(adMediaInfo: AdMediaInfo!)

Fire this callback when the video has encountered an error.

Unit
onLoaded(adMediaInfo: AdMediaInfo!)

Fire this callback when the video is ready to begin playback.

Unit
onPause(adMediaInfo: AdMediaInfo!)

Fire this callback when the video is paused.

Unit
onPlay(adMediaInfo: AdMediaInfo!)

Fire this callback when the player begins playing a video.

Unit
onResume(adMediaInfo: AdMediaInfo!)

Fire this callback when the video is unpaused.

Unit
onVolumeChanged(adMediaInfo: AdMediaInfo!, percentage: Int)

Fire this callback when the playback volume changes.

Public functions

onAdProgress

fun onAdProgress(
    adMediaInfo: AdMediaInfo!,
    videoProgressUpdate: VideoProgressUpdate!
): Unit

Fire this callback periodically as ad playback occurs. Best practice is to call it on start, and every 100ms afterwards. Failure to do so may result in lost ad impressions, or invalidation of impressions.

onBuffering

fun onBuffering(adMediaInfo: AdMediaInfo!): Unit

Fire this callback when video playback stalls waiting for data.

onContentComplete

fun onContentComplete(): Unit

Fire this callback when all content has finished playing. This will allow the SDK to play post-roll ads, if any are loaded through ad rules.

onEnded

fun onEnded(adMediaInfo: AdMediaInfo!): Unit

Fire this callback when the video finishes playing.

onError

fun onError(adMediaInfo: AdMediaInfo!): Unit

Fire this callback when the video has encountered an error.

onLoaded

fun onLoaded(adMediaInfo: AdMediaInfo!): Unit

Fire this callback when the video is ready to begin playback. This indicates that at least some media has been buffered into the VideoAdPlayer.

onPause

fun onPause(adMediaInfo: AdMediaInfo!): Unit

Fire this callback when the video is paused.

onPlay

fun onPlay(adMediaInfo: AdMediaInfo!): Unit

Fire this callback when the player begins playing a video.

onResume

fun onResume(adMediaInfo: AdMediaInfo!): Unit

Fire this callback when the video is unpaused.

onVolumeChanged

fun onVolumeChanged(adMediaInfo: AdMediaInfo!, percentage: Int): Unit

Fire this callback when the playback volume changes.