androidx.media3.ui.compose.material3.buttons

Top-level functions summary

Unit
@UnstableApi
@Composable
MuteButton(
    player: Player,
    modifier: Modifier,
    imageVector: MuteButtonState.() -> ImageVector,
    contentDescription: @Composable MuteButtonState.() -> String,
    tint: Color,
    onClick: MuteButtonState.() -> Unit
)

A Material3 IconButton that mutes or unmutes the player.

Unit
@UnstableApi
@Composable
MuteButton(
    player: Player,
    modifier: Modifier,
    painter: @Composable MuteButtonState.() -> Painter,
    contentDescription: @Composable MuteButtonState.() -> String,
    tint: Color,
    onClick: MuteButtonState.() -> Unit
)

A Material3 IconButton that mutes or unmutes the player.

Unit
@UnstableApi
@Composable
NextButton(
    player: Player,
    modifier: Modifier,
    imageVector: @Composable NextButtonState.() -> ImageVector,
    contentDescription: @Composable NextButtonState.() -> String,
    tint: Color,
    onClick: NextButtonState.() -> Unit
)

A Material3 IconButton that seeks to the next media item.

Unit
@UnstableApi
@Composable
NextButton(
    player: Player,
    modifier: Modifier,
    painter: @Composable NextButtonState.() -> Painter,
    contentDescription: @Composable NextButtonState.() -> String,
    tint: Color,
    onClick: NextButtonState.() -> Unit
)

A Material3 IconButton that seeks to the next media item.

Unit
@UnstableApi
@Composable
PlayPauseButton(
    player: Player,
    modifier: Modifier,
    imageVector: PlayPauseButtonState.() -> ImageVector,
    contentDescription: @Composable PlayPauseButtonState.() -> String,
    tint: Color,
    onClick: PlayPauseButtonState.() -> Unit
)

A Material3 IconButton that plays or pauses the current media item.

Unit
@UnstableApi
@Composable
PlayPauseButton(
    player: Player,
    modifier: Modifier,
    painter: @Composable PlayPauseButtonState.() -> Painter,
    contentDescription: @Composable PlayPauseButtonState.() -> String,
    tint: Color,
    onClick: PlayPauseButtonState.() -> Unit
)

A Material3 IconButton that plays or pauses the current media item.

Unit
@UnstableApi
@Composable
PreviousButton(
    player: Player,
    modifier: Modifier,
    imageVector: @Composable PreviousButtonState.() -> ImageVector,
    contentDescription: @Composable PreviousButtonState.() -> String,
    tint: Color,
    onClick: PreviousButtonState.() -> Unit
)

A Material3 IconButton that seeks to the previous media item.

Unit
@UnstableApi
@Composable
PreviousButton(
    player: Player,
    modifier: Modifier,
    painter: @Composable PreviousButtonState.() -> Painter,
    contentDescription: @Composable PreviousButtonState.() -> String,
    tint: Color,
    onClick: PreviousButtonState.() -> Unit
)

A Material3 IconButton that seeks to the previous media item.

Unit
@UnstableApi
@Composable
RepeatButton(
    player: Player,
    modifier: Modifier,
    toggleModeSequence: List<@Player.RepeatMode Int>,
    imageVector: RepeatButtonState.() -> ImageVector,
    contentDescription: @Composable RepeatButtonState.() -> String,
    tint: Color,
    onClick: RepeatButtonState.() -> Unit
)

A Material3 IconButton that toggles the repeat mode of the player.

Unit
@UnstableApi
@Composable
RepeatButton(
    player: Player,
    modifier: Modifier,
    toggleModeSequence: List<@Player.RepeatMode Int>,
    painter: @Composable RepeatButtonState.() -> Painter,
    contentDescription: @Composable RepeatButtonState.() -> String,
    tint: Color,
    onClick: RepeatButtonState.() -> Unit
)

A Material3 IconButton that toggles the repeat mode of the player.

Unit
@UnstableApi
@Composable
SeekBackButton(
    player: Player,
    modifier: Modifier,
    imageVector: SeekBackButtonState.() -> ImageVector,
    contentDescription: @Composable SeekBackButtonState.() -> String,
    tint: Color,
    onClick: SeekBackButtonState.() -> Unit
)

A Material3 IconButton that seeks back in the current media item.

Unit
@UnstableApi
@Composable
SeekBackButton(
    player: Player,
    modifier: Modifier,
    painter: @Composable SeekBackButtonState.() -> Painter,
    contentDescription: @Composable SeekBackButtonState.() -> String,
    tint: Color,
    onClick: SeekBackButtonState.() -> Unit
)

A Material3 IconButton that seeks back in the current media item.

Unit
@UnstableApi
@Composable
SeekForwardButton(
    player: Player,
    modifier: Modifier,
    imageVector: SeekForwardButtonState.() -> ImageVector,
    contentDescription: @Composable SeekForwardButtonState.() -> String,
    tint: Color,
    onClick: SeekForwardButtonState.() -> Unit
)

A Material3 IconButton that seeks forward in the current media item.

Unit
@UnstableApi
@Composable
SeekForwardButton(
    player: Player,
    modifier: Modifier,
    painter: @Composable SeekForwardButtonState.() -> Painter,
    contentDescription: @Composable SeekForwardButtonState.() -> String,
    tint: Color,
    onClick: SeekForwardButtonState.() -> Unit
)

A Material3 IconButton that seeks forward in the current media item.

Unit
@UnstableApi
@Composable
ShuffleButton(
    player: Player,
    modifier: Modifier,
    imageVector: ShuffleButtonState.() -> ImageVector,
    contentDescription: @Composable ShuffleButtonState.() -> String,
    tint: Color,
    onClick: ShuffleButtonState.() -> Unit
)

A Material3 IconButton that toggles the shuffle mode of the player.

Unit
@UnstableApi
@Composable
ShuffleButton(
    player: Player,
    modifier: Modifier,
    painter: @Composable ShuffleButtonState.() -> Painter,
    contentDescription: @Composable ShuffleButtonState.() -> String,
    tint: Color,
    onClick: ShuffleButtonState.() -> Unit
)

A Material3 IconButton that toggles the shuffle mode of the player.

Top-level functions

@UnstableApi
@Composable
fun MuteButton(
    player: Player,
    modifier: Modifier = Modifier,
    imageVector: MuteButtonState.() -> ImageVector,
    contentDescription: @Composable MuteButtonState.() -> String = defaultMuteContentDescription,
    tint: Color = LocalContentColor.current,
    onClick: MuteButtonState.() -> Unit = MuteButtonState::onClick
): Unit

A Material3 IconButton that mutes or unmutes the player.

When clicked, it will mute the player if it's currently unmuted, and unmute it otherwise. The button's state (e.g., whether it's enabled and the current mute icon) is managed by a MuteButtonState instance derived from the provided player.

Parameters
player: Player

The Player to control.

modifier: Modifier = Modifier

The Modifier to be applied to the button.

imageVector: MuteButtonState.() -> ImageVector

The supplier for ImageVector used for the icon displayed on the button.

contentDescription: @Composable MuteButtonState.() -> String = defaultMuteContentDescription

The content description for accessibility purposes.

tint: Color = LocalContentColor.current

Tint to be applied to imageVector. If Color.Unspecified is provided, then no tint is applied.

onClick: MuteButtonState.() -> Unit = MuteButtonState::onClick

The action to be performed when the button is clicked. This lambda has MuteButtonState as its receiver, providing access to the button's current state (e.g., MuteButtonState.isEnabled). The default behavior is to call MuteButtonState.onClick, which toggles the player's mute state. Consumers can customize this behavior:

  • To add custom logic while still performing the default action, call this.onClick() within your lambda.

  • To completely override the default behavior, implement your custom logic without calling this.onClick().

@UnstableApi
@Composable
fun MuteButton(
    player: Player,
    modifier: Modifier = Modifier,
    painter: @Composable MuteButtonState.() -> Painter = defaultMutePainterIcon,
    contentDescription: @Composable MuteButtonState.() -> String = defaultMuteContentDescription,
    tint: Color = LocalContentColor.current,
    onClick: MuteButtonState.() -> Unit = MuteButtonState::onClick
): Unit

A Material3 IconButton that mutes or unmutes the player.

When clicked, it will mute the player if it's currently unmuted, and unmute it otherwise. The button's state (e.g., whether it's enabled and the current mute icon) is managed by a MuteButtonState instance derived from the provided player.

Parameters
player: Player

The Player to control.

modifier: Modifier = Modifier

The Modifier to be applied to the button.

painter: @Composable MuteButtonState.() -> Painter = defaultMutePainterIcon

The supplier for Painter used for the icon displayed on the button.

contentDescription: @Composable MuteButtonState.() -> String = defaultMuteContentDescription

The content description for accessibility purposes.

tint: Color = LocalContentColor.current

Tint to be applied to painter. If Color.Unspecified is provided, then no tint is applied.

onClick: MuteButtonState.() -> Unit = MuteButtonState::onClick

The action to be performed when the button is clicked. This lambda has MuteButtonState as its receiver, providing access to the button's current state (e.g., MuteButtonState.isEnabled). The default behavior is to call MuteButtonState.onClick, which toggles the player's mute state. Consumers can customize this behavior:

  • To add custom logic while still performing the default action, call this.onClick() within your lambda.

  • To completely override the default behavior, implement your custom logic without calling this.onClick().

@UnstableApi
@Composable
fun NextButton(
    player: Player,
    modifier: Modifier = Modifier,
    imageVector: @Composable NextButtonState.() -> ImageVector,
    contentDescription: @Composable NextButtonState.() -> String = { stringResource(R.string.next_button) },
    tint: Color = LocalContentColor.current,
    onClick: NextButtonState.() -> Unit = NextButtonState::onClick
): Unit

A Material3 IconButton that seeks to the next media item.

When clicked, it attempts to advance the player to the next media item in its current playlist. The button's state (e.g., whether it's enabled) is managed by a NextButtonState instance derived from the provided player.

Parameters
player: Player

The Player to control.

modifier: Modifier = Modifier

The Modifier to be applied to the button.

imageVector: @Composable NextButtonState.() -> ImageVector

The supplier for ImageVector used for the icon displayed on the button.

contentDescription: @Composable NextButtonState.() -> String = { stringResource(R.string.next_button) }

The content description for accessibility purposes. Defaults to R.string.next_button.

tint: Color = LocalContentColor.current

Tint to be applied to imageVector. If Color.Unspecified is provided, then no tint is applied.

onClick: NextButtonState.() -> Unit = NextButtonState::onClick

The action to be performed when the button is clicked. This lambda has NextButtonState as its receiver, providing access to the button's current state (e.g., NextButtonState.isEnabled). The default behavior is to call NextButtonState.onClick, which advances the player to the next item if available. Consumers can customize this behavior:

  • To add custom logic while still performing the default next action, call this.onClick() within your lambda.

  • To completely override the default behavior, implement your custom logic without calling this.onClick(). Note that in this case, the button might still be enabled based on the player state, so ensure your custom logic handles cases where advancing is not possible.

@UnstableApi
@Composable
fun NextButton(
    player: Player,
    modifier: Modifier = Modifier,
    painter: @Composable NextButtonState.() -> Painter = { painterResource(R.drawable.media3_icon_next) },
    contentDescription: @Composable NextButtonState.() -> String = { stringResource(R.string.next_button) },
    tint: Color = LocalContentColor.current,
    onClick: NextButtonState.() -> Unit = NextButtonState::onClick
): Unit

A Material3 IconButton that seeks to the next media item.

When clicked, it attempts to advance the player to the next media item in its current playlist. The button's state (e.g., whether it's enabled) is managed by a NextButtonState instance derived from the provided player.

Parameters
player: Player

The Player to control.

modifier: Modifier = Modifier

The Modifier to be applied to the button.

painter: @Composable NextButtonState.() -> Painter = { painterResource(R.drawable.media3_icon_next) }

The supplier for Painter used for the icon displayed on the button. Defaults to R.drawable.media3_icon_next.

contentDescription: @Composable NextButtonState.() -> String = { stringResource(R.string.next_button) }

The content description for accessibility purposes. Defaults to R.string.next_button.

tint: Color = LocalContentColor.current

Tint to be applied to painter. If Color.Unspecified is provided, then no tint is applied.

onClick: NextButtonState.() -> Unit = NextButtonState::onClick

The action to be performed when the button is clicked. This lambda has NextButtonState as its receiver, providing access to the button's current state (e.g., NextButtonState.isEnabled). The default behavior is to call NextButtonState.onClick, which advances the player to the next item if available. Consumers can customize this behavior:

  • To add custom logic while still performing the default next action, call this.onClick() within your lambda.

  • To completely override the default behavior, implement your custom logic without calling this.onClick(). Note that in this case, the button might still be enabled based on the player state, so ensure your custom logic handles cases where advancing is not possible.

@UnstableApi
@Composable
fun PlayPauseButton(
    player: Player,
    modifier: Modifier = Modifier,
    imageVector: PlayPauseButtonState.() -> ImageVector,
    contentDescription: @Composable PlayPauseButtonState.() -> String = defaultPlayPauseContentDescription,
    tint: Color = LocalContentColor.current,
    onClick: PlayPauseButtonState.() -> Unit = PlayPauseButtonState::onClick
): Unit

A Material3 IconButton that plays or pauses the current media item.

@UnstableApi
@Composable
fun PlayPauseButton(
    player: Player,
    modifier: Modifier = Modifier,
    painter: @Composable PlayPauseButtonState.() -> Painter = defaultPlayPausePainterIcon,
    contentDescription: @Composable PlayPauseButtonState.() -> String = defaultPlayPauseContentDescription,
    tint: Color = LocalContentColor.current,
    onClick: PlayPauseButtonState.() -> Unit = PlayPauseButtonState::onClick
): Unit

A Material3 IconButton that plays or pauses the current media item.

@UnstableApi
@Composable
fun PreviousButton(
    player: Player,
    modifier: Modifier = Modifier,
    imageVector: @Composable PreviousButtonState.() -> ImageVector,
    contentDescription: @Composable PreviousButtonState.() -> String = { stringResource(R.string.previous_button) },
    tint: Color = LocalContentColor.current,
    onClick: PreviousButtonState.() -> Unit = PreviousButtonState::onClick
): Unit

A Material3 IconButton that seeks to the previous media item.

When clicked, it attempts to advance the player to the previous media item in its current playlist. The button's state (e.g., whether it's enabled) is managed by a PreviousButtonState instance derived from the provided player.

Parameters
player: Player

The Player to control.

modifier: Modifier = Modifier

The Modifier to be applied to the button.

imageVector: @Composable PreviousButtonState.() -> ImageVector

The supplier for ImageVector used for the icon displayed on the button.

contentDescription: @Composable PreviousButtonState.() -> String = { stringResource(R.string.previous_button) }

The content description for accessibility purposes. Defaults to R.string.previous_button.

tint: Color = LocalContentColor.current

Tint to be applied to imageVector. If Color.Unspecified is provided, then no tint is applied.

onClick: PreviousButtonState.() -> Unit = PreviousButtonState::onClick

The action to be performed when the button is clicked. This lambda has PreviousButtonState as its receiver, providing access to the button's current state (e.g., PreviousButtonState.isEnabled). The default behavior is to call PreviousButtonState.onClick, which seeks the player to the previous item if available. Consumers can customize this behavior:

  • To add custom logic while still performing the default previous action, call this.onClick() within your lambda.

  • To completely override the default behavior, implement your custom logic without calling this.onClick(). Note that in this case, the button might still be enabled based on the player state, so ensure your custom logic handles cases where seeking is not possible.

@UnstableApi
@Composable
fun PreviousButton(
    player: Player,
    modifier: Modifier = Modifier,
    painter: @Composable PreviousButtonState.() -> Painter = { painterResource(R.drawable.media3_icon_previous) },
    contentDescription: @Composable PreviousButtonState.() -> String = { stringResource(R.string.previous_button) },
    tint: Color = LocalContentColor.current,
    onClick: PreviousButtonState.() -> Unit = PreviousButtonState::onClick
): Unit

A Material3 IconButton that seeks to the previous media item.

When clicked, it attempts to advance the player to the previous media item in its current playlist. The button's state (e.g., whether it's enabled) is managed by a PreviousButtonState instance derived from the provided player.

Parameters
player: Player

The Player to control.

modifier: Modifier = Modifier

The Modifier to be applied to the button.

painter: @Composable PreviousButtonState.() -> Painter = { painterResource(R.drawable.media3_icon_previous) }

The supplier for Painter used for the icon displayed on the button. Defaults to R.drawable.media3_icon_previous.

contentDescription: @Composable PreviousButtonState.() -> String = { stringResource(R.string.previous_button) }

The content description for accessibility purposes. Defaults to R.string.previous_button.

tint: Color = LocalContentColor.current

Tint to be applied to painter. If Color.Unspecified is provided, then no tint is applied.

onClick: PreviousButtonState.() -> Unit = PreviousButtonState::onClick

The action to be performed when the button is clicked. This lambda has PreviousButtonState as its receiver, providing access to the button's current state (e.g., PreviousButtonState.isEnabled). The default behavior is to call PreviousButtonState.onClick, which seeks the player to the previous item if available. Consumers can customize this behavior:

  • To add custom logic while still performing the default previous action, call this.onClick() within your lambda.

  • To completely override the default behavior, implement your custom logic without calling this.onClick(). Note that in this case, the button might still be enabled based on the player state, so ensure your custom logic handles cases where seeking is not possible.

@UnstableApi
@Composable
fun RepeatButton(
    player: Player,
    modifier: Modifier = Modifier,
    toggleModeSequence: List<@Player.RepeatMode Int> = listOf(Player.REPEAT_MODE_OFF, Player.REPEAT_MODE_ONE, Player.REPEAT_MODE_ALL),
    imageVector: RepeatButtonState.() -> ImageVector,
    contentDescription: @Composable RepeatButtonState.() -> String = defaultRepeatModeContentDescription,
    tint: Color = LocalContentColor.current,
    onClick: RepeatButtonState.() -> Unit = RepeatButtonState::onClick
): Unit

A Material3 IconButton that toggles the repeat mode of the player.

When clicked, it cycles through the available repeat modes in the order defined by toggleModeSequence. The button's state (e.g., whether it's enabled and the current repeat mode icon) is managed by a RepeatButtonState instance derived from the provided player.

Parameters
player: Player

The Player to control.

modifier: Modifier = Modifier

The Modifier to be applied to the button.

toggleModeSequence: List<@Player.RepeatMode Int> = listOf(Player.REPEAT_MODE_OFF, Player.REPEAT_MODE_ONE, Player.REPEAT_MODE_ALL)

The sequence of repeat modes to cycle through when the button is clicked.

imageVector: RepeatButtonState.() -> ImageVector

The supplier for ImageVector used for the icon displayed on the button.

contentDescription: @Composable RepeatButtonState.() -> String = defaultRepeatModeContentDescription

The content description for accessibility purposes.

tint: Color = LocalContentColor.current

Tint to be applied to imageVector. If Color.Unspecified is provided, then no tint is applied.

onClick: RepeatButtonState.() -> Unit = RepeatButtonState::onClick

The action to be performed when the button is clicked. This lambda has RepeatButtonState as its receiver, providing access to the button's current state (e.g., RepeatButtonState.isEnabled). The default behavior is to call RepeatButtonState.onClick, which updates the player's repeat mode. Consumers can customize this behavior:

  • To add custom logic while still performing the default action, call this.onClick() within your lambda.

  • To completely override the default behavior, implement your custom logic without calling this.onClick(). Note that in this case, the button might still be enabled based on the player state, so ensure your custom logic handles cases where modifying the repeat mode is not possible.

@UnstableApi
@Composable
fun RepeatButton(
    player: Player,
    modifier: Modifier = Modifier,
    toggleModeSequence: List<@Player.RepeatMode Int> = listOf(Player.REPEAT_MODE_OFF, Player.REPEAT_MODE_ONE, Player.REPEAT_MODE_ALL),
    painter: @Composable RepeatButtonState.() -> Painter = defaultRepeatModePainterIcon,
    contentDescription: @Composable RepeatButtonState.() -> String = defaultRepeatModeContentDescription,
    tint: Color = LocalContentColor.current,
    onClick: RepeatButtonState.() -> Unit = RepeatButtonState::onClick
): Unit

A Material3 IconButton that toggles the repeat mode of the player.

When clicked, it cycles through the available repeat modes in the order defined by toggleModeSequence. The button's state (e.g., whether it's enabled and the current repeat mode icon) is managed by a RepeatButtonState instance derived from the provided player.

Parameters
player: Player

The Player to control.

modifier: Modifier = Modifier

The Modifier to be applied to the button.

toggleModeSequence: List<@Player.RepeatMode Int> = listOf(Player.REPEAT_MODE_OFF, Player.REPEAT_MODE_ONE, Player.REPEAT_MODE_ALL)

The sequence of repeat modes to cycle through when the button is clicked.

painter: @Composable RepeatButtonState.() -> Painter = defaultRepeatModePainterIcon

The supplier for Painter used for the icon displayed on the button.

contentDescription: @Composable RepeatButtonState.() -> String = defaultRepeatModeContentDescription

The content description for accessibility purposes.

tint: Color = LocalContentColor.current

Tint to be applied to painter. If Color.Unspecified is provided, then no tint is applied.

onClick: RepeatButtonState.() -> Unit = RepeatButtonState::onClick

The action to be performed when the button is clicked. This lambda has RepeatButtonState as its receiver, providing access to the button's current state (e.g., RepeatButtonState.isEnabled). The default behavior is to call RepeatButtonState.onClick, which updates the player's repeat mode. Consumers can customize this behavior:

  • To add custom logic while still performing the default action, call this.onClick() within your lambda.

  • To completely override the default behavior, implement your custom logic without calling this.onClick(). Note that in this case, the button might still be enabled based on the player state, so ensure your custom logic handles cases where modifying the repeat mode is not possible.

@UnstableApi
@Composable
fun SeekBackButton(
    player: Player,
    modifier: Modifier = Modifier,
    imageVector: SeekBackButtonState.() -> ImageVector,
    contentDescription: @Composable SeekBackButtonState.() -> String = defaultSeekBackContentDescription,
    tint: Color = LocalContentColor.current,
    onClick: SeekBackButtonState.() -> Unit = SeekBackButtonState::onClick
): Unit

A Material3 IconButton that seeks back in the current media item.

When clicked, it attempts to seek back in the player by the amount returned by Player.getSeekBackIncrement. The button's state (e.g., whether it's enabled) is managed by a SeekBackButtonState instance derived from the provided player.

Parameters
player: Player

The Player to control.

modifier: Modifier = Modifier

The Modifier to be applied to the button.

imageVector: SeekBackButtonState.() -> ImageVector

The supplier for ImageVector used for the icon displayed on the button.

contentDescription: @Composable SeekBackButtonState.() -> String = defaultSeekBackContentDescription

The content description for accessibility purposes.

tint: Color = LocalContentColor.current

Tint to be applied to imageVector. If Color.Unspecified is provided, then no tint is applied.

onClick: SeekBackButtonState.() -> Unit = SeekBackButtonState::onClick

The action to be performed when the button is clicked. This lambda has SeekBackButtonState as its receiver, providing access to the button's current state (e.g., SeekBackButtonState.isEnabled). The default behavior is to call SeekBackButtonState.onClick, which seeks back in the current media item. Consumers can customize this behavior:

  • To add custom logic while still performing the default seek back action, call this.onClick() within your lambda.

  • To completely override the default behavior, implement your custom logic without calling this.onClick(). Note that in this case, the button might still be enabled based on the player state, so ensure your custom logic handles cases where seeking is not possible.

@UnstableApi
@Composable
fun SeekBackButton(
    player: Player,
    modifier: Modifier = Modifier,
    painter: @Composable SeekBackButtonState.() -> Painter = defaultSeekBackPainterIcon,
    contentDescription: @Composable SeekBackButtonState.() -> String = defaultSeekBackContentDescription,
    tint: Color = LocalContentColor.current,
    onClick: SeekBackButtonState.() -> Unit = SeekBackButtonState::onClick
): Unit

A Material3 IconButton that seeks back in the current media item.

When clicked, it attempts to seek back in the player by the amount returned by Player.getSeekBackIncrement. The button's state (e.g., whether it's enabled) is managed by a SeekBackButtonState instance derived from the provided player.

Parameters
player: Player

The Player to control.

modifier: Modifier = Modifier

The Modifier to be applied to the button.

painter: @Composable SeekBackButtonState.() -> Painter = defaultSeekBackPainterIcon

The supplier for Painter used for the icon displayed on the button.

contentDescription: @Composable SeekBackButtonState.() -> String = defaultSeekBackContentDescription

The content description for accessibility purposes.

tint: Color = LocalContentColor.current

Tint to be applied to painter. If Color.Unspecified is provided, then no tint is applied.

onClick: SeekBackButtonState.() -> Unit = SeekBackButtonState::onClick

The action to be performed when the button is clicked. This lambda has SeekBackButtonState as its receiver, providing access to the button's current state (e.g., SeekBackButtonState.isEnabled). The default behavior is to call SeekBackButtonState.onClick, which seeks back in the current media item. Consumers can customize this behavior:

  • To add custom logic while still performing the default seek back action, call this.onClick() within your lambda.

  • To completely override the default behavior, implement your custom logic without calling this.onClick(). Note that in this case, the button might still be enabled based on the player state, so ensure your custom logic handles cases where seeking is not possible.

@UnstableApi
@Composable
fun SeekForwardButton(
    player: Player,
    modifier: Modifier = Modifier,
    imageVector: SeekForwardButtonState.() -> ImageVector,
    contentDescription: @Composable SeekForwardButtonState.() -> String = defaultSeekForwardContentDescription,
    tint: Color = LocalContentColor.current,
    onClick: SeekForwardButtonState.() -> Unit = SeekForwardButtonState::onClick
): Unit

A Material3 IconButton that seeks forward in the current media item.

When clicked, it attempts to seek forward in the player by the amount returned by Player.getSeekForwardIncrement. The button's state (e.g., whether it's enabled) is managed by a SeekForwardButtonState instance derived from the provided player.

Parameters
player: Player

The Player to control.

modifier: Modifier = Modifier

The Modifier to be applied to the button.

imageVector: SeekForwardButtonState.() -> ImageVector

The supplier for ImageVector used for the icon displayed on the button.

contentDescription: @Composable SeekForwardButtonState.() -> String = defaultSeekForwardContentDescription

The content description for accessibility purposes. Defaults to a string that changes based on the seek forward increment.

tint: Color = LocalContentColor.current

Tint to be applied to imageVector. If Color.Unspecified is provided, then no tint is applied.

onClick: SeekForwardButtonState.() -> Unit = SeekForwardButtonState::onClick

The action to be performed when the button is clicked. This lambda has SeekForwardButtonState as its receiver, providing access to the button's current state (e.g., SeekForwardButtonState.isEnabled). The default behavior is to call SeekForwardButtonState.onClick, which seeks forward in the current media item. Consumers can customize this behavior:

  • To add custom logic while still performing the default seek forward action, call this.onClick() within your lambda.

  • To completely override the default behavior, implement your custom logic without calling this.onClick(). Note that in this case, the button might still be enabled based on the player state, so ensure your custom logic handles cases where seeking is not possible.

@UnstableApi
@Composable
fun SeekForwardButton(
    player: Player,
    modifier: Modifier = Modifier,
    painter: @Composable SeekForwardButtonState.() -> Painter = defaultSeekForwardPainterIcon,
    contentDescription: @Composable SeekForwardButtonState.() -> String = defaultSeekForwardContentDescription,
    tint: Color = LocalContentColor.current,
    onClick: SeekForwardButtonState.() -> Unit = SeekForwardButtonState::onClick
): Unit

A Material3 IconButton that seeks forward in the current media item.

When clicked, it attempts to seek forward in the player by the amount returned by Player.getSeekForwardIncrement. The button's state (e.g., whether it's enabled) is managed by a SeekForwardButtonState instance derived from the provided player.

Parameters
player: Player

The Player to control.

modifier: Modifier = Modifier

The Modifier to be applied to the button.

painter: @Composable SeekForwardButtonState.() -> Painter = defaultSeekForwardPainterIcon

The supplier for Painter used for the icon displayed on the button. Defaults to an icon that changes based on the seek forward increment.

contentDescription: @Composable SeekForwardButtonState.() -> String = defaultSeekForwardContentDescription

The content description for accessibility purposes. Defaults to a string that changes based on the seek forward increment.

tint: Color = LocalContentColor.current

Tint to be applied to painter. If Color.Unspecified is provided, then no tint is applied.

onClick: SeekForwardButtonState.() -> Unit = SeekForwardButtonState::onClick

The action to be performed when the button is clicked. This lambda has SeekForwardButtonState as its receiver, providing access to the button's current state (e.g., SeekForwardButtonState.isEnabled). The default behavior is to call SeekForwardButtonState.onClick, which seeks forward in the current media item. Consumers can customize this behavior:

  • To add custom logic while still performing the default seek forward action, call this.onClick() within your lambda.

  • To completely override the default behavior, implement your custom logic without calling this.onClick(). Note that in this case, the button might still be enabled based on the player state, so ensure your custom logic handles cases where seeking is not possible.

@UnstableApi
@Composable
fun ShuffleButton(
    player: Player,
    modifier: Modifier = Modifier,
    imageVector: ShuffleButtonState.() -> ImageVector,
    contentDescription: @Composable ShuffleButtonState.() -> String = defaultShuffleContentDescription,
    tint: Color = LocalContentColor.current,
    onClick: ShuffleButtonState.() -> Unit = ShuffleButtonState::onClick
): Unit

A Material3 IconButton that toggles the shuffle mode of the player.

When clicked, it enables or disables the player's shuffle mode. The button's state (e.g., whether it's enabled and the shuffle icon) is managed by a ShuffleButtonState instance derived from the provided player.

Parameters
player: Player

The Player to control.

modifier: Modifier = Modifier

The Modifier to be applied to the button.

imageVector: ShuffleButtonState.() -> ImageVector

The supplier for ImageVector used for the icon displayed on the button.

contentDescription: @Composable ShuffleButtonState.() -> String = defaultShuffleContentDescription

The content description for accessibility purposes.

tint: Color = LocalContentColor.current

Tint to be applied to imageVector. If Color.Unspecified is provided, then no tint is applied.

onClick: ShuffleButtonState.() -> Unit = ShuffleButtonState::onClick

The action to be performed when the button is clicked. This lambda has ShuffleButtonState as its receiver, providing access to the button's current state (e.g., ShuffleButtonState.isEnabled). The default behavior is to call ShuffleButtonState.onClick, which toggles the player's shuffle mode. Consumers can customize this behavior:

  • To add custom logic while still performing the default action, call this.onClick() within your lambda.

  • To completely override the default behavior, implement your custom logic without calling this.onClick(). Note that in this case, the button might still be enabled based on the player state, so ensure your custom logic handles cases where modifying the shuffle mode is not possible.

@UnstableApi
@Composable
fun ShuffleButton(
    player: Player,
    modifier: Modifier = Modifier,
    painter: @Composable ShuffleButtonState.() -> Painter = defaultShufflePainterIcon,
    contentDescription: @Composable ShuffleButtonState.() -> String = defaultShuffleContentDescription,
    tint: Color = LocalContentColor.current,
    onClick: ShuffleButtonState.() -> Unit = ShuffleButtonState::onClick
): Unit

A Material3 IconButton that toggles the shuffle mode of the player.

When clicked, it enables or disables the player's shuffle mode. The button's state (e.g., whether it's enabled and the shuffle icon) is managed by a ShuffleButtonState instance derived from the provided player.

Parameters
player: Player

The Player to control.

modifier: Modifier = Modifier

The Modifier to be applied to the button.

painter: @Composable ShuffleButtonState.() -> Painter = defaultShufflePainterIcon

The supplier for Painter used for the icon displayed on the button.

contentDescription: @Composable ShuffleButtonState.() -> String = defaultShuffleContentDescription

The content description for accessibility purposes.

tint: Color = LocalContentColor.current

Tint to be applied to painter. If Color.Unspecified is provided, then no tint is applied.

onClick: ShuffleButtonState.() -> Unit = ShuffleButtonState::onClick

The action to be performed when the button is clicked. This lambda has ShuffleButtonState as its receiver, providing access to the button's current state (e.g., ShuffleButtonState.isEnabled). The default behavior is to call ShuffleButtonState.onClick, which toggles the player's shuffle mode. Consumers can customize this behavior:

  • To add custom logic while still performing the default action, call this.onClick() within your lambda.

  • To completely override the default behavior, implement your custom logic without calling this.onClick(). Note that in this case, the button might still be enabled based on the player state, so ensure your custom logic handles cases where modifying the shuffle mode is not possible.