【问题标题】:Firefox equivalent on v33 to chrome's video::-webkit-media-controls-fullscreen-button selectorFirefox 在 v33 上等同于 chrome 的 video::-webkit-media-controls-fullscreen-button 选择器
【发布时间】:2014-12-13 01:26:02
【问题描述】:

标题几乎说明了一切。 我正在努力从默认的<video> 皮肤中选择该死的全屏按钮。

【问题讨论】:

    标签: css html google-chrome firefox


    【解决方案1】:

    我在http://www.jwplayer.com/blog/using-the-browsers-new-html5-fullscreen-capabilities/ 上找到了这个:

    <script type="text/javascript">
      function goFullscreen(id) {
        // Get the element that we want to take into fullscreen mode
        var element = document.getElementById(id);
    
        // These function will not exist in the browsers that don't support fullscreen mode yet, 
        // so we'll have to check to see if they're available before calling them.
    
        if (element.mozRequestFullScreen) {
          // This is how to go into fullscren mode in Firefox
          // Note the "moz" prefix, which is short for Mozilla.
          element.mozRequestFullScreen();
        } else if (element.webkitRequestFullScreen) {
          // This is how to go into fullscreen mode in Chrome and Safari
          // Both of those browsers are based on the Webkit project, hence the same prefix.
          element.webkitRequestFullScreen();
       }
       // Hooray, now we're in fullscreen mode!
      }
    </script>
    
    <img class="video_player" src="image.jpg" id="player"></img>
    <button onclick="goFullscreen('player'); return false">Click Me To Go Fullscreen! (For real)</button>
    

    我知道您可能正在寻找本机播放器的选择器,但这可以让您创建自己的按钮。

    【讨论】:

    • 是的,我已经阅读了这些文档,我想要的是选择器,因为我需要将它(按钮)取出。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-12-18
    • 1970-01-01
    • 2017-10-02
    • 2012-01-09
    • 1970-01-01
    • 2019-02-17
    • 1970-01-01
    相关资源
    最近更新 更多