Retrieve Player state with Android SDK

Retrieve data about your Player state.


To retrieve the Player state, pass an object implementing PlayerView.PlayerStateCallback to PlayerView#queryPlayerState(...)method.

playerView.queryPlayerState(object: PlayerView.PlayerStateCallback {
    fun onPlayerStateReceived(playerView: PlayerView, playerState: PlayerEvent.PlayerState)
        // Use playerState
    }
)

Find all available states in the Android SDK Reference .