|
|
|
@ -732,6 +732,14 @@ public class VideoView<P extends AbstractPlayer> extends FrameLayout |
|
|
|
//将播放器视图添加到DecorView中即实现了全屏
|
|
|
|
//将播放器视图添加到DecorView中即实现了全屏
|
|
|
|
decorView.addView(mPlayerContainer); |
|
|
|
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); |
|
|
|
setPlayerState(PLAYER_FULL_SCREEN); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -779,6 +787,14 @@ public class VideoView<P extends AbstractPlayer> extends FrameLayout |
|
|
|
decorView.removeView(mPlayerContainer); |
|
|
|
decorView.removeView(mPlayerContainer); |
|
|
|
this.addView(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); |
|
|
|
setPlayerState(PLAYER_NORMAL); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|