How can I catch event ExitFullScreen of a video?

北城以北 提交于 2020-01-04 02:34:41

问题


How can I catch event ExitFullScreen of a video ? I need to redraw the page when I exit the FullScreen of tag video.


回答1:


Listen to the fullscreenchange event:

document.addEventListener("fullscreenchange", function () {
    console.log(document.fullscreen);
}, false);
document.addEventListener("mozfullscreenchange", function () {
    console.log(document.mozFullScreen);
}, false);
document.addEventListener("webkitfullscreenchange", function () {
    console.log(document.webkitIsFullScreen);
}, false);


来源:https://stackoverflow.com/questions/11471919/how-can-i-catch-event-exitfullscreen-of-a-video

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!