Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何处理“Uncaught (in promise) DOMException: play() failed 因为用户没有先与文档交互”。在带有 Chrome 64 和 HTML5 视频标签的桌面上。
在现代版本的 Chrome 中,您不能让视频自动播放并默认启用声音。
您需要将该muted属性添加到您的 HTML5 标记中:
muted
muted="muted"