diff --git a/gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/utils/GSYVideoHelper.java b/gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/utils/GSYVideoHelper.java index 1edd411bf..9e787e85e 100644 --- a/gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/utils/GSYVideoHelper.java +++ b/gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/utils/GSYVideoHelper.java @@ -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); @@ -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); diff --git a/gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/video/StandardGSYVideoPlayer.java b/gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/video/StandardGSYVideoPlayer.java index e48fe1cb7..6c0819db4 100644 --- a/gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/video/StandardGSYVideoPlayer.java +++ b/gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/video/StandardGSYVideoPlayer.java @@ -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(); + } }