下面的代码无法正常工作,并显示错误。
ExoPlayer player = ExoPlayerFactory.newSimpleInstance(
new DefaultRenderersFactory(this),
new DefaultTrackSelector(), new DefaultLoadControl());
Uri uri = Uri.parse(live uri path);
MediaSource mediaSource = buildMediaSource(uri);
player.prepare(mediaSource, true, false);
player.setPlayWhenReady(true);
private MediaSource buildMediaSource(Uri uri) {
DataSource.Factory manifestDataSourceFactory =
new DefaultHttpDataSourceFactory("ua");
DashChunkSource.Factory dashChunkSourceFactory =
new DefaultDashChunkSource.Factory(
new DefaultHttpDataSourceFactory("ua", BANDWIDTH_METER));
return new DashMediaSource.Factory(dashChunkSourceFactory,
manifestDataSourceFactory).createMediaSource(uri);
}
上面的代码显示::: p的错误
ExoPlayerImplInternal: Source error.
com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 301