Android 外置播放器全屏旋转
我想在设备旋转时旋转播放器。 我用这个让我的播放器全屏Android 外置播放器全屏旋转,android,rotation,fullscreen,exoplayer,Android,Rotation,Fullscreen,Exoplayer,我想在设备旋转时旋转播放器。 我用这个让我的播放器全屏 getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN |View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN
|View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
我尝试设置旋转(90),但我的视图在角落里变小了!
当我试着改变我的设备方向来进行全屏显示时,玩家先画一半的画面,然后进入正常的全屏模式[
我自己找到了答案,这是ReactExoPlayerView的全屏集成
private void openFullscreenDialog() {
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE);
((ViewGroup) exoPlayerView.getParent()).removeView(exoPlayerView);
if (playerControlView.getParent() != null) {
((ViewGroup) playerControlView.getParent()).removeView(playerControlView); // <- fix
}
exoPlayerView.addView(playerControlView);
mFullScreenDialog = new Dialog(themedReactContext, android.R.style.Theme_Black_NoTitleBar_Fullscreen);
mFullScreenDialog.addContentView(exoPlayerView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
mFullScreenDialog.setCancelable(false);
mFullScreenDialog.setOnKeyListener((dialog, keyCode, event) -> {
if (event.getAction() == KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK) {
if (isFullscreen) {
fullScreenButtonClick();
}
return true;
} else {
return false;
}
});
mFullScreenDialog.show();
}
private void closeFullscreenDialog() {
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
((ViewGroup) exoPlayerView.getParent()).removeView(exoPlayerView);
if (playerControlView.getParent() != null) {
((ViewGroup) playerControlView.getParent()).removeView(playerControlView); // <- fix
}
addView(exoPlayerView);
setControls(true);
mFullScreenDialog.dismiss();
}
private void openFullscreenDialog(){
activity.setRequestedOrientation(ActivityInfo.SCREEN\u ORIENTATION\u REVERSE\u横向);
((视图组)exoPlayerView.getParent()).removeView(exoPlayerView);
如果(playerControlView.getParent()!=null){
((视图组)playerControlView.getParent()).removeView(playerControlView);//{
if(event.getAction()==KeyEvent.ACTION\u UP&&keyCode==KeyEvent.keyCode\u BACK){
如果(全屏显示){
全屏按钮单击();
}
返回true;
}否则{
返回false;
}
});
mFullScreenDialog.show();
}
私有void closeFullscreenDialog(){
activity.setRequestedOrientation(ActivityInfo.SCREEN\u-ORIENTATION\u-Picture);
((视图组)exoPlayerView.getParent()).removeView(exoPlayerView);
如果(playerControlView.getParent()!=null){
((视图组)playerControlView.getParent()).removeView(playerControlView)//