記錄一下HTML5 中Video 全屏監聽,退出全屏事件方法


最近做視頻播放的時候,要求退出全屏的時候,視頻可以繼續播放不暫停,找了一個比較好用的js方法,記錄一下
 
function checkFull(){
    var isFull = document.fullscreenEnabled || window.fullScreen || document.webkitIsFullScreen || document.msFullscreenEnabled;
    if(isFull === undefined) isFull = false;
    return isFull;
}
$(window).resize(
function () {     if (!checkFull()) {       console.log("退出全屏");     } });

 

作者:itcong

鏈接:https://www.jianshu.com/p/f94da7808afd


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM