Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.0k views
in Technique[技术] by (71.8m points)

小米手机自带浏览器,video下有下载按钮,如何隐藏?

已经添加了controlsList="nodownload"来禁止下载,在小米手机自带浏览器仍然可以下载,应该怎么修改?

video::-internal-media-controls-download-button {
    display: none;
}

video::-webkit-media-controls-enclosure {
    overflow: hidden;
}

video::-webkit-media-controls-panel {
    width: calc(100vw + 30px);
}
<video class="recommend_source" loop="loop" controls="controls" controlsList="nodownload" x-webkit-airplay="allow" webkit-playsinline="true"
playsinline="true" x5-video-player-type="h5" x5-video-orientation="portrait" src=${recommendMediasSource}
 x5-video-player-fullscreen="false" poster=${recommendMedias[i].cover}></video>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

不同浏览器对video 的呈现都有差别,一般我们会禁用掉 controls 自己重写 controls 以达到统一。

你也可以用 第三库 推荐一个:DPlayer http://dplayer.js.org/zh/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...