androidx.media3.ui.compose.buttons

Top-level functions summary

Unit

A state container for a button that mutes and unmutes to the media.

Unit

A state container for a button that seeks to the next media item.

Unit

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

Unit

A state container for a button that seeks to the previous media item.

Unit
@UnstableApi
@Composable
RepeatButton(
    player: Player,
    toggleModeSequence: List<@Player.RepeatMode Int>,
    content: @Composable RepeatButtonState.() -> Unit
)
Unit

A state container for a button that seeks back in the current media item by Player.getSeekBackIncrement.

Unit

A state container for a button that seeks back in the current media item by Player.getSeekForwardIncrement.

Unit

Top-level functions

@UnstableApi
@Composable
fun MuteButton(player: Player, content: @Composable MuteButtonState.() -> Unit): Unit

A state container for a button that mutes and unmutes to the media.

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

Parameters
player: Player

The Player to control.

content: @Composable MuteButtonState.() -> Unit

The composable content to be displayed for the button.

@UnstableApi
@Composable
fun NextButton(player: Player, content: @Composable NextButtonState.() -> Unit): Unit

A state container for a button that seeks to the next media item.

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

Parameters
player: Player

The Player to control.

content: @Composable NextButtonState.() -> Unit

The composable content to be displayed for the button.

@UnstableApi
@Composable
fun PlayPauseButton(player: Player, 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.

content: @Composable PlayPauseButtonState.() -> Unit

The composable content to be displayed for the button.

@UnstableApi
@Composable
fun PreviousButton(player: Player, content: @Composable PreviousButtonState.() -> Unit): Unit

A state container for a button that seeks to the previous media item.

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

Parameters
player: Player

The Player to control.

content: @Composable PreviousButtonState.() -> Unit

The composable content to be displayed for the button.

@UnstableApi
@Composable
fun RepeatButton(
    player: Player,
    toggleModeSequence: List<@Player.RepeatMode Int> = listOf(Player.REPEAT_MODE_OFF, Player.REPEAT_MODE_ONE, Player.REPEAT_MODE_ALL),
    content: @Composable RepeatButtonState.() -> Unit
): Unit
@UnstableApi
@Composable
fun SeekBackButton(player: Player, content: @Composable SeekBackButtonState.() -> Unit): Unit

A state container for a button that seeks back in the current media item by Player.getSeekBackIncrement.

This composable manages the enabled state and click handling of a seek forward button. The UI is provided by the content lambda, which has access to the SeekBackButtonState.

Parameters
player: Player

The Player to control.

content: @Composable SeekBackButtonState.() -> Unit

The composable content to be displayed for the button.

SeekForwardButton

@UnstableApi
@Composable
fun SeekForwardButton(player: Player, content: @Composable SeekForwardButtonState.() -> Unit): Unit

A state container for a button that seeks back in the current media item by Player.getSeekForwardIncrement.

This composable manages the enabled state and click handling of a seek forward button. The UI is provided by the content lambda, which has access to the SeekForwardButtonState.

Parameters
player: Player

The Player to control.

content: @Composable SeekForwardButtonState.() -> Unit

The composable content to be displayed for the button.