Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: Exoplayer - ExtractorMediaSource is deprecated

I am following this tutorial to implement the Exoplayer. But the ExtractorMediaSource class is deprecated. I need to play video from a remote url. What is the alternative to use in this situation?

val mediaSource = ExtractorMediaSource
  .Factory(DefaultDataSourceFactory(context, userAgent))
  .setExtractorsFactory(DefaultExtractorsFactory())
  .createMediaSource(Uri.parse(url))
like image 620
Akhil Soman Avatar asked Jun 19 '19 07:06

Akhil Soman


1 Answers

ExtractorMediaSource is deprecated.ProgressiveMediaSource is updated source factory

ProgressiveMediaSource.Factory(DefaultHttpDataSource.Factory())
                .createMediaSource(MediaItem.fromUri(Uri.parse("url or path")))
like image 193
Tarun A Avatar answered Sep 22 '22 04:09

Tarun A