HTML5 exiting video fullscreen

后端 未结 4 660
眼角桃花
眼角桃花 2020-12-16 00:52

I have a HTML5 video with custom controls in normal screen. Don\'t have custom controls at full screen. I just show default controls at full screen. But when exitin

4条回答
  •  囚心锁ツ
    2020-12-16 01:42

    $('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);    
    });
    

提交回复
热议问题