Youtube iframe api allow =" autoplay" Chrome 65 [英] Youtube iframe api allow="autoplay" Chrome 65

查看:693
本文介绍了Youtube iframe api allow =" autoplay" Chrome 65的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前的金丝雀版Chrome 65阻止了自动播放声音的iframed youtube视频。

Chrome 65, the current canary version, is blocking iframed youtube videos from auto playing with sound.

对Chrome的最新更改要求iframe具有 allow =autoplay

The latest changes to Chrome require the iframe to have allow="autoplay"

如何将 allow =autoplay添加到youtube iframe api?我在任何文档中都找不到它。

How do I go about adding allow="autoplay" to the youtube iframe api? I can't find it in any of the documentation.

https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#iframe


功能策略允许开发人员有选择地启用和禁用各种浏览器功能和API的使用。一旦来源获得了自动播放权限,它就可以将该权限委托给具有自动播放新功能策略的跨源iframe。请注意,默认情况下,在同源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 而不是手势=媒体。它应该按预期工作。

The YouTube IFrame API has been recently updated to use allow=autoplay instead of gesture=media. It should now work as expected.

对于这种混淆感到抱歉。

Sorry for the confusion.

这篇关于Youtube iframe api allow =&quot; autoplay&quot; Chrome 65的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆