Skip to content

Instantly share code, notes, and snippets.

View edivad1999's full-sized avatar
👀

Davide Magli edivad1999

👀
View GitHub Profile
@SuppressLint("OpaqueUnitKey")
@androidx.annotation.OptIn(androidx.media3.common.util.UnstableApi::class)
@Composable
fun VideoPlayer(uri: String, modifier: Modifier = Modifier) {
val customPlayer = rememberSaveable(saver = MyPlayer.saver) {
MyPlayer(uri)
}
Player(customPlayer = customPlayer, modifier = modifier)
PlayerDisposer(player = customPlayer)