HTML5 Video with Fullscreen Mode in IE9 and Firefox

不打扰是莪最后的温柔 提交于 2019-12-06 04:36:19

ie9 does not support the fullscreen-api

for FF and Chrome simply improve your function... first, drop the "get(0)" for the shorter "[0]". Then add a var to cache the pointer to your video and finally add the w3c version of the command

$('.fullscreen').on('click', function() {
var a = $('#video1')[0],
    fsReturn = a.requestFullscreen ? a.requestFullscreen() : // W3C
    a.webkitRequestFullScreen ? a.webkitRequestFullScreen() : // Chrome
    a.mozRequestFullScreen ? a.mozRequestFullScreen() : false; // Firefox
};
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!