英文:
Cannot find symbol `ResolvingDataSource` from com.google.android.exoplayer2.upstream.ResolvingDataSource
问题
Title says it all. ExoPlayer should have this. Just look at this page: link
But when I import:
import com.google.android.exoplayer2.upstream.ResolvingDataSource
at the top of my class, it lights up with a red underline. And when I try to do:
HlsMediaSource hlsMediaSource = new HlsMediaSource.Factory(
new ResolvingDataSource.Factory(
new DefaultHttpDataSourceFactory(Util.getUserAgent(this, getString(R.string.app_name))),
// Provide just-in-time URI resolution logic.
(DataSpec dataSpec) -> dataSpec.withUri(resolveUri(dataSpec.uri))
)
).createMediaSource(Uri.parse(link));
ReolvingDataSource
also lights up with a red underline. I also have this in my app build.gradle:
implementation 'com.google.android.exoplayer:exoplayer:2.9.1'
Can anyone help?
英文:
Title says it all. ExoPlayer should have this. Just look at this page: https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/upstream/ResolvingDataSource.html
But when I import import com.google.android.exoplayer2.upstream.ResolvingDataSource
at the top of my class it lights up with red underline. And when I try to do:
HlsMediaSource hlsMediaSource = new HlsMediaSource.Factory(
new ResolvingDataSource.Factory(
new DefaultHttpDataSourceFactory(Util.getUserAgent(this,getString(R.string.app_name))),
// Provide just-in-time URI resolution logic.
(DataSpec dataSpec) -> dataSpec.withUri(resolveUri(dataSpec.uri))
)
).createMediaSource(Uri.parse(link));
ReolvingDataSource
lights up with red underline. I also have this in my app build.gradel:
implementation 'com.google.android.exoplayer:exoplayer:2.9.1'
Can anyone help?
答案1
得分: 1
请将库更新到最新版本2.11.8:
implementation 'com.google.android.exoplayer:exoplayer:2.11.8';
第三方库经常发生变化,因此请随时关注其官方网站。
英文:
Please update the library to latest version 2.11.8:
implementation 'com.google.android.exoplayer:exoplayer:2.11.8'
Third party libraries always change, so keep track its official sites.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论