Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
LaunchedEffect(playingItemIndex) {
if (playingItemIndex == null) {
exoPlayer.pause()
} else {
val video = videos[playingItemIndex]
exoPlayer.setMediaItem(MediaItem.fromUri(video.mediaUrl), video.lastPlayedPosition)
exoPlayer.prepare()
exoPlayer.playWhenReady = true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment