Skip to content

Instantly share code, notes, and snippets.

@Skyyo
Last active October 5, 2021 20:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Skyyo/3f8d7aba01421ceb5c467331b4d53feb to your computer and use it in GitHub Desktop.
Save Skyyo/3f8d7aba01421ceb5c467331b4d53feb to your computer and use it in GitHub Desktop.
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