Learn how to observe playback state changes, buffering, seek events, and more using the PlaybackListener interface.
All callbacks are invoked on the main thread.
onPlayerReady(durationMs) fires once per media item when the player reaches READY for the first time—not on every rebuffer or seek.onTimeUpdate(...) fires periodically during active playback (default ~500ms) and stops automatically when paused, ended, or when no listeners remain.onSeekStart / onSeekEnd triggers for both user scrubs and programmatic seekTo calls.onBufferingStart / onBufferingEnd fires on buffering transitions. Use these to show or hide a loading spinner.onCompleted() fires when reaching the end of media. If loop = true, this callback still fires before the video repeats.Remove the listener when it’s no longer needed to avoid leaks: