change html5 video controls layout when fullscreen

后端 未结 1 383
终归单人心
终归单人心 2020-12-10 09:31

I\'m following this tutorial on how to change html5 video controls layout. But when i go fullscreen mode, the controls goes back to default. Do anyone have an example on how

相关标签:
1条回答
  • 2020-12-10 09:54

    Hide the native controls completely, in both normal and full-screen mode:

    video::-webkit-media-controls-enclosure {
      display:none !important;
    }
    

    Set the z-index for the custom controls to be equal to or higher than 2147483647:

    #video-controls {
      z-index: 2147483647;
    }
    

    Source: Hiding Native HTML5 Video Controls in Full-Screen Mode

    Note: if you are following the tutorial, then you need to also set position of custom controls to make it visible:

    #video-controls {
      z-index: 2147483647;
      position: absolute; /* top left corner, change it if you like */
    }
    
    0 讨论(0)
提交回复
热议问题