查看the ExoPlayer documentation ,“Hello World”示例建议您应该使用 ProgressiveMediaSource
来播放标准视频(与我看到的许多建议您使用 ExtractorMediaSource
的在线教程相比)
查看 source code for ExoPlayer ,它声称 ExtractorMediaSource
已被弃用,ProgressiveMediaSource
已取代它:
/** @deprecated Use {@link ProgressiveMediaSource} instead. */
在我自己的项目中,我使用的是 ExoPlayer v2.9.5 -- which is the latest version on jcenter, released February 2019
然而,当我尝试实例化 ProgressiveMediaSource
时,出现错误:
Cannot resolve symbol 'ProgressiveMediaSource'
为什么我找不到这个类?我做错了什么?
最佳答案
我发现通过单击此选项卡,会列出较新版本的 ExoPlayer。
ProgressiveMediaSource
是在 2.10.0 版本中添加的
但是 2.10.0 版本也从 Android 支持库切换到 AndroidX,因此如果您想使用它,您必须将整个项目升级到 AndroidX。
关于java - 为什么我找不到 ProgressiveMediaSource?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56118614/