问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/56118614/why-cant-i-locate-progressivemediasource