Android端video全屏 按返回键后白屏解决方法

2019-09-19 10:29:27 浏览数 (1)

代码语言:javascript复制
//捕捉Android返回键
mui.back = function() {
	// 是否存在全屏元素  
	var el = document.fullscreenElement || document.webkitFullscreenElement;
	if(el != null) {
		exitFullscreen();//退出全屏
	} else {
		plus.webview.currentWebview().close();//关闭当前页
	}
};
//退出全屏
function exitFullscreen() {
	var de = document;
	if(de.exitFullscreen) {
		de.exitFullscreen();
	} else if(de.mozCancelFullScreen) {
		de.mozCancelFullScreen();
	} else if(de.webkitCancelFullScreen) {
		de.webkitCancelFullScreen();
	}
}

0 人点赞