Auto play is not working without muted attribute, when I try to open url in mobile device. How to play video without using muted attribute ? I need to volume without click on muted button and one more important thing is that all thing will be working without JS and Jquery.
如果不进行黑客攻击,你将无法在 iOS 中实现这一目标。来自 Apple WebKit 官方文档:
从 iOS 10 开始,WebKit 放宽了内联和自动播放策略
使这些演示成为可能,但仍牢记网站的
带宽和用户电池。
默认情况下,WebKit 将具有以下策略:
- 如果视频元素的源媒体不包含音轨,则无需用户手势即可自动播放视频元素。
-
视频静音元素也将被允许在没有用户手势的情况下自动播放。如果元素在没有用户手势的情况下获得音轨或取消静音,则播放将暂停。
https://webkit.org/blog/6784/new-video-policies-for-ios/ https://webkit.org/blog/6784/new-video-policies-for-ios/
对于移动 Chrome (Android):
Android 版 Chrome 已支持视频的静音自动播放
版本 53。一次视频元素将自动开始播放
如果自动播放和已设置静音,并且可以使用 play() 以编程方式启动静音视频的播放。以前,无论静音状态如何,移动设备上的播放都必须通过用户手势启动。
https://developers.google.com/web/updates/2016/07/autoplay https://developers.google.com/web/updates/2016/07/autoplay
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)