rememberPresentationState

Functions summary

PresentationState

Remembers the value of PresentationState created based on the passed Player and launches a coroutine to listen to Player's changes.

Functions

rememberPresentationState

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

Remembers the value of PresentationState created based on the passed Player and launches a coroutine to listen to Player's changes.

Note that if the Player instance changes between compositions, the method will not produce a new value. The same object will be reused and subscribe to the Player.Events of the new player.

Parameters
player: Player?

the Player whose PresentationState will be controlled.

keepContentOnReset: Boolean = false

whether the currently displayed video frame or media artwork is kept visible when tracks change or player changes. Defaults to false.