【问题标题】:Embeded Youtube video doesn't work on chrome嵌入 Youtube 视频不适用于 chrome
【发布时间】:2020-09-28 04:32:17
【问题描述】:

我在 HTML 文件中有这段代码

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

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

【问题讨论】:

  • 这能回答你的问题吗? Embed Youtube code is not working in HTML
  • 我读过但不太明白如何替换 JSFiddle 中的 src 值。谢谢
  • 所以这是一个 JSFiddle 问题?也许更新你的标签和问题
  • 你说得对,谢谢。

标签: html iframe youtube-iframe-api


【解决方案1】:

直接从 youtube 复制 iframe 标记应该可以工作。转到 youtube 视频 > 分享 > 嵌入

【讨论】:

    【解决方案2】:

    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
    猜你喜欢
    • 2018-06-08
    • 2016-04-02
    • 1970-01-01
    • 2019-01-31
    • 2020-12-28
    • 2015-05-12
    • 2017-09-03
    • 1970-01-01
    相关资源
    最近更新 更多