From 9e88c1cbb44cb0b9c11e713fc212cdb3f4c51c9b Mon Sep 17 00:00:00 2001 From: guoshuyu Date: Mon, 5 Feb 2018 16:59:06 +0800 Subject: [PATCH] fix exo2 buffering state --- .../main/java/com/example/gsyvideoplayer/DetailPlayer.java | 3 ++- .../com/shuyu/gsyvideoplayer/video/base/GSYVideoView.java | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/example/gsyvideoplayer/DetailPlayer.java b/app/src/main/java/com/example/gsyvideoplayer/DetailPlayer.java index 9cab60b..277d541 100644 --- a/app/src/main/java/com/example/gsyvideoplayer/DetailPlayer.java +++ b/app/src/main/java/com/example/gsyvideoplayer/DetailPlayer.java @@ -53,7 +53,8 @@ public class DetailPlayer extends AppCompatActivity { //String url = "http://7xjmzj.com1.z0.glb.clouddn.com/20171026175005_JObCxCE2.mp4"; - String url = "http://video.7k.cn/app_video/20171202/6c8cf3ea/v.m3u8.mp4"; + //String url = "http://video.7k.cn/app_video/20171202/6c8cf3ea/v.m3u8.mp4"; + String url = "http://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/bipbop_4x3_variant.m3u8"; //String url = "rtsp://cloud.easydarwin.org:554/stream0.sdp"; //String url = "http://s.swao.cn/o_1c4gm8o1nniu1had13bk1t0l1rq64m.mov"; //String url = "http://api.ciguang.tv/avideo/play?num=02-041-0491&type=flv&v=1&client=android"; diff --git a/gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/video/base/GSYVideoView.java b/gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/video/base/GSYVideoView.java index 1c144c0..e7575e0 100644 --- a/gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/video/base/GSYVideoView.java +++ b/gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/video/base/GSYVideoView.java @@ -324,7 +324,7 @@ public abstract class GSYVideoView extends GSYTextureRenderView implements GSYMe if (getGSYVideoManager().listener() != null) { getGSYVideoManager().listener().onCompletion(); } - if(mVideoAllCallBack != null) { + if (mVideoAllCallBack != null) { Debuger.printfLog("onStartPrepared"); mVideoAllCallBack.onStartPrepared(mOriginUrl, mTitle, this); } @@ -649,7 +649,9 @@ public abstract class GSYVideoView extends GSYTextureRenderView implements GSYMe } else if (what == MediaPlayer.MEDIA_INFO_BUFFERING_END) { if (mBackUpPlayingBufferState != -1) { - + if (mBackUpPlayingBufferState == CURRENT_STATE_PLAYING_BUFFERING_START) { + mBackUpPlayingBufferState = CURRENT_STATE_PLAYING; + } if (mHadPlay && mCurrentState != CURRENT_STATE_PREPAREING && mCurrentState > 0) setStateAndUi(mBackUpPlayingBufferState); -- GitLab