提交 442c12fd 编写于 作者: S shuyu

1.4.8 锁定屏幕按键增加锁定屏幕旋转功能

上级 f38f02d2
......@@ -124,7 +124,7 @@ public abstract class GSYBaseVideoPlayer extends FrameLayout implements GSYMedia
protected Bitmap mFullPauseBitmap = null;//暂停时的全屏图片;
private OrientationUtils mOrientationUtils; //旋转工具类
protected OrientationUtils mOrientationUtils; //旋转工具类
private Handler mHandler = new Handler();
......@@ -188,14 +188,14 @@ public abstract class GSYBaseVideoPlayer extends FrameLayout implements GSYMedia
gsyVideoPlayer.setLayoutParams(lp);
gsyVideoPlayer.setIfCurrentIsFullscreen(true);
mOrientationUtils = new OrientationUtils((Activity) context, gsyVideoPlayer);
mOrientationUtils.setEnable(mRotateViewAuto);
gsyVideoPlayer.mOrientationUtils = mOrientationUtils;
if (isShowFullAnimation()) {
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
if (mLockLand) {
if (mLockLand && mOrientationUtils.getIsLand() != 1) {
mOrientationUtils.resolveByClick();
}
gsyVideoPlayer.setVisibility(VISIBLE);
......@@ -359,8 +359,10 @@ public abstract class GSYBaseVideoPlayer extends FrameLayout implements GSYMedia
mIfCurrentIsFullscreen = false;
int delay = mOrientationUtils.backToProtVideo();
mOrientationUtils.setEnable(false);
if (mOrientationUtils != null)
if (mOrientationUtils != null) {
mOrientationUtils.releaseListener();
mOrientationUtils = null;
}
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
......@@ -640,6 +642,9 @@ public abstract class GSYBaseVideoPlayer extends FrameLayout implements GSYMedia
*/
public void setRotateViewAuto(boolean rotateViewAuto) {
this.mRotateViewAuto = rotateViewAuto;
if (mOrientationUtils != null) {
mOrientationUtils.setEnable(rotateViewAuto);
}
}
public boolean isLockLand() {
......
......@@ -146,9 +146,13 @@ public class StandardGSYVideoPlayer extends GSYVideoPlayer {
if (mLockCurScreen) {
mLockScreen.setImageResource(R.drawable.unlock);
mLockCurScreen = false;
if (mOrientationUtils != null)
mOrientationUtils.setEnable(mRotateViewAuto);
} else {
mLockScreen.setImageResource(R.drawable.lock);
mLockCurScreen = true;
if (mOrientationUtils != null)
mOrientationUtils.setEnable(false);
hideAllWidget();
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册