From c93f9e0b1b2b093c1ae5dedf91aa7a4a3d2a0939 Mon Sep 17 00:00:00 2001 From: guoshuyu Date: Fri, 21 Dec 2018 13:53:44 +0800 Subject: [PATCH] fix startAfterPrepared --- .../shuyu/gsyvideoplayer/video/base/GSYVideoControlView.java | 5 +++++ .../com/shuyu/gsyvideoplayer/video/base/GSYVideoView.java | 1 + 2 files changed, 6 insertions(+) diff --git a/gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/video/base/GSYVideoControlView.java b/gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/video/base/GSYVideoControlView.java index f360593ed..7534272e3 100644 --- a/gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/video/base/GSYVideoControlView.java +++ b/gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/video/base/GSYVideoControlView.java @@ -852,6 +852,11 @@ protected void clickStartIcon() { mVideoAllCallBack.onClickResume(mOriginUrl, mTitle, this); } } + + if (!mHadPlay && !mStartAfterPrepared) { + startAfterPrepared(); + } + try { getGSYVideoManager().start(); } catch (Exception e) { 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 dfc69bfcf..70b3eb5c7 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 @@ -582,6 +582,7 @@ public void onPrepared() { if (!mStartAfterPrepared) { setStateAndUi(CURRENT_STATE_PAUSE); + onVideoPause();//todo 加上这个 return; }