嵌入式YouTube iframe在Safari中运行不正确(MacOS)

时间:2017-12-14 18:23:37

标签: macos iframe youtube safari embed

我的(bootstrap)网站上有一个自适应的嵌入式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中使用这种方法的方法?

1 个答案:

答案 0 :(得分:0)

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