答案 0 :(得分:0)
我使用了cprcrack/VideoEnabledWebView和RotatedVerticalFrameLayout。我刚刚在VideoEnabledWebChromeClient中更改了onShowCustomView(View视图,CustomViewCallback回调)的一部分。
// Hide the non-video view, add the video view, and show it
activityNonVideoView.setVisibility(View.INVISIBLE);
Point screenSize=Utils.getDisplaySize(activityNonVideoView.getContext());
FrameLayout.LayoutParams params=new FrameLayout.LayoutParams(screenSize.y,screenSize.x);
params.gravity=Gravity.BOTTOM;
videoViewContainer.setLayoutParams(params);
activityVideoView.addView(videoViewContainer);
activityVideoView.setVisibility(View.VISIBLE);
在活动中,我在OnToggledFullscreenCallback
中更改了一行 getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE)
到
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE
|View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|View.SYSTEM_UI_FLAG_FULLSCREEN
|View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
这样它就隐藏了导航栏。
获取我使用的显示尺寸
public static Point getDisplaySize(Context context){
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
Display display = wm.getDefaultDisplay();
Point size=new Point();
display.getRealSize(size);
return size;
}