Add files via upload

pull/56/head
llb0 3 years ago committed by GitHub
parent b20462e700
commit 4d5740eb67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      player/src/main/java/xyz/doikki/videoplayer/player/VideoView.java
  2. 2
      player/src/main/java/xyz/doikki/videoplayer/player/VideoViewConfig.java

@ -732,6 +732,14 @@ public class VideoView<P extends AbstractPlayer> extends FrameLayout
//将播放器视图添加到DecorView中即实现了全屏
decorView.addView(mPlayerContainer);
Activity activity = getActivity();
int[] size = getVideoSize();
int width = size[0];
int height = size[1];
if (width < height) {
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
setPlayerState(PLAYER_FULL_SCREEN);
}
@ -779,6 +787,14 @@ public class VideoView<P extends AbstractPlayer> extends FrameLayout
decorView.removeView(mPlayerContainer);
this.addView(mPlayerContainer);
Activity activity = getActivity();
int[] size = getVideoSize();
int width = size[0];
int height = size[1];
if (width < height) {
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
setPlayerState(PLAYER_NORMAL);
}

@ -60,7 +60,7 @@ public class VideoViewConfig {
private boolean mIsEnableLog;
private boolean mPlayOnMobileNetwork = true;
private boolean mEnableOrientation;
private boolean mEnableOrientation = true;
private boolean mEnableAudioFocus = true;
private ProgressManager mProgressManager;
private PlayerFactory mPlayerFactory;

Loading…
Cancel
Save