change html5 video controls layout when fullscreen

こ雲淡風輕ζ 提交于 2019-11-27 03:49:07

问题


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 i can change the layout in fullscreen mode?


回答1:


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 */
}


来源:https://stackoverflow.com/questions/24318367/change-html5-video-controls-layout-when-fullscreen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!