Styling browser-native video controls

前端 未结 5 822
长发绾君心
长发绾君心 2020-11-29 09:21

Is it possible to cross-browser style the controls of a browser-native video such as video from HTML5\'s video tag?

I do not understand if it is possible or not, I c

5条回答
  •  春和景丽
    2020-11-29 09:56

    You could style the shadow DOM, but you need to look at every browser individually and a browser update could destroy your styling.

    I recommend taking a look at MediaElement.js which gives you cross-browser controls that can be styled using CSS and are already accessibility-optimized.

    Or if you only need a few controls anyway, build your own: https://developer.mozilla.org/en-US/docs/Web/Guide/Audio_and_video_delivery/Video_player_styling_basics

提交回复
热议问题