# androidx.media3.ui.compose.state

## Classes

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/CuesState` | State holder that converts `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onCues(java.util.List<androidx.media3.common.text.Cue>)` events into a State of List and tracks the availability of text commands. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/CurrentMediaItemState` | A state holder that observes a `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` and provides reactive updates for properties of the currently playing media item. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/ErrorState` | State holder that tracks the `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getPlayerError()` by listening to `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#EVENT_PLAYER_ERROR()` and `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#EVENT_PLAYBACK_STATE_CHANGED()`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/MuteButtonState` | State that holds all interactions to correctly deal with a UI component representing a Mute button. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/NextButtonState` | State that holds all interactions to correctly deal with a UI component representing a seek-to-next button. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/PlayPauseButtonState` | State that converts the necessary information from the `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` to correctly deal with a UI component representing a PlayPause button. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/PlaybackSpeedState` | State that holds all interactions to correctly deal with a UI component representing a playback speed controller. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/PlaybackState` | A general-purpose, read-only state holder that observes and exposes the core playback states of a `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` reactively for Compose UIs. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/PlayerStateObserver` | Utility to observe `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` states by listening to events. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/PlaylistState` | State that holds information about the current playback playlist. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/PresentationState` | State that holds information to correctly deal with UI components related to the rendering of frames to a surface. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/PreviousButtonState` | State that holds all interactions to correctly deal with a UI component representing a seek-to-previous button. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/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. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/ProgressStateWithTickInterval` | State that holds playback progress information of a `https://developer.android.com/reference/kotlin/androidx/media3/common/Player`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/RepeatButtonState` | State that holds all interactions to correctly deal with a UI component representing a Repeat On/All/Off button. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/SeekBackButtonState` | State that holds all interactions to correctly deal with a UI component representing a seek back button. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/SeekForwardButtonState` | State that holds all interactions to correctly deal with a UI component representing a seek forward button. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/ShuffleButtonState` | State that holds all interactions to correctly deal with a UI component representing a Shuffle On/Off button. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/TrackSelectionOption` | Represents a unique track configuration available for selection, based on the active `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/TrackFilter`s. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/TrackSelectionParametersState` | A state holder that exposes the current `https://developer.android.com/reference/kotlin/androidx/media3/common/Tracks` and `https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters` of a `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` as Compose state. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/TrackSelectionState` | A state object that manages the track selection for a specific `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/TrackSelectionState#trackType()`. |

## Annotations

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/DisplayMode` |   |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/OnOffState` | Represents the track selection state for a specific track type. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/TrackFilter` | Supported filters for selecting specific tracks. |

## Composables

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/rememberCuesState.composable` | Remembers the value of `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/CuesState` created based on the passed `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` and launches a coroutine to listen to `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` cue changes. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/rememberCurrentMediaItemState.composable` | Remembers the value of `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/CurrentMediaItemState` created based on the passed `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` and launch a coroutine to listen to `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` changes. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/rememberErrorState.composable` | Remembers the value of `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/ErrorState` created based on the passed `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` and launches a coroutine to listen to `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` error changes. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/rememberMuteButtonState.composable` | Remembers the value of `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/MuteButtonState` created based on the passed `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` and launch a coroutine to listen to `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` changes. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/rememberNextButtonState.composable` | Remembers the value of `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/NextButtonState` created based on the passed `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` and launch a coroutine to listen to `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` changes. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/rememberPlayPauseButtonState.composable` | Remembers the value of `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/PlayPauseButtonState` created based on the passed `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` and launch a coroutine to listen to `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` changes. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/rememberPlaybackSpeedState.composable` | Remember the value of `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/PlaybackSpeedState` created based on the passed `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` and launch a coroutine to listen to `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` changes. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/rememberPlaybackState.composable` | Creates and remembers a `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/PlaybackState` for the given `https://developer.android.com/reference/kotlin/androidx/media3/common/Player`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/rememberPlaylistState.composable` | Remembers the value of `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/PlaylistState` created based on the passed `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` and launch a coroutine to listen to `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` changes. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/rememberPresentationState.composable` | Remembers the value of `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/PresentationState` created based on the passed `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` and launches a coroutine to listen to `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` changes. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/rememberPreviousButtonState.composable` | Remembers the value of `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/PreviousButtonState` created based on the passed `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` and launch a coroutine to listen to `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` changes. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/rememberProgressStateWithTickCount.composable` | Remember the value of `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/ProgressStateWithTickCount` created based on the passed `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` and launch a coroutine to listen to `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` changes. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/rememberProgressStateWithTickInterval.composable` | Remember the value of `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/ProgressStateWithTickInterval` created based on the passed `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` and launch a coroutine to listen to `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` changes. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/rememberRepeatButtonState.composable` | Remember the value of `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/RepeatButtonState` created based on the passed `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` and launch a coroutine to listen to `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` changes. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/rememberSeekBackButtonState.composable` | Remembers the value of `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/SeekBackButtonState` created based on the passed `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` and launch a coroutine to listen to `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` changes. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/rememberSeekForwardButtonState.composable` | Remembers the value of `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/SeekForwardButtonState` created based on the passed `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` and launch a coroutine to listen to `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` changes. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/rememberShuffleButtonState.composable` | Remember the value of `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/ShuffleButtonState` created based on the passed `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` and launch a coroutine to listen to `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` changes. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/rememberTrackSelectionParametersState.composable` | Remembers the value of `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/TrackSelectionParametersState` created based on the passed `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` and launches a coroutine to listen to `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` changes. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/rememberTrackSelectionState.composable` | Remembers a `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/TrackSelectionState` for the given `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/package-summary#rememberTrackSelectionState(androidx.media3.common.Player,kotlin.Int,kotlin.Int,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean)` and `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/package-summary#rememberTrackSelectionState(androidx.media3.common.Player,kotlin.Int,kotlin.Int,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean)`. |

## Constants summary

|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/VisibleForTesting(otherwise = 2) @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/package-summary#FALLBACK_UPDATE_INTERVAL_MS() = 1000` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/package-summary#MIN_UPDATE_INTERVAL_MS() = 8` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/package-summary#SHOW_BUFFERING_ALWAYS()` The buffering view is always shown when the player is in the buffering state. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/package-summary#SHOW_BUFFERING_WHEN_PLAYING()` The buffering view is shown when the player is in the buffering state and shouldShowPlayButton is false. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/package-summary#SHOW_REPLAY_ON_ENDED()` The replay icon is shown when the player is in the ended state. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/package-summary#SHOW_RETRY_ON_ERROR()` The retry icon is shown when the player has encountered an error. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/package-summary#TRACK_FILTER_LANGUAGE()` Filter for selecting track language (applies to audio or text depending on track type). |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/package-summary#TRACK_FILTER_MIME_TYPE()` Filter for selecting video MIME type (`sampleMimeType`). |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/package-summary#TRACK_FILTER_RESOLUTION()` Filter for selecting video resolution (`width` and `height`). |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/package-summary#TRACK_SELECTION_AUTO() = 1` No specific preferences or constraints are applied for the active filters (the player chooses automatically). |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/package-summary#TRACK_SELECTION_OFF() = 0` The track type is explicitly disabled. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/package-summary#TRACK_SELECTION_ON() = 2` Specific preferences or constraints are applied for the active filters. |

## Extension functions summary

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/PlayerStateObserver` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/common/Player.https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/package-summary#(androidx.media3.common.Player).observeState(kotlin.Int,kotlin.IntArray,kotlin.Function1)( firstEvent: @https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Event https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, vararg otherEvents: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, stateUpdater: (https://developer.android.com/reference/kotlin/androidx/media3/common/Player) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html )` Utility to observe `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` states by listening to events. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/PlayerStateObserver` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/common/Player.https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/package-summary#(androidx.media3.common.Player).observeState(kotlin.Int,kotlin.IntArray,kotlin.Function2)( firstEvent: @https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Event https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, vararg otherEvents: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, stateUpdater: (https://developer.android.com/reference/kotlin/androidx/media3/common/Player, https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Events) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html )` Utility to observe `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` states by listening to events. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/PlayerStateObserver` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/common/Player.https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/package-summary#(androidx.media3.common.Player).observeState(kotlin.Int,kotlin.IntArray,kotlin.Function1,kotlin.Function2)( firstEvent: @https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Event https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, vararg otherEvents: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, initialStateUpdater: (https://developer.android.com/reference/kotlin/androidx/media3/common/Player) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, stateUpdater: (https://developer.android.com/reference/kotlin/androidx/media3/common/Player, https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Events) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html )` Utility to observe `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` states by listening to events. |

## Constants

### FALLBACK_UPDATE_INTERVAL_MS

Artifact: [androidx.media3:media3-ui-compose](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/ui/compose/state/ProgressStateJob.kt+symbol:FALLBACK_UPDATE_INTERVAL_MS)

```
@VisibleForTesting(otherwise = 2)
@UnstableApi
const val FALLBACK_UPDATE_INTERVAL_MS = 1000: Long
```

### MIN_UPDATE_INTERVAL_MS

Artifact: [androidx.media3:media3-ui-compose](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/ui/compose/state/ProgressStateJob.kt+symbol:MIN_UPDATE_INTERVAL_MS)

```
@UnstableApi
const val MIN_UPDATE_INTERVAL_MS = 8: Long
```

### SHOW_BUFFERING_ALWAYS

Artifact: [androidx.media3:media3-ui-compose](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/ui/compose/state/PlayPauseButtonState.kt+symbol:SHOW_BUFFERING_ALWAYS)

```
@UnstableApi
const val SHOW_BUFFERING_ALWAYS: Int
```

The buffering view is always shown when the player is in the buffering state.

### SHOW_BUFFERING_WHEN_PLAYING

Artifact: [androidx.media3:media3-ui-compose](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/ui/compose/state/PlayPauseButtonState.kt+symbol:SHOW_BUFFERING_WHEN_PLAYING)

```
@UnstableApi
const val SHOW_BUFFERING_WHEN_PLAYING: Int
```

The buffering view is shown when the player is in the buffering state and shouldShowPlayButton is false.

### SHOW_REPLAY_ON_ENDED

Artifact: [androidx.media3:media3-ui-compose](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/ui/compose/state/PlayPauseButtonState.kt+symbol:SHOW_REPLAY_ON_ENDED)

```
@UnstableApi
const val SHOW_REPLAY_ON_ENDED: Int
```

The replay icon is shown when the player is in the ended state.

### SHOW_RETRY_ON_ERROR

Artifact: [androidx.media3:media3-ui-compose](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/ui/compose/state/PlayPauseButtonState.kt+symbol:SHOW_RETRY_ON_ERROR)

```
@UnstableApi
const val SHOW_RETRY_ON_ERROR: Int
```

The retry icon is shown when the player has encountered an error.

### TRACK_FILTER_LANGUAGE

Artifact: [androidx.media3:media3-ui-compose](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/ui/compose/state/TrackSelectionState.kt+symbol:TRACK_FILTER_LANGUAGE)

```
@UnstableApi
const val TRACK_FILTER_LANGUAGE: Int
```

Filter for selecting track language (applies to audio or text depending on track type).

### TRACK_FILTER_MIME_TYPE

Artifact: [androidx.media3:media3-ui-compose](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/ui/compose/state/TrackSelectionState.kt+symbol:TRACK_FILTER_MIME_TYPE)

```
@UnstableApi
const val TRACK_FILTER_MIME_TYPE: Int
```

Filter for selecting video MIME type (`sampleMimeType`).

### TRACK_FILTER_RESOLUTION

Artifact: [androidx.media3:media3-ui-compose](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/ui/compose/state/TrackSelectionState.kt+symbol:TRACK_FILTER_RESOLUTION)

```
@UnstableApi
const val TRACK_FILTER_RESOLUTION: Int
```

Filter for selecting video resolution (`width` and `height`).

### TRACK_SELECTION_AUTO

Artifact: [androidx.media3:media3-ui-compose](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/ui/compose/state/TrackSelectionState.kt+symbol:TRACK_SELECTION_AUTO)

```
@UnstableApi
const val TRACK_SELECTION_AUTO = 1: Int
```

No specific preferences or constraints are applied for the active filters (the player chooses automatically).

### TRACK_SELECTION_OFF

Artifact: [androidx.media3:media3-ui-compose](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/ui/compose/state/TrackSelectionState.kt+symbol:TRACK_SELECTION_OFF)

```
@UnstableApi
const val TRACK_SELECTION_OFF = 0: Int
```

The track type is explicitly disabled.

### TRACK_SELECTION_ON

Artifact: [androidx.media3:media3-ui-compose](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/ui/compose/state/TrackSelectionState.kt+symbol:TRACK_SELECTION_ON)

```
@UnstableApi
const val TRACK_SELECTION_ON = 2: Int
```

Specific preferences or constraints are applied for the active filters.

## Extension functions

### Player.observeState

Artifact: [androidx.media3:media3-ui-compose](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/ui/compose/state/PlayerStateObserver.kt+function:observeState)

```
@UnstableApi
fun Player.observeState(
    firstEvent: @Player.Event Int,
    vararg otherEvents: Int,
    stateUpdater: (Player) -> Unit
): PlayerStateObserver
```

Utility to observe `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` states by listening to events.

| Parameters |
|---|---|
| `firstEvent: @https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Event https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The first `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Event` to listen to. |
| `vararg otherEvents: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Additional `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Event` types to listen to. |
| `stateUpdater: (https://developer.android.com/reference/kotlin/androidx/media3/common/Player) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | The operation to trigger initially and whenever one of the configured events happen. |

### Player.observeState

Artifact: [androidx.media3:media3-ui-compose](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/ui/compose/state/PlayerStateObserver.kt+function:observeState)

```
@UnstableApi
fun Player.observeState(
    firstEvent: @Player.Event Int,
    vararg otherEvents: Int,
    stateUpdater: (Player, Player.Events) -> Unit
): PlayerStateObserver
```

Utility to observe `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` states by listening to events.

| Parameters |
|---|---|
| `firstEvent: @https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Event https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The first `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Event` to listen to. |
| `vararg otherEvents: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Additional `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Event` types to listen to. |
| `stateUpdater: (https://developer.android.com/reference/kotlin/androidx/media3/common/Player, https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Events) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | The operation to trigger initially (with all configured `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Events`) and whenever one of the configured events happen. |

### Player.observeState

Artifact: [androidx.media3:media3-ui-compose](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/ui/compose/state/PlayerStateObserver.kt+function:observeState)

```
@UnstableApi
fun Player.observeState(
    firstEvent: @Player.Event Int,
    vararg otherEvents: Int,
    initialStateUpdater: (Player) -> Unit,
    stateUpdater: (Player, Player.Events) -> Unit
): PlayerStateObserver
```

Utility to observe `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` states by listening to events.

| Parameters |
|---|---|
| `firstEvent: @https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Event https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The first `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Event` to listen to. |
| `vararg otherEvents: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Additional `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Event` types to listen to. |
| `initialStateUpdater: (https://developer.android.com/reference/kotlin/androidx/media3/common/Player) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | The operation to trigger initially on creation and when `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/PlayerStateObserver#observe()` starts. |
| `stateUpdater: (https://developer.android.com/reference/kotlin/androidx/media3/common/Player, https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Events) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | The operation to trigger whenever one of the configured events happen. |