06-26 12:32:30.141 16571-16980/com.example.dell.exoplayer_test E/ExoPlayerImplInternal: Source error.
com.google.android.exoplayer2.ParserException: org.xmlpull.v1.XmlPullParserException: unterminated entity ref (position:TEXT @1:218 in java.io.InputStreamReader@c8b4a4f)
at com.google.android.exoplayer2.source.dash.manifest.DashManifestParser.parse(DashManifestParser.java:105)
at com.google.android.exoplayer2.source.dash.manifest.DashManifestParser.parse(DashManifestParser.java:58)
at com.google.android.exoplayer2.upstream.ParsingLoadable.load(ParsingLoadable.java:130)
at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:308)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: org.xmlpull.v1.XmlPullParserException: unterminated entity ref (position:TEXT @1:218 in java.io.InputStreamReader@c8b4a4f)
at org.kxml2.io.KXmlParser.readEntity(KXmlParser.java:1219)
at org.kxml2.io.KXmlParser.readValue(KXmlParser.java:1401)
at org.kxml2.io.KXmlParser.next(KXmlParser.java:393)
at org.kxml2.io.KXmlParser.next(KXmlParser.java:313)
at com.google.android.exoplayer2.source.dash.manifest.DashManifestParser.parse(DashManifestParser.java:98)
at com.google.android.exoplayer2.source.dash.manifest.DashManifestParser.parse(DashManifestParser.java:58)
at com.google.android.exoplayer2.upstream.ParsingLoadable.load(ParsingLoadable.java:130)
at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:308)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
这是我的代码行。
这个方法是视频的起步
private void initializePlayer() {
if (player == null) {
player = ExoPlayerFactory.newSimpleInstance(new DefaultRenderersFactory(this),
new DefaultTrackSelector(), new DefaultLoadControl());
playerView.setPlayer(player);
player.setPlayWhenReady(playWhenReady);
player.seekTo(currentWindow, playbackPosition);
}
prepareExoPlayer();
}
在这里使用DASH,我想问题可能在这里
private MediaSource buildMediaSource(Uri uri) {
DataSource.Factory dataSourceFactory =
new DefaultHttpDataSourceFactory("ua",BANDWIDTH_METER);
DashChunkSource.Factory dashChunkSourceFactory =
new DefaultDashChunkSource.Factory(dataSourceFactory);
return new DashMediaSource
(uri, dataSourceFactory, dashChunkSourceFactory, null, null);
}
也准备其他方法,但说同样的错误
private MediaSource buildMediaSource(Uri uri) {
DataSource.Factory dataSourceFactory =
new DefaultHttpDataSourceFactory("ua",BANDWIDTH_METER);
DashChunkSource.Factory dashChunkSourceFactory =
new DefaultDashChunkSource.Factory(dataSourceFactory);
return new DashMediaSource
(uri, dataSourceFactory, dashChunkSourceFactory, null, null);
}
如何解决此问题?我研究了其他类似的问题,但与此无关。