Why can't I locate ProgressiveMediaSource?

柔情痞子 提交于 2019-12-22 05:33:45

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!