google-chrome - 在 Chrome 中使用 animate.css 时出现全屏视频问题

标签 google-chrome video fullscreen animate.css

我有一个页面包含使用视频标签的视频。此外,我的页面使用 animate.css 向我的元素添加一些动画。问题是当我在 animate.css 中使用样式时,我的视频无法正确全屏显示。这是我的页面示例:

<div id="wrapper">
    <div id="page-wrapper" class="gray-bg dashbard-1">
        <h2 id="sv_title">Here is some text for illustration</h2>

        <div class="animated fadeInRight">
            <video src="http://www.w3schools.com/html/mov_bbb.mp4" controls=""></video>
        </div>
    </div>
</div>

https://jsfiddle.net/p4nmt637/

此外,这个问题似乎只发生在 chrome 中,我在 FireFox 和 Safari 中测试过,我没有遇到这个问题。

最佳答案

这似乎是一个 Chrome 错误。问题是由 animation-fill-mode 设置为 both 引起的。这会使动画在视频父容器上保持事件状态,这似乎会干扰全屏视频。

解决方法

通过将其改回默认值 none,我们解决了全屏问题。在此示例中,动画填充模式通过 .custom 类更改。

例子

this jsfiddle 中有一个工作示例.

/*Uncomment the class to fix*/  

/*
.custom {
   animation-fill-mode: none;
}
*/
<link href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.4.0/animate.css" rel="stylesheet" />
<h2 id="sv_title">This is the problem, the bottom video is being layered over the top when this is made fullscreen. Uncomment the custom class to see it fix itself.</h2>
<div class="animated fadeInRight custom">
  <video src="http://www.w3schools.com/html/mov_bbb.mp4" controls></video>
</div>
   
<div class="animated fadeInRight">
  <video src="http://www.w3schools.com/html/mov_bbb.mp4" autoplay muted></video>
</div>

关于google-chrome - 在 Chrome 中使用 animate.css 时出现全屏视频问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32323499/

相关文章:

javascript - 如果浏览器在后台,FCM 推送通知会到达两次

html - 在一个选项卡中上传图片 = 我的网站无法在另一个选项卡中打开图片 - chrome

google-chrome - 如何使用 Chrome DevTools 在 AngularJS 异常中暂停脚本执行?

xcode - AppleTV + Swift + MP4 + Xcode?如何在 xcodeproj 中显示 .mp4?

ios - 从 iOS 中的视频 url 或数据获取缩略图

java - 使用 Java 锁定屏幕

cocoa - 绘制到全屏 GL 上下文中

css - 关闭 ClearType 的 WinXP 上的糟糕字体 - 仅限 Chrome

javascript - HTML5视频截图

javascript - Chrome 扩展程序 - 进入全屏模式会将页面背景颜色变为黑色