HTML5 exiting video fullscreen

后端 未结 4 675
眼角桃花
眼角桃花 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:45

    Here is an updated code as for now (Jun 4th 2017), works on all browsers:

    if (document.exitFullscreen)
        document.exitFullscreen();
    else if (document.webkitExitFullscreen)
        document.webkitExitFullscreen();
    else if (document.mozCancelFullScreen)
        document.mozCancelFullScreen();
    else if (document.msExitFullscreen)
        document.msExitFullscreen();
    

提交回复
热议问题