无法从 com.google.android.exoplayer2.upstream.ResolvingDataSource 中找到符号“ResolvingDataSource”

Cannot find symbol `ResolvingDataSource` from com.google.android.exoplayer2.upstream.ResolvingDataSource

标题说明了一切。 ExoPlayer 应该有这个。看看这个页面:https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/upstream/ResolvingDataSource.html

但是当我在 class 的顶部导入 import com.google.android.exoplayer2.upstream.ResolvingDataSource 时,它会亮起并带有红色下划线。当我尝试这样做时:

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 点亮并带有红色下划线。我的应用程序中也有这个 build.gradel: implementation 'com.google.android.exoplayer:exoplayer:2.9.1'

有人能帮忙吗?

请将库更新到最新版本2.11.8:

implementation 'com.google.android.exoplayer:exoplayer:2.11.8'

第三方库总是在变化,因此请跟踪其官方网站。