Skip to content

Commit

Permalink
Merge pull request CarGuo#1694 from fenghebaiyang/patch-1
Browse files Browse the repository at this point in the history
修复GSYVideoHelper切换全屏导致定时任务停止的问题
  • Loading branch information
CarGuo authored Dec 20, 2018
2 parents 72b00ea + fd0459e commit cca0b5b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ public void run() {
mGsyVideoPlayer.getFullscreenButton().setImageResource(mGsyVideoPlayer.getEnlargeImageRes());
mGsyVideoPlayer.getBackButton().setVisibility(View.GONE);
mGsyVideoPlayer.setIfCurrentIsFullscreen(false);
mGsyVideoPlayer.restartTimerTask();
if (mVideoOptionBuilder.getVideoAllCallBack() != null) {
Debuger.printfLog("onQuitFullscreen");
mVideoOptionBuilder.getVideoAllCallBack().onQuitFullscreen(mVideoOptionBuilder.getUrl(), mVideoOptionBuilder.getVideoTitle(), mGsyVideoPlayer);
Expand Down Expand Up @@ -318,6 +319,7 @@ public void run() {
}
}
mGsyVideoPlayer.setIfCurrentIsFullscreen(true);
mGsyVideoPlayer.restartTimerTask();
if (mVideoOptionBuilder.getVideoAllCallBack() != null) {
Debuger.printfLog("onEnterFullscreen");
mVideoOptionBuilder.getVideoAllCallBack().onEnterFullscreen(mVideoOptionBuilder.getUrl(), mVideoOptionBuilder.getVideoTitle(), mGsyVideoPlayer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -864,5 +864,13 @@ public void saveFrame(final File file, final boolean high, final GSYVideoShotSav
}
}


/**
* 重新开启进度查询以及控制view消失的定时任务
* 用于解决GSYVideoHelper中通过removeview方式做全屏切换导致的定时任务停止的问题
* GSYVideoControlView onDetachedFromWindow()
*/
public void restartTimerTask() {
startProgressTimer();
startDismissControlViewTimer();
}
}

0 comments on commit cca0b5b

Please sign in to comment.