使用声音启用视频自动播放
我已经在HTML中使用Sound Works启用视频启用视频搜索了很多。
- 自动播放只能与杂音 strong>
事实是,当 autoplay
之后是 muted
属性时,自动播放的工作正常。
我有这个视频,并且本来可以自动播放,而没有用户交互( Controls
),并且可以打开声音。
//start condition (jquery)
//$('video').removeAttr('muted');
//end condition
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div>
<video class="childhood-img" muted="muted" autoplay="autoplay" loop="loop" playsinline="playsinline" type="video/mov" src="https://www.youtube.com/watch?v=MDLn5-zSQQI" >
</video>
</div>
我的傻瓜是,如何启用自动播放,在没有上的声音和的情况下没有控制
abrutter?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果没有用户与页面进行交互,则不再使用声音自动播放。浏览器供应商禁用了此功能,因为它惹恼了很多人,并且在工作环境中并不安全。
有趣的ressource: httpps://jamonserrano.github.github.io/state-oio/state-of-autoplay/
Having autoplay with sound is not possible anymore without an user interacting with the page. Browser vendors disabled this feature because it annoyed a lot of people and it was not safe in working environments.
Interesting ressource: https://jamonserrano.github.io/state-of-autoplay/