Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't I locate ProgressiveMediaSource?

Looking at the ExoPlayer documentation, the "Hello World" example suggests that to play a standard video you should use a ProgressiveMediaSource (compared to many online tutorials I've seen suggesting you use an ExtractorMediaSource)

Looking at the source code for ExoPlayer, it claims that ExtractorMediaSource is deprecated, and ProgressiveMediaSource has replaced it:

/** @deprecated Use {@link ProgressiveMediaSource} instead. */

In my own project I'm using ExoPlayer v2.9.5 -- which is the latest version on jcenter, released February 2019

Yet when I try to instantiate a ProgressiveMediaSource, I get the error:

Cannot resolve symbol 'ProgressiveMediaSource'

Why can I not locate this class? What am I doing wrong?

like image 593
stevendesu Avatar asked May 13 '19 19:05

stevendesu


1 Answers

JCenter List

I found that by clicking on this tab, newer versions of ExoPlayer were listed.

ProgressiveMediaSource was added in version 2.10.0

However version 2.10.0 also made the switch from the Android Support Library to AndroidX, so you will have to upgrade your whole project to AndroidX if you wish to use it.

like image 173
stevendesu Avatar answered Nov 04 '22 22:11

stevendesu