提交 b003b2ac 编写于 作者: S shuyu

修改了全屏可能出现缓冲不消失问题 (2017-08-28)

上级 1d946c21
......@@ -207,6 +207,7 @@ public abstract class GSYBaseVideoPlayer extends GSYVideoControlView {
to.mNetChanged = from.mNetChanged;
to.mNetSate = from.mNetSate;
to.mRotateWithSystem = from.mRotateWithSystem;
to.mBackUpPlayingBufferState = from.mBackUpPlayingBufferState;
to.setUp(from.mOriginUrl, from.mCache, from.mCachePath, from.mMapHeadData, from.mTitle);
to.setStateAndUi(from.mCurrentState);
}
......@@ -290,6 +291,8 @@ public abstract class GSYBaseVideoPlayer extends GSYVideoControlView {
mVideoAllCallBack.onEnterFullscreen(mOriginUrl, mTitle, gsyVideoPlayer);
}
mIfCurrentIsFullscreen = true;
checkoutState();
}
/**
......@@ -397,6 +400,28 @@ public abstract class GSYBaseVideoPlayer extends GSYVideoControlView {
}
}
protected Runnable mCheckoutTask = new Runnable() {
@Override
public void run() {
GSYVideoPlayer gsyVideoPlayer = getFullWindowPlayer();
if (gsyVideoPlayer != null
&& gsyVideoPlayer.mCurrentState != mCurrentState) {
if (gsyVideoPlayer.mCurrentState == CURRENT_STATE_PLAYING_BUFFERING_START
&& mCurrentState != CURRENT_STATE_PREPAREING) {
gsyVideoPlayer.setStateAndUi(mCurrentState);
}
}
}
};
/**
* 检查状态
*/
protected void checkoutState() {
removeCallbacks(mCheckoutTask);
postDelayed(mCheckoutTask, 500);
}
/************************* 开放接口 *************************/
/**
......@@ -541,6 +566,8 @@ public abstract class GSYBaseVideoPlayer extends GSYVideoControlView {
GSYVideoManager.instance().setLastListener(this);
GSYVideoManager.instance().setListener(gsyVideoPlayer);
checkoutState();
return gsyVideoPlayer;
} catch (Exception e) {
e.printStackTrace();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册