E / MediaPlayer:setDataSource:IOException! uri ="视频路径"错误

时间:2018-02-03 12:39:49

标签: java android android-recyclerview recycler-adapter android-videoview

我正在列表中实施视频观看,所有视频链接都有.m3u8视频路径(网络缓冲视频)。

在logcat中打印错误日志下面的列表时: -

  

E / MediaPlayer:setDataSource:IOException!   uri = https://example.com/a/b/c/Video.m3u8 java.io.FileNotFoundException:不   内容提供商:https://example.com/a/b/c/Video.m3u8                                         在android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1123)                                         在android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:958)                                         在android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:881)                                         在android.media.MediaPlayer.setDataSource(MediaPlayer.java:1018)                                         在android.widget.VideoView.openVideo(VideoView.java:437)                                         在android.widget.VideoView $ 7.surfaceCreated(VideoView.java:742)                                         在android.view.SurfaceView.updateWindow(SurfaceView.java:676)                                         在android.view.SurfaceView $ 3.onPreDraw(SurfaceView.java:203)                                         在android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:944)                                         在android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2417)                                         在android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1321)                                         在android.view.ViewRootImpl $ TraversalRunnable.run(ViewRootImpl.java:6708)                                         在android.view.Choreographer $ CallbackRecord.run(Choreographer.java:894)                                         在android.view.Choreographer.doCallbacks(Choreographer.java:696)                                         在android.view.Choreographer.doFrame(Choreographer.java:631)                                         在android.view.Choreographer $ FrameDisplayEventReceiver.run(Choreographer.java:880)                                         在android.os.Handler.handleCallback(Handler.java:822)                                         在android.os.Handler.dispatchMessage(Handler.java:104)                                         在android.os.Looper.loop(Looper.java:207)                                         在android.app.ActivityThread.main(ActivityThread.java:5811)                                         at java.lang.reflect.Method.invoke(Native Method)                                         在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:791)                                         在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:681)

此错误始终打印但应用程序仍在运行而不会崩溃。 有时列表滚动会被挂起并且ANR即将到来。

我有一个片段,我从服务器获取视频路径。 我有适配器,在onBindViewolder()我将videoUrl分配给videoView via videoView.setVideoURI(new Uri(videoUrl))。

我需要一个答案,为什么我的列表不顺畅以及为什么我遇到上述错误? 提前谢谢。

0 个答案:

没有答案