PlayPauseButton

Functions summary

Unit
@UnstableApi
@Composable
PlayPauseButton(
    player: Player?,
    displayMode: @DisplayMode Int,
    content: @Composable PlayPauseButtonState.() -> Unit
)

A state container for a button that plays or pauses the media item.

Functions

@UnstableApi
@Composable
fun PlayPauseButton(
    player: Player?,
    displayMode: @DisplayMode Int = SHOW_BUFFERING_ALWAYS or SHOW_REPLAY_ON_ENDED or SHOW_RETRY_ON_ERROR,
    content: @Composable PlayPauseButtonState.() -> Unit
): Unit

A state container for a button that plays or pauses the media item.

This composable manages the enabled state and click handling of a play-pause button. The UI is provided by the content lambda, which has access to the PlayPauseButtonState.

Parameters
player: Player?

The Player to control.

displayMode: @DisplayMode Int = SHOW_BUFFERING_ALWAYS or SHOW_REPLAY_ON_ENDED or SHOW_RETRY_ON_ERROR

The DisplayMode determining under which conditions buffering, replay, or retry indicators should be shown. Defaults to SHOW_BUFFERING_ALWAYS combined with SHOW_REPLAY_ON_ENDED and SHOW_RETRY_ON_ERROR.

content: @Composable PlayPauseButtonState.() -> Unit

The composable content to be displayed for the button.