html5 vadio视频(全屏/退出全屏)

vedio标签的requestFullscreen和exitFullscreen的使用

//全屏
function requestFullscreen(element){
    if(element.requestFullscreen){
       element.requestFullscreen();//标准
    }else if(element.mozRequestFullScreen){                    
        element.mozRequestFullscreen();// 火狐
   }else if(element.webkitRequestFullscreen){
        element.webkitRequestFullscreen();// 谷歌
   }else if(element.msRequestFullscreen){
        element.msRequestFullscreen();// IE
   }
}
//退出全屏
function exitFullscreen(element){
    if(element.exitFullscreen){
        element.exitFullscreen();
    }else if(element.mozExitFullscreen){
        element.mozExcitFullscreen();
    }else if(element.webkitExitFullscreen){
        element.webkitExitFullscreen();
    }else if(element.msExitFullscreen){
        element.mskitExitFullscreen();    
}
}

你可能感兴趣的:(html5 vadio视频(全屏/退出全屏))