Skip to content

Instantly share code, notes, and snippets.

@Ochornma
Created September 7, 2020 23:15
Show Gist options
  • Select an option

  • Save Ochornma/491be4ae5ebd873063c7515eb0fd5a0e to your computer and use it in GitHub Desktop.

Select an option

Save Ochornma/491be4ae5ebd873063c7515eb0fd5a0e to your computer and use it in GitHub Desktop.
val dataSourceFactory = DefaultDataSourceFactory(context, Util.getUserAgent(context, getString(R.string.app_name)))
val cachedDataSourceFactory =CacheDataSourceFactory((application as App).appContainer.downloadCache, dataSourceFactory)
val mediaSources = ProgressiveMediaSource.Factory(cachedDataSourceFactory).createMediaSource(
Uri.parse(media.url))
player.prepare(mediaSources)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment