Listener

interface Listener

Callbacks that the player must fire.

Functions

Link copied to clipboard
abstract fun onBuffering()

Fire this callback when the buffering has started

Link copied to clipboard
abstract fun onBufferingFinished()

Fire this callback when the buffering has finished

Link copied to clipboard
abstract fun onEnded()

Fire this callback when the player has finished playing

Link copied to clipboard
abstract fun onError(error: String)

Fire this callback on error

Link copied to clipboard
abstract fun onLoading(index: Int?)

Param index: if enqueue is used then index should represent the loading item index. If enqueue is not used then index should always be null

Link copied to clipboard
abstract fun onLoadingFinished(index: Int?)

Param index: if enqueue is used then index should represent the loading item index. If enqueue is not used then index should always be null

Link copied to clipboard
open fun onMetadata(metadataList: List<AdPlayer.MetadataItem>)

Fire this callback when metadata is received in streaming It is fired only on server side insertion
metadataList: list of metadata items received in stream

Link copied to clipboard
abstract fun onPause()

Fire this callback when the player has paused

Link copied to clipboard
abstract fun onPlay()

Fire this callback when the play starts

Link copied to clipboard
abstract fun onResume()

Fire this callback when the player resumed

Link copied to clipboard
abstract fun onSeekToTrackEnd(currentTrackIndex: Int)

Param currentTrackIndex: index of the current track

Link copied to clipboard
open fun onSkipAd(error: Error)

Fire this when you want to skip with an error this function will not fire skip tracking but error tracking with vast code 400
error - error which is the reason for this skipAd call

Link copied to clipboard
open fun onTrackChanged(newTrackIndex: Int)

On track changed. Param newTrackIndex - index of the new track

Link copied to clipboard
open fun onVideoSizeChanged(player: AdPlayer, width: Int, height: Int)

Called when video size changes and also when it starts with the initial values
player - this player
width - the video width
height - the video height

Link copied to clipboard
open fun onVolumeChanged(volume: Float)

Fire this callback when player volume has changed