SeekBackButtonState

@UnstableApi
class SeekBackButtonState


State that holds all interactions to correctly deal with a UI component representing a seek back button.

Summary

Public constructors

Public functions

suspend Unit

Subscribes to updates from Player.Events and listens to

Unit

Handles the interaction with the SeekBackButton by seeking back in the current androidx.media3.common.MediaItem by seekBackAmountMs milliseconds.

Public properties

Boolean

true if player is not null and Player.COMMAND_SEEK_BACK is available.

Long

determined by player's seekBackIncrement.

Public constructors

SeekBackButtonState

SeekBackButtonState(player: Player?)

Public functions

observe

suspend fun observe(): Unit

Subscribes to updates from Player.Events and listens to

onClick

fun onClick(): Unit

Handles the interaction with the SeekBackButton by seeking back in the current androidx.media3.common.MediaItem by seekBackAmountMs milliseconds.

This method must only be programmatically called if the state is enabled. However, it can be freely provided into containers that take care of skipping the onClick if a particular UI node is not enabled (see Compose Clickable Modifier).

Public properties

isEnabled

val isEnabledBoolean

true if player is not null and Player.COMMAND_SEEK_BACK is available.

seekBackAmountMs

val seekBackAmountMsLong

determined by player's seekBackIncrement. Defaults to 0 if player is null.