简体   繁体   English

是否可以处理全屏html5视频播放器上的播放按钮?

[英]is it possible to handle play button on fullscreen html5 video player?

I've a html5 video player. 我有一个html5视频播放器。 And there is a play icon on it but when the user went to fullscreen and press play button its not hiding. 并且上面有一个播放图标,但是当用户进入全屏并按下播放按钮时,它不会隐藏。 I'm currently hiding it in normal mode. 我目前在普通模式下将其隐藏。

Anyway, i'll explain step by step. 无论如何,我将逐步解释。

  1. Go to: http://html.banjaworks.com/GameFlank/game.html 转到: http : //html.banjaworks.com/GameFlank/game.html
  2. Press fullscreen button before playing video. 在播放视频之前,请按全屏按钮。
  3. Play it while its fullscreen 全屏播放
  4. Exit fullscreen 退出全屏

and you'll see the icon is still there. 您会看到该图标仍然存在。

Now, i'd like to handle that play button on fullscreen and hide the icon. 现在,我想处理全屏播放按钮并隐藏图标。

Thank you! 谢谢!

Please try the follow code: 请尝试以下代码:

if (document.addEventListener)
{
    document.addEventListener('webkitfullscreenchange', videoexitHandler, false);
    document.addEventListener('mozfullscreenchange', videoexitHandler, false);
    document.addEventListener('fullscreenchange', videoexitHandler, false);
    document.addEventListener('MSFullscreenChange', videoexitHandler, false);
}

function videoexitHandler()
{
    if ((document.webkitIsFullScreen == false) || (document.mozFullScreen == false) || (document.msFullscreenElement == false))
    {
       var wrap =  $('video').parents('.video:first');  
   toggleVideoPlay(wrap);
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM