有没有办法检测用户是否退出全屏视频。如果退出全屏模式,我想重新加载我的视频。我在这里找到了一些关于cancelFullScreen和exitFullScreen的内容,但我找不到任何东西对我有用。任何信息将不胜感激。
答案 0 :(得分:5)
我认为这取决于您用于视频的播放器。我会查看引用该视频播放器的文档。通过简单的Google搜索,我得到了以下结果:https://www.google.com/search?q=detect+if+full+screen+video+jquery&ie=utf-8&oe=utf-8
// Entering fullscreen mode
$('video#my-video').bind('webkitfullscreenchange mozfullscreenchange fullscreenchange', function(e) {
var state = document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen;
var event = state ? 'FullscreenOn' : 'FullscreenOff';
// Now do something interesting
//alert('Event: ' + event);
if (event == "FullscreenOn"){
//do something when fullscreen on
}
});