在Safari(MacOS)中嵌入了YouTube IFRAME工作不正确



我在(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中进行这项工作的方法吗?

我找到了答案。万一其他人会遇到这一点:WOW.JS动画似乎通过引起此问题而打破了全屏功能。禁用Div的动画解决问题。

最新更新