Skip to content

Instantly share code, notes, and snippets.

@prateek54
Created January 20, 2022 21:30
Show Gist options
  • Save prateek54/63fecda422c4ff22f7a248778a48efb2 to your computer and use it in GitHub Desktop.
Save prateek54/63fecda422c4ff22f7a248778a48efb2 to your computer and use it in GitHub Desktop.
Init for ExoPlayer with cache data source
val mediaItem = MediaItem.fromUri(VIDEO_URL)
val mediaSource =
HlsMediaSource.Factory(cacheDataSourceFactory).createMediaSource(mediaItem)
player.setMediaSource(mediaSource)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment