SeekBackButton

Functions summary

Unit
@UnstableApi
@Composable
SeekBackButton(
    player: Player?,
    modifier: Modifier,
    imageVector: SeekBackButtonState.() -> ImageVector,
    contentDescription: @Composable SeekBackButtonState.() -> String,
    colors: IconButtonColors,
    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,
    colors: IconButtonColors,
    tint: Color,
    onClick: SeekBackButtonState.() -> Unit
)

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

Functions

@UnstableApi
@Composable
fun SeekBackButton(
    player: Player?,
    modifier: Modifier = Modifier,
    imageVector: SeekBackButtonState.() -> ImageVector,
    contentDescription: @Composable SeekBackButtonState.() -> String = defaultSeekBackContentDescription,
    colors: IconButtonColors = IconButtonDefaults.iconButtonColors(),
    tint: Color = Color.Unspecified,
    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.

colors: IconButtonColors = IconButtonDefaults.iconButtonColors()

IconButtonColors that will be used to resolve the colors used for this icon button in different states. See IconButtonDefaults.iconButtonColors.

tint: Color = Color.Unspecified

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,
    colors: IconButtonColors = IconButtonDefaults.iconButtonColors(),
    tint: Color = Color.Unspecified,
    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.

colors: IconButtonColors = IconButtonDefaults.iconButtonColors()

IconButtonColors that will be used to resolve the colors used for this icon button in different states. See IconButtonDefaults.iconButtonColors.

tint: Color = Color.Unspecified

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.