Ich mag vom Server zum Videoview eine Videodatei streamen Aber es verursacht ProblemSpiele Einige MP4-Dateien vom Server Ursache ich Ausnahme
videoView=(VideoView)findViewById(R.id.myvideo);
Uri uri=Uri.parse("http://travel.gockell.com/data/251/videos/2016-06-09_13-21-12.mp4");
videoView.setVideoURI(uri);
videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {
videoView.start();
}
});
Fehler
D/MediaPlayer: setDataSource IOException happend : java.io.FileNotFoundException: No content provider: http://travel.gockell.com/data/251/videos/2016-06-09_13-21-12.mp4 at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1070) at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:925) at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:852) at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1094) at android.widget.VideoView.openVideo(VideoView.java:372) at android.widget.VideoView.access$2100(VideoView.java:73) at android.widget.VideoView$7.surfaceCreated(VideoView.java:649) at android.view.SurfaceView.updateWindow(SurfaceView.java:599) at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:181) at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:847) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1982) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1062) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5873) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767) at android.view.Choreographer.doCallbacks(Choreographer.java:580) at android.view.Choreographer.doFrame(Choreographer.java:550) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5536) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1397) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1192) 06-13 14:57:01.734 16590-16590/videoplayer.dreamdeveloper.com.livevideoplayer D/MediaPlayer: Couldn't open file on client side, trying server side 06-13 14:57:01.764 16590-16590/videoplayer.dreamdeveloper.com.livevideoplayer V/MediaPlayer: setVideoSurfaceTexture 06-13 14:57:01.764 16590-16590/videoplayer.dreamdeveloper.com.livevideoplayer V/MediaPlayer-JNI: setAudioStreamType: 3 06-13 14:57:01.764 16590-16590/videoplayer.dreamdeveloper.com.livevideoplayer V/MediaPlayer: MediaPlayer::setAudioStreamType 06-13 14:57:01.764 16590-16590/videoplayer.dreamdeveloper.com.livevideoplayer V/MediaPlayer: setVideoSurfaceTexture 06-13 14:57:01.764 16590-16590/videoplayer.dreamdeveloper.com.livevideoplayer V/MediaPlayer: prepareAsync 06-13 14:57:01.794 16590-16610/videoplayer.dreamdeveloper.com.livevideoplayer D/MediaHTTPConnection: filterOutInternalHeaders: key=User-Agent, val= stagefright/1.2 (Linux;Android 5.0.2) 06-13 14:57:01.874 16590-16590/videoplayer.dreamdeveloper.com.livevideoplayer I/Timeline: Timeline: Activity_idle id: [email protected] time:57014665 06-13 14:57:01.944 16590-16605/videoplayer.dreamdeveloper.com.livevideoplayer I/System.out: (HTTPLog)-Static: SBServiceAPI: getService class android.os.ServiceManager 06-13 14:57:01.944 16590-16605/videoplayer.dreamdeveloper.com.livevideoplayer I/System.out: (HTTPLog)-Static: isSBSettingEnabled false 06-13 14:57:01.944 16590-16605/videoplayer.dreamdeveloper.com.livevideoplayer I/System.out: (HTTPLog)-Static: isShipBuild true 06-13 14:57:01.944 16590-16605/videoplayer.dreamdeveloper.com.livevideoplayer I/System.out: (HTTPLog)-Thread-40119-261283142: SmartBonding Enabling is false, SHIP_BUILD is true, log to file is false, DBG is false 06-13 14:57:01.944 16590-16605/videoplayer.dreamdeveloper.com.livevideoplayer I/System.out: (HTTPLog)-Static: isSBSettingEnabled false 06-13 14:57:03.314 16590-16605/videoplayer.dreamdeveloper.com.livevideoplayer V/MediaHTTPConnection: mTotalSize is -1 06-13 14:57:03.324 16590-16610/videoplayer.dreamdeveloper.com.livevideoplayer D/MediaHTTPConnection: setReadTimeOut = 30000ms 06-13 14:57:05.814 16590-18648/videoplayer.dreamdeveloper.com.livevideoplayer D/MediaHTTPConnection: setReadTimeout with 30000ms 06-13 14:57:05.814 16590-18648/videoplayer.dreamdeveloper.com.livevideoplayer I/System.out: (HTTPLog)-Static: isSBSettingEnabled false 06-13 14:57:06.494 16590-18648/videoplayer.dreamdeveloper.com.livevideoplayer V/MediaHTTPConnection: mTotalSize is -1 06-13 14:57:06.494 16590-18648/videoplayer.dreamdeveloper.com.livevideoplayer V/MediaHTTPConnection: Server doesnt support Partial Request 06-13 14:57:06.494 16590-18648/videoplayer.dreamdeveloper.com.livevideoplayer V/MediaHTTPConnection: Return -EPIPE 06-13 14:57:06.494 16590-16610/videoplayer.dreamdeveloper.com.livevideoplayer V/MediaPlayer: message received msg=100, ext1=1, ext2=-2147483648 06-13 14:57:06.494 16590-16610/videoplayer.dreamdeveloper.com.livevideoplayer E/MediaPlayer: error (1, -2147483648) 06-13 14:57:06.494 16590-16610/videoplayer.dreamdeveloper.com.livevideoplayer V/MediaPlayer: callback application 06-13 14:57:06.494 16590-16610/videoplayer.dreamdeveloper.com.livevideoplayer V/MediaPlayer: back from callback 06-13 14:57:06.504 16590-16590/videoplayer.dreamdeveloper.com.livevideoplayer E/MediaPlayer: Error (1,-2147483648) 06-13 14:57:06.504 16590-16590/videoplayer.dreamdeveloper.com.livevideoplayer D/VideoView: Error: 1,-2147483648
Ich denke, Sie müssen einmal auf diese [Bibliothek] (https://github.com/yixia/VitamioBundle) schauen. Überprüfen Sie auch Ihre [media] (https://developer.android.com/guide/appendix/media-formats.html) Support-Datei. – Lawrance
Ich möchte im Standard-Player spielen ist es möglich? @Lawrance –