androidx.media3.ui.compose.state
Classes
CurrentMediaItemState |
A state holder that observes a |
ErrorState |
State holder that tracks the |
MuteButtonState |
State that holds all interactions to correctly deal with a UI component representing a Mute button. |
NextButtonState |
State that holds all interactions to correctly deal with a UI component representing a seek-to-next button. |
PlayPauseButtonState |
State that converts the necessary information from the |
PlaybackSpeedState |
State that holds all interactions to correctly deal with a UI component representing a playback speed controller. |
PlayerStateObserver |
Utility to observe |
PlaylistState |
State that holds information about the current playback playlist. |
PresentationState |
State that holds information to correctly deal with UI components related to the rendering of frames to a surface. |
PreviousButtonState |
State that holds all interactions to correctly deal with a UI component representing a seek-to-previous button. |
ProgressStateWithTickCount |
State that aims to hold accurate progress information (position, bufferedPosition, duration) that is required for a UI component representing a non-textual progress indicator, e.g. circular or linear. |
ProgressStateWithTickInterval |
State that holds playback progress information of a |
RepeatButtonState |
State that holds all interactions to correctly deal with a UI component representing a Repeat On/All/Off button. |
SeekBackButtonState |
State that holds all interactions to correctly deal with a UI component representing a seek back button. |
SeekForwardButtonState |
State that holds all interactions to correctly deal with a UI component representing a seek forward button. |
ShuffleButtonState |
State that holds all interactions to correctly deal with a UI component representing a Shuffle On/Off button. |
Composables
rememberCurrentMediaItemState |
Remembers the value of |
rememberErrorState |
Remembers the value of |
rememberMuteButtonState |
Remembers the value of |
rememberNextButtonState |
Remembers the value of |
rememberPlayPauseButtonState |
Remembers the value of |
rememberPlaybackSpeedState |
Remember the value of |
rememberPlaylistState |
Remembers the value of |
rememberPresentationState |
Remembers the value of |
rememberPreviousButtonState |
Remembers the value of |
rememberProgressStateWithTickCount |
Remember the value of |
rememberProgressStateWithTickInterval |
Remember the value of |
rememberRepeatButtonState |
Remember the value of |
rememberSeekBackButtonState |
Remembers the value of |
rememberSeekForwardButtonState |
Remembers the value of |
rememberShuffleButtonState |
Remember the value of |
Constants summary
const Long |
@VisibleForTesting(otherwise = 2) |
const Long |
Extension functions summary
PlayerStateObserver |
@UnstableApiUtility to observe |
Constants
FALLBACK_UPDATE_INTERVAL_MS
@VisibleForTesting(otherwise = 2)
@UnstableApi
const val FALLBACK_UPDATE_INTERVAL_MS = 1000: Long
MIN_UPDATE_INTERVAL_MS
@UnstableApi
const val MIN_UPDATE_INTERVAL_MS = 8: Long
Extension functions
Player.observeState
@UnstableApi
fun Player.observeState(
firstEvent: @Player.Event Int,
vararg otherEvents: Int,
stateUpdater: (Player) -> Unit
): PlayerStateObserver
Utility to observe Player states by listening to events.
| Parameters | |
|---|---|
firstEvent: @Player.Event Int |
The first |
vararg otherEvents: Int |
Additional |
stateUpdater: (Player) -> Unit |
The operation to trigger initially and whenever one of the configured events happen |