提交 e7fc854d 编写于 作者: S shuyu

orientation 增加 pause 支持

上级 39110e9b
......@@ -84,6 +84,9 @@ public abstract class GSYBaseActivityDetail<T extends GSYBaseVideoPlayer> extend
protected void onPause() {
super.onPause();
getGSYVideoPlayer().getCurrentPlayer().onVideoPause();
if (orientationUtils != null) {
orientationUtils.setIsPause(true);
}
isPause = true;
}
......@@ -91,6 +94,9 @@ public abstract class GSYBaseActivityDetail<T extends GSYBaseVideoPlayer> extend
protected void onResume() {
super.onResume();
getGSYVideoPlayer().getCurrentPlayer().onVideoResume();
if (orientationUtils != null) {
orientationUtils.setIsPause(false);
}
isPause = false;
}
......
......@@ -28,6 +28,8 @@ public class OrientationUtils {
//是否跟随系统
private boolean mRotateWithSystem = true;
private boolean mIsPause = false;
/**
* @param activity
* @param gsyVideoPlayer
......@@ -49,6 +51,9 @@ public class OrientationUtils {
if (gsyVideoPlayer != null && gsyVideoPlayer.isVerticalFullByVideoSize()) {
return;
}
if (mIsPause) {
return;
}
// 设置竖屏
if (((rotation >= 0) && (rotation <= 30)) || (rotation >= 330)) {
if (mClick) {
......@@ -244,4 +249,12 @@ public class OrientationUtils {
public void setRotateWithSystem(boolean rotateWithSystem) {
this.mRotateWithSystem = rotateWithSystem;
}
public boolean isPause() {
return mIsPause;
}
public void setIsPause(boolean isPause) {
this.mIsPause = isPause;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册