--全屏
MDN语法:var Promise = Element.requestFullscreen(options);
兼容写法:
function toFullVideo(){
if(videoDom.requestFullscreen){
return videoDom.requestFullscreen();
}else if(videoDom.webkitRequestFullScreen){
return videoDom.webkitRequestFullScreen();
}else if(videoDom.mozRequestFullScreen){
return videoDom.mozRequestFullScreen();
}else{
return videoDom.msRequestFullscreen();
}
}
--退出全屏
MDN语法:var Promise = Element.exitFullscreen(options);
兼容写法
exitFullscreen() {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
}
}