【发布时间】:2017-03-13 15:13:07
【问题描述】:
【问题讨论】:
-
我尝试过这种方式,但没有奏效。 @petey
标签: android html video webview
【问题讨论】:
标签: android html video webview
我使用了cprcrack/VideoEnabledWebView 和RotatedVerticalFrameLayout。我刚刚在 VideoEnabledWebChromeClient 中更改了部分 onShowCustomView(View view, CustomViewCallback callback)。
// 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;
}
【讨论】: