java - 为什么我找不到 ProgressiveMediaSource?

标签 java android exoplayer2.x

查看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'

为什么我找不到这个类?我做错了什么?

最佳答案

JCenter List

我发现通过单击此选项卡,会列出较新版本的 ExoPlayer。

ProgressiveMediaSource 是在 2.10.0 版本中添加的

但是 2.10.0 版本也从 Android 支持库切换到 AndroidX,因此如果您想使用它,您必须将整个项目升级到 AndroidX。

关于java - 为什么我找不到 ProgressiveMediaSource?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56118614/

相关文章:

java - 使用 Phonegap 在 Eclipse for Android 中进行开发。 'Untagging Socket' 错误=-13

java - 执行简单 jar 文件时出现类未找到错误

android - @InjectView 字段何时注入(inject)?

android - 如何从任何已安装应用程序的包名称中获取版本代码?

android - 如何为 ExoPlayer v2.5+ 使用 MediaSession 扩展

java - 在 LinkedHashMap 中移动项目

javascript - Spring请求映射错误: the server responded with a status of 404 (Not Found)

android - html input type = number 不允许在某些机器人上使用小数点

android-fragments - Exo Player 在对容器片段进行动画处理时变黑,如何解决?

java - Exoplayer 线程错误 NoSuchElementExceptionat java.util.ArrayDeque.removeFirst