How to hide the Download button and video button of the video Element
1. Use the ControlList API of the video Element
<video controls controlsList="nodownload"></video>
Through the ControList API, you can not only hide the Download button by setting nodownload, but also set nofullscreen to hide full screen buttons and noremoteplayback and other attributes. For specific examples, refer to github pages. This solution has the advantages of native support, does not produce bugs, and is easy to set up. However, since the ControlList API was introduced from Chrome 58 +, therefore, Chrome versions earlier than 58 can only be hidden through method 2.
2. Hide with CSS
After you enable the shadow DOM switch through Settings | Preferences-> Elements-> Show user agent shadow DOM, you can view the components of the video element through devtools.
The download button is displayed through <input type = "button" pseudo DO = "-internal-media-controls-download-button" style = "">, you can use the following CSS to hide it:
video::-internal-media-controls-download-button { display: none;}
However, it is a pity that this method does not work. It may be a BUG in Chrome, so we can only find another way. Simply put, we can squeeze the Download button out of the visible range, in this way, you can think that the button is hidden in disguise. The Code is as follows:
video::-webkit-media-controls { overflow: hidden !important;}video::-webkit-media-controls-enclosure { width: calc(100% + 32px); margin-left: auto;}