【问题标题】:Embedded YouTube iframe working incorrectly in Safari (MacOS)嵌入式 YouTube iframe 在 Safari (MacOS) 中无法正常工作
【发布时间】:2018-05-28 22:14:03
【问题描述】:

我的(引导)网站上有一个响应式嵌入式 YouTube 视频。 当我选择 YouTube 全屏选项时,它可以在 Firefox 和 Chrome 上运行,但在 Safari 上它会短暂闪烁,然后全屏显示我整个网页的顶部,就好像 Safari 本身处于全屏模式一样。

CSS:

.embed-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }


HTML:

<div class='embed-container'><iframe src='https://www.youtube.com/embed/myyoutubecode?rel=0' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>


有没有人知道在 Safari 中进行这项工作的方法?

【问题讨论】:

    标签: macos iframe youtube safari embed


    【解决方案1】:

    我找到了答案.. 以防其他人遇到这种情况: wow.js 动画似乎通过导致此问题破坏了全屏功能。禁用 div 的动画可以解决问题。

    【讨论】:

      猜你喜欢
      • 2015-11-14
      • 2013-10-19
      • 2019-09-20
      • 2011-09-15
      • 2012-02-08
      • 1970-01-01
      • 1970-01-01
      • 2014-03-20
      • 2023-02-17
      相关资源
      最近更新 更多