SeekForwardButton

Functions summary

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

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

Functions

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

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

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: 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.