VideoView setVideoUri没有内容提供商

时间:2017-01-31 06:14:02

标签: java android uri mp4 android-videoview

我正在开发一款需要在本地服务器上播放.mp4视频的Android应用。

我有这段代码:

   D/MediaPlayer: setDataSource IOException | SecurityException happend : 
                                                                         java.io.FileNotFoundException: No content provider: http://192.168.1.100:7676/getVideoByFileName.php?name=C%3A%2FSpinShot%2FResults%2FSpinShot-201701311359177714.mp4
                                                                             at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1141)
                                                                             at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:991)
                                                                             at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:914)
                                                                             at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1121)
                                                                             at android.widget.VideoView.openVideo(VideoView.java:371)
                                                                             at android.widget.VideoView.access$2100(VideoView.java:71)
                                                                             at android.widget.VideoView$7.surfaceCreated(VideoView.java:652)
                                                                             at android.view.SurfaceView.updateWindow(SurfaceView.java:712)
                                                                             at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:209)
                                                                             at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:1014)
                                                                             at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2510)
                                                                             at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1437)
                                                                             at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7403)
                                                                             at android.view.Choreographer$CallbackRecord.run(Choreographer.java:920)
                                                                             at android.view.Choreographer.doCallbacks(Choreographer.java:695)
                                                                             at android.view.Choreographer.doFrame(Choreographer.java:631)
                                                                             at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:906)
                                                                             at android.os.Handler.handleCallback(Handler.java:739)
                                                                             at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                             at android.os.Looper.loop(Looper.java:158)
                                                                             at android.app.ActivityThread.main(ActivityThread.java:7229)
                                                                             at java.lang.reflect.Method.invoke(Native Method)
                                                                             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
                                                                             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

每次执行时,我都会收到此错误:

for (var i = 0; i < file1Words.length; i++) {
        var s1 = file1Words[i];
        for (var j = 0; j < file2Words.length; j++) {
          //console.log(file1Words[i] + " " + file2Words[j]);
          var s2 = file2Words[j];

          console.log(","+s1 + "," + s2 + ",");
          console.log(s1.length)
          console.log(s2.length)
        console.log(s2.charCodeAt(s2.length-1))

          console.log(s1.localeCompare(s2));
          if (s1.localeCompare(s2) == 0) {
            console.log("found something. sending to next func");
          }
        }
      }

    };

VideoView中没有视频播放。任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:0)

原来我的防火墙会影响他们的连接。关闭它,它工作得很好。