WebView 視訊全屏播放(基於Html5 video)
參考:WebView 支援 Html5 video 進行全屏播放
主要方法: onShowCustomView() onHideCustomView()
@Override //全屏時呼叫
public void onShowCustomView(View view, CustomViewCallback callback) {
super.onShowCustomView(view, callback);
Log.d("MyInfo","onShowCustomView...");
if (mCustomView != null) {
callback.onCustomViewHidden();
return;
}
mCustomView=view;
mCustomView.setVisibility(View.VISIBLE);
mContentLayout.setVisibility(View.GONE);
mCustomViewCallBack = callback;
fl_video.addView(mCustomView);
fl_video.setVisibility(View.VISIBLE);
fl_video.bringToFront();
//全屏
//設定橫屏
rootLayout.setBackground(ContextCompat.getDrawable(mContext,R.color.total_black));
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
}
@Override //退出全屏
public void onHideCustomView() {
super.onHideCustomView();
Log.d("MyInfo","onHideCustomView...");
if (mCustomView == null) {
return;
}
mCustomView.setVisibility(View.GONE);
mContentLayout.setVisibility(View.VISIBLE);
fl_video.removeView(mCustomView);
mCustomView = null;
fl_video.setVisibility(View.GONE);
mCustomViewCallBack.onCustomViewHidden();
rootLayout.setBackground(ContextCompat.getDrawable(mContext,R.color.white));
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
相關文章
- iOS開發 webview禁止視訊全屏播放iOSWebView
- Flutter:基於video_player實現視訊相關手勢控制、全屏播放FlutterIDE
- ReactNative——react-native-video實現視訊全屏播放ReactIDE
- HTML5 video視訊字幕的使用和製作HTMLIDE
- 短視訊app開發,點選視訊進行全屏播放APP
- vue-core-video-player-基於vue.js的視訊播放器元件IDEVue.js播放器元件
- Flutter 實現視訊全屏播放邏輯及解析Flutter
- html5–移動端視訊video的android相容,去除播放控制元件、全屏等HTMLIDEAndroid控制元件
- 基於HDPHP的視訊播客開發視訊PHP
- AceThinker Video Keeper 視訊下載工具IDE
- Movavi Video Suite 2022視訊編輯IDEUI
- TunePat Netflix Video Downloader——Netflix視訊工具IDE
- video自定義實現視訊播放功能IDE
- Cisdem Video Converter Mac視訊轉換器IDEMac
- 視訊編輯工具:VideoPad Video Editor MacIDEMac
- Tipard Video Converter Ultimate如何旋轉視訊?IDE
- Movavi Video Editor Plus 22,視訊處理IDE
- Allavsoft Video Downloader Converter 視訊下載工具IDE
- HTML5 Audio & Video 屬性解析HTMLIDE
- HTML5 video audio 元素詳解HTMLIDE
- 基於 WebGl HTML5 的 3D 視覺化機房WebHTML3D視覺化
- 使用vue控制video視訊和彈幕功能VueIDE
- Video GIF converter for Mac(gif視訊轉換器)IDEMac
- Cisdem Video Player for mac(高清視訊播放器)IDEMac播放器
- Movavi Video Editor Plus 2022 視訊編輯器IDE
- Movavi Video Editor Plus 2022 視訊編輯器IDE
- VideoPad Video Editor for Mac(視訊編輯工具)11.02IDEMac
- Allavsoft Video Downloader Converter for Mac(視訊下載工具)IDEMac
- Cinematic Video Effects for Mac視訊調色軟體IDEMac
- Movavi Video Editor Plus for Mac視訊編輯器IDEMac
- TunesKit AceMovi Video Editor for Mac(視訊編輯工具)IDEMac
- Mac視訊轉換器:Vidmore Video Converter macMacIDE
- html5的video如何附帶字幕?HTMLIDE
- 網頁看視訊不能全屏怎麼辦_win10視訊無法全屏播放的解決方法網頁Win10
- 記一次微信H5全屏播放視訊的總結H5
- Movavi Video Converter 22 Premium Mac(視訊音訊轉換器)IDEREMMac音訊
- 基於Flutter Video_Player實現倍速播放FlutterIDE
- 基於雲端的視訊剪輯工具