嵌入的YouTube视频无法在Chrome浏览器上使用

问题描述

我在HTML文件中有这段代码

<iframe width="560" height="315" 
        src="https://www.youtube.com/embed/i6iBAuwBODA">
        </iframe>

它不起作用,只是说“视频不可用”。 我该怎么做才能解决这个问题? 谢谢。

解决方法

直接从youtube复制iframe代码,该标签应该可以使用。转到youtube视频>共享>嵌入

,

JS控制台说:

local-ntp.js:2084 GET chrome-search://local-ntp/search-suggestions.js net::ERR_FAILED requestAndInsertGoogleResources @ local-ntp.js:2084 init @ local-ntp.js:900 local-ntp.html:1 Refused to frame 'https://www.youtube.com/' because it violates the following Content Security Policy directive: "child-src chrome-search://most-visited/ https://*.google.com/". Note that 'frame-src' was not explicitly set,so 'child-src' is used as a fallback

idk是否有帮助

编辑:

等等什么?现在工作正常。