rememberPlayPauseButtonState

Functions summary

PlayPauseButtonState

Remembers the value of PlayPauseButtonState created based on the passed Player and launch a coroutine to listen to Player's changes.

Functions

rememberPlayPauseButtonState

@UnstableApi
@Composable
fun rememberPlayPauseButtonState(
    player: Player?,
    displayMode: @DisplayMode Int = SHOW_BUFFERING_ALWAYS or SHOW_REPLAY_ON_ENDED or SHOW_RETRY_ON_ERROR
): PlayPauseButtonState

Remembers the value of PlayPauseButtonState created based on the passed Player and launch a coroutine to listen to Player's changes. If the Player instance changes between compositions, produce and remember a new value.

Parameters
player: Player?

The Player to observe.

displayMode: @DisplayMode Int = SHOW_BUFFERING_ALWAYS or SHOW_REPLAY_ON_ENDED or SHOW_RETRY_ON_ERROR

The @DisplayMode specifying when to show buffering, replay, or retry.