# rememberPresentationState

## Functions summary

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/PresentationState` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/rememberPresentationState.composable#rememberPresentationState(androidx.media3.common.Player,kotlin.Boolean)(player: https://developer.android.com/reference/kotlin/androidx/media3/common/Player?, keepContentOnReset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` 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. |

## Functions

### rememberPresentationState

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/PresentationState.kt+function:rememberPresentationState)

```
@UnstableApi
@Composable
fun rememberPresentationState(
    player: Player?,
    keepContentOnReset: Boolean = false
): PresentationState
```

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.

Note that if the `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` instance changes between compositions, the method will not produce a new value. The same object will be reused and subscribe to the `https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Events` of the new player.

| Parameters |
|---|---|
| `player: https://developer.android.com/reference/kotlin/androidx/media3/common/Player?` | the Player whose `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/PresentationState` will be controlled. |
| `keepContentOnReset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | whether the currently displayed video frame or media artwork is kept visible when tracks change or player changes. Defaults to false. |