如何将RTSP视频网址播放到EXOPlayer

时间:2019-11-29 09:59:06

标签: android android-mediaplayer rtsp exoplayer

我正在开发一个应用程序,并且在其中使用了Google的ExoPlayer,它的工作原理很吸引人,现在我想在我的应用程序中添加RTSP支持,但是使用Exoplayer我无法播放,请任何人都可以提供帮助为此,如果有其他选择,请与我分享。

 1. git remote add repoD https://github.com/****/repod.git
 2. git checkout master (go to master branch of A)
 3. git co -b master_of_a
 4. git push -u repoD master_of_a

repeat the below steps for other branches in the repo A. Below example give for branch1 in the repo A

 1. git checkout branch1 (go to branch1 of A)
 3. git co -b branch1_of_a
 4. git push -u repoD branch1_of_a

lOG

E / ExoPlayerImplInternal:源错误。     net.butterflytv.rtmp_client.RtmpClient $ RtmpIOException         在net.butterflytv.rtmp_client.RtmpClient.open(RtmpClient.java:56)         在com.google.android.exoplayer2.ext.rtmp.RtmpDataSource.open(RtmpDataSource.java:60)         在com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:83)         在com.google.android.exoplayer2.source.ExtractorMediaPeriod $ ExtractingLoadable.load(ExtractorMediaPeriod.java:885)         在com.google.android.exoplayer2.upstream.Loader $ LoadTask.run(Loader.java:381)         在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)         在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:607)         在java.lang.Thread.run(Thread.java:761)

1 个答案:

答案 0 :(得分:0)

the regular ExoPlayer release似乎没有对RTSP的支持,他们仍然有open ticket to add RTSP support,但是还有git branch with RTSP support

您正在使用RtmpDataSourceFactory,可以尝试改用RtspMediaSource.Factory。

您还可以阅读difference between RTMP and RTSP