带有RTSP源的Android Google VrVideoView

时间:2016-10-07 13:26:57

标签: java android google-vr

我想使用VrVideoView在我的Android应用中显示VR视频。视频通过RTSP协议进行流式传输。当我尝试将此类源添加到VrVideoView时,我已经

java.net.MalformedURLException: unknown protocol: rtsp

我发现这个项目RTSP-Java-UrlConnection解决了这个异常,但又展示了另一个:

ExoPlayerImplInternal: Internal track renderer error.
    com.google.android.exoplayer.ExoPlaybackException: com.google.android.exoplayer.upstream.Loader$UnexpectedLoaderException: Unexpected ClassCastException: com.net.rtsp.RtspURLConnection cannot be cast to java.net.HttpURLConnection
        at com.google.android.exoplayer.SampleSourceTrackRenderer.maybeThrowError(SampleSourceTrackRenderer.java:262)
        at com.google.android.exoplayer.SampleSourceTrackRenderer.maybeThrowError(SampleSourceTrackRenderer.java:148)
        at com.google.android.exoplayer.ExoPlayerImplInternal.incrementalPrepareInternal(ExoPlayerImplInternal.java:273)
        at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:203)
        at android.os.Handler.dispatchMessage(Handler.java:98)
        at android.os.Looper.loop(Looper.java:148)
        at android.os.HandlerThread.run(HandlerThread.java:61)
        at com.google.android.exoplayer.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)
     Caused by: com.google.android.exoplayer.upstream.Loader$UnexpectedLoaderException: Unexpected ClassCastException: com.net.rtsp.RtspURLConnection cannot be cast to java.net.HttpURLConnection
        at com.google.android.exoplayer.upstream.Loader$LoadTask.run(Loader.java:235)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)
        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: java.lang.ClassCastException: com.net.rtsp.RtspURLConnection cannot be cast to java.net.HttpURLConnection
        at com.google.android.exoplayer.upstream.DefaultHttpDataSource.makeConnection(DefaultHttpDataSource.java:384)
        at com.google.android.exoplayer.upstream.DefaultHttpDataSource.makeConnection(DefaultHttpDataSource.java:339)
        at com.google.android.exoplayer.upstream.DefaultHttpDataSource.open(DefaultHttpDataSource.java:189)
        at com.google.android.exoplayer.upstream.DefaultUriDataSource.open(DefaultUriDataSource.java:133)
        at com.google.android.exoplayer.extractor.ExtractorSampleSource$ExtractingLoadable.load(ExtractorSampleSource.java:823)
        at com.google.android.exoplayer.upstream.Loader$LoadTask.run(Loader.java:222)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423) 
        at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
        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) 

Google VrVideoView似乎只接受带有HTTP网址的视频。如何将VrVideoView与RTPS源一起使用?

1 个答案:

答案 0 :(得分:1)

以下是答案:

  

我们没有计划在VR View中支持实时视频。您可以   使用较低级别的GVR View类滚动您自己的360查看器,   虽然。资料来源:https://github.com/googlevr/gvr-android-sdk/issues/217#issuecomment-244588848