使用EasyVideoPlayer播放视频时发生未知错误

时间:2018-06-23 11:02:52

标签: java android video

我正在尝试通过Android Studio中的给定URL播放视频。视频的格式为MP4。有时会播放。但是有时它会给我这个错误:

D/EasyVideoPlayer: Loading web URI: http://example.com/video.mp4
V/MediaHTTPService: MediaHTTPService(android.media.MediaHTTPService@5f993a4): Cookies: null
V/MediaHTTPService: makeHTTPConnection: CookieHandler (java.net.CookieManager@dcee5c2) exists.
V/MediaHTTPService: makeHTTPConnection(android.media.MediaHTTPService@5f993a4): cookieHandler: java.net.CookieManager@dcee5c2 Cookies: null
D/EGL_emulation: eglMakeCurrent: 0x993d8be0: ver 2 0 (tinfo 0xb0fcce50)
W/MediaHTTPConnection: readAt 5772076 / 32768 => java.net.ProtocolException
E/MediaPlayerNative: error (1, -2147483648)
E/MediaPlayer: Error (1,-2147483648)
W/System.err: java.lang.Exception: Preparation/playback error (1): Unknown error
W/System.err:     at com.afollestad.easyvideoplayer.EasyVideoPlayer.onError(EasyVideoPlayer.java:698)
W/System.err:     at android.media.MediaPlayer$EventHandler.handleMessage(MediaPlayer.java:3299)
W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:106)
W/System.err:     at android.os.Looper.loop(Looper.java:164)
W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:6494)
W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
W/System.err:     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
D/EasyVideoPlayer: onCompletion()

在这一点上,我一直在坚持到底出了什么问题以及如何解决这个问题。我尝试在onError的{​​{1}}覆盖上放置重试逻辑,但是我不知道该怎么办。你能帮忙吗?

更新:EasyVideoPlayer is an android library that facilitates playing video

0 个答案:

没有答案