0
在我的網頁我有進入全屏模式,通過以下方式視頻:如何檢測Internet Explorer視頻是否退出全屏模式?
$('.fullscreen-btn').click(function() {
if (movie[0].requestFullscreen) {
movie[0].requestFullscreen();
} else if (movie[0].mozRequestFullScreen) {
movie[0].mozRequestFullScreen();
} else if (movie[0].webkitRequestFullscreen) {
movie[0].webkitRequestFullscreen();
} else if(movie[0].webkitEnterFullscreen){ //ipad fix
movie[0].webkitEnterFullscreen();
} else if (movie[0].msRequestFullscreen){ //IE fix
movie[0].msRequestFullscreen();
}
//followed by some code for smallscreen button, positioning customized play and pause button etc.
});
當我離開全屏模式,我有以下的代碼來檢測它:
$('.smallscreen-btn').click(function() {
if (document.exitFullscreen) {
document.exitFullscreen();
}
else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
}
else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
}
if(movie[0].webkitExitFullscreen){ //ipad specific
...
}
});
但我不知道什麼條件適用於IE瀏覽器: 我試過if(document.msExitFullScreen){...}
,if(movie[0].msExitFullScreen){...}
所以我知道如何檢測進入全屏模式但不取消它。任何人都知道什麼可以工作
也許MSFullscreenChange,因爲它從文檔說? http://msdn.microsoft.com/en-us/library/ie/dn265028(v=vs.85).aspx – Alex
噢!謝謝! MSExitFullScreen無法正常工作,但MS全屏更改事件:http://msdn.microsoft.com/en-us/library/ie/dn312066%28v=vs.85%29.aspx做的工作:) – user2718671
有時谷歌幫助;) – Alex