【问题标题】:Youtube API error - Failed to execute 'postMessage' on 'DOMWindow':Youtube API 错误 - 无法在“DOMWindow”上执行“postMessage”:
【发布时间】:2018-11-24 05:34:13
【问题描述】:

在“DOMWindow”上执行“postMessage”失败:提供的目标源(“https://www.youtube.com”)与接收窗口的源(“https://my-site.ru”)不匹配。

Nginx 在服务器上。当然还有https!

但是我收到了这个错误...只有在 Google Chrome 视频没有启动时,Firefox 显示正常(和 Edge)!

【问题讨论】:

    标签: youtube


    【解决方案1】:

    哇,奇怪的错误,“可见性=隐藏”是一个原因。 确保在启动播放器之前显示播放容器(与其父容器一样)。

    【讨论】:

    • 我对此充满希望,但我仍然收到Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('<URL>') does not match the recipient window's origin ('<URL>').
    • 这没有帮助,因为我们的元素一开始就没有被隐藏、不可见或不透明;)
    【解决方案2】:

    我们在 visibility = hidden 时遇到了同样的问题,我们能够通过使用 CSS opacity 0 实现几乎相同的技巧。

    【讨论】:

      猜你喜欢
      • 2018-05-29
      • 2016-12-11
      • 2018-05-27
      • 2022-10-19
      • 2016-11-30
      • 2018-05-30
      • 1970-01-01
      • 2019-11-05
      相关资源
      最近更新 更多