Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I catch event ExitFullScreen of a video?

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

like image 854
Ivan Avatar asked Oct 24 '25 08:10

Ivan


1 Answers

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);
like image 100
robertc Avatar answered Oct 26 '25 22:10

robertc



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!