PlaybackSpeedState

@UnstableApi
class PlaybackSpeedState


State that holds all interactions to correctly deal with a UI component representing a playback speed controller.

In most cases, this will be created via rememberPlaybackSpeedState.

Summary

Public constructors

Public functions

suspend Nothing

Subscribes to updates from Player.Events and listens to

Unit

Updates the playback speed of the Player backing this state.

Public properties

Boolean

determined by isCommandAvailable(Player.COMMAND_SET_SPEED_AND_PITCH)

Float

determined by Player.playbackParameters.speed.

Public constructors

PlaybackSpeedState

PlaybackSpeedState(player: Player)
Parameters
player: Player

Player object that operates as a state provider.

Public functions

observe

suspend fun observe(): Nothing

Subscribes to updates from Player.Events and listens to

updatePlaybackSpeed

fun updatePlaybackSpeed(speed: Float): Unit

Updates the playback speed of the Player backing this state.

Public properties

isEnabled

val isEnabledBoolean

determined by isCommandAvailable(Player.COMMAND_SET_SPEED_AND_PITCH)

playbackSpeed

val playbackSpeedFloat

determined by Player.playbackParameters.speed.