使用ControlSlist ='; quot时自动播放不起作用。

发布于 2025-02-13 20:11:06 字数 496 浏览 1 评论 0原文

我想在视频标签中的控件上隐藏下载选项,但是当我使用controlSlist =“ nodownload”时,它会从选项中隐藏下载按钮,但自动播放将停止工作。我希望自动播放工作并隐藏下载按钮。我该如何解决?提前致谢。

video {
  width: 100%;
  height: 100%;
}
<video src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" controls autoplay controlsList="nodownload"/>

I want to hide the download option on the controls in the video tag but when I use controlsList="nodownload" It hides the download button from options but autoplay will stop working. I want autoplay to work and hide the download button. How can I fix this? Thanks in advance.

video {
  width: 100%;
  height: 100%;
}
<video src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" controls autoplay controlsList="nodownload"/>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

入怼 2025-02-20 20:11:07

添加muted属性。不幸的是,这是浏览器实现。 Autoplaymuted手头,请参见视频自动播放被认为有害

video {
  width: 100%;
  height: 100%;
}
<video src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" controls autoplay muted controlsList="nodownload"/>

Add the muted attribute. Unfortunately, this is a browser implementation. autoplay and muted go hand-in-hand, see video autoplay considered harmful

video {
  width: 100%;
  height: 100%;
}
<video src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" controls autoplay muted controlsList="nodownload"/>

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文