ionic+angularJs 内嵌video 标签全屏播放视频 点击安卓物理返回键的时候 页面完全变样了,
竖屏展示了横屏的内容解决办法如下:
修改原生 CordovaWebViewImpl文件
public void hideCustomView() {
// TODO fixed by andrew.wen for 播放视屏横屏之后在点击物理返回键会导致展示出错 故先翻转屏幕
if( cordova.getActivity().getRequestedOrientation()== ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE){
cordova.getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
}
// This code is adapted from the original Android Browser code, licensed under the Apache License, Version 2.0
if (mCustomView == null) return;
LOG.d(TAG, "Hiding Custom View");
// Hide the custom view.
mCustomView.setVisibility(View.GONE);
// Remove the custom view from its container.
ViewGroup parent = (ViewGroup) engine.getView().getParent();
parent.removeView(mCustomView);
mCustomView = null;
mCustomViewCallback.onCustomViewHidden();
// Show the content view.
engine.getView().setVisibility(View.VISIBLE);
}