EventListener

interface EventListener

Implement this listener to keep track of tracks being played

Functions

onPlayerStateChanged
Link copied to clipboard
abstract fun onPlayerStateChanged(playerState: State)

Triggered every time player state is changed

onPlayFailedToPrepare
Link copied to clipboard
abstract fun onPlayFailedToPrepare(play: Play, error: Exception)

Triggered if the player failed to prepare this item for playback

onPlayItemBeganPlayback
Link copied to clipboard
abstract fun onPlayItemBeganPlayback(waitingTime: Int, play: Play, bufferingTime: Long)

This event will be triggered when next item begins playback. The previous item may still be playing if crossfading is enabled

onPlayItemFinishedPlayback
Link copied to clipboard
abstract fun onPlayItemFinishedPlayback(play: Play, reason: Int, timePlayed: Float, error: Exception?)

Triggered after a play item has finished playing or is ending soon. The item may still be playing if crossfading is enabled and the play reason is REACHED_END

onPlayItemReadyForPlayback
Link copied to clipboard
abstract fun onPlayItemReadyForPlayback(play: Play)

This event will be triggered when this item is cached and is ready for immediate playback

onProgressUpdate
Link copied to clipboard
abstract fun onProgressUpdate(play: Play, elapsedTime: Float, duration: Float)

Triggered every 500ms for progress updates on current playing item