PlayerStateListener
Callbacks for playback state changes. Assign an implementation to net.bunny.bunnystreamplayer.common.BunnyPlayer.playerStateListener to drive custom UI (play/pause buttons, loading spinners, chapter lists) from the engine's state.
All callbacks are invoked on the main thread.
Functions
Chapter markers for the current video were loaded. Chapters are defined per video in the Bunny dashboard; the list is empty when the video has none.
Moment markers for the current video were loaded. Moments are labelled timestamps defined per video in the Bunny dashboard; the list is empty when the video has none.
The player was muted or unmuted.
Playback speed changed, for example after the user picked a speed in the settings menu.
Playback failed. message is a human-readable description suitable for logging.
Playback moved between the local player and a connected Chromecast device. player is the media3 player instance now in charge; playerType tells you which one it is.
Audience retention data for the current video was loaded. The player uses it to draw the watch-time heatmap above the seek bar when the library has that feature enabled.
The current video's pixel dimensions, reported when the first frame is decoded and whenever they change (e.g. a quality switch or a different stream). Lets hosts size their container to the real aspect ratio so both 16:9 and 9:16 (vertical) content display without distortion. Default no-op so existing implementations keep compiling.