当前的金丝雀版Chrome 65阻止了自动播放声音的iframed youtube视频.
Chrome的最新更改要求iframe具有allow =“autoplay”
如何在youtube iframe api中添加allow =“autoplay”?我在任何文档中都找不到它.
https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#iframe
A feature policy allows developers to selectively enable and disable use of varIoUs browser features and APIs. Once an origin has received autoplay permission,it can delegate that permission to cross-origin iframes with a new feature policy for autoplay. Note that autoplay is allowed by default on same-origin iframes.
<iframe src="myvideo.html" allow="autoplay">
解决方法
YouTube IFrame API最近已更新为使用allow = autoplay而非gesture = media.它应该按预期工作.
对困惑感到抱歉.