SeekForwardButtonState

@UnstableApi
class SeekForwardButtonState


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

Summary

Public constructors

Public functions

suspend Unit

Subscribes to updates from Player.Events and listens to

Unit

Handles the interaction with the SeekForwardButton by seeking forward in the current androidx.media3.common.MediaItem by seekForwardAmountMs milliseconds.

Public properties

Boolean

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

Long

determined by player's seekForwardIncrement.

Public constructors

SeekForwardButtonState

SeekForwardButtonState(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 SeekForwardButton by seeking forward in the current androidx.media3.common.MediaItem by seekForwardAmountMs milliseconds.

This method does nothing if Player.COMMAND_SEEK_FORWARD is not available.

Public properties

isEnabled

val isEnabledBoolean

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

seekForwardAmountMs

val seekForwardAmountMsLong

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