Skip to main content

Ad States

videoPlayer?.setPlayerStateDelegate(object : PlayerStateDelegate{
override fun onPlayerStateChanged(playerEvent: PlayerEvent<Any>) {
if(playerEvent.type == PlayerState.VIDEO_AD_STATE){
print(playerEvent.value)
}
...
}
})

The table below provides information about the ad states available in Android.

PlayerStateDescriptionValue Return Type
VIDEO_AD_STATECurrent state of AdAdEvent
VIDEO_AD_CONTENT_COMPLETEDAd Content is completedBoolean
VIDEO_AD_ERRORVideo ad errorBoolean
VIDEO_AD_ENDEDAd endedBoolean
VIDEO_AD_STATECurrent state of AdAdEvent
VIDEO_AD_CONTENT_COMPLETEDAd Content is completedBoolean
VIDEO_AD_ERRORVideo ad errorBoolean
VIDEO_AD_ENDEDAd endedBoolean
VIDEO_AD_STATECurrent state of AdAdEvent
VIDEO_AD_CONTENT_COMPLETEDAd Content is completedBoolean
VIDEO_AD_ERRORVideo ad errorBoolean
VIDEO_AD_ENDEDAd endedBoolean