Jor*_*ber 1 javascript video jquery fullscreen html5-video
有没有办法检测用户是否退出全屏视频.如果退出全屏模式,我想重新加载我的视频.我在这里找到了一些关于cancelFullScreen和exitFullScreen的内容,但我找不到任何东西对我有用.任何信息将不胜感激.
我认为这取决于你用于视频的播放器.我会查看引用该视频播放器的文档.通过简单的Google搜索,我获得了以下结果:https://www.google.com/search?q = debug + if + fulll + screen + video + jquery&ie = utf-8&eo = 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
}
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2247 次 |
| 最近记录: |