【发布时间】:2020-10-28 10:19:17
【问题描述】:
我正在尝试构建自定义视频控件。
这是我的代码:
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<style>
video {
transform: scale(-1, 1);
object-fit: cover;
}
</style>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
</head>
<body class="p-1">
<div class="border-top border-primary container-fluid">
<div class="h-25 row">
<div class="border-left border-bottom border-primary col-6 d-flex flex-column p-1" style="box-sizing:border-box">
<div class="bg-primary h-75 text-white">
sdfsfd
</div>
<div class="bg-secondary h-25 text-danger">
9080
</div>
</div>
<div class="border-left border-bottom border-right border-primary col-6 d-flex flex-column p-1">
<video id="remoteView" autoplay muted>
<source src="https://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4">
</video>
</div>
</div>
<div class="row">
<div class="align-items-center border-left border-bottom border-right border-primary col-12 d-flex flex-row justify-content-center p-0">
<div class="btn-group-toggle d-flex justify-content-center p-1">
<button class="btn-sm btn btn-lg btn-success">A</button>
</div>
<div class="btn-group-toggle d-flex justify-content-center p-1">
<button class="btn-sm btn btn-lg btn-success">B</button>
</div>
<div class="btn-group-toggle d-flex justify-content-center p-1">
<button class="btn-sm btn btn-lg btn-success">C</button>
</div>
</div>
</div>
</div>
</body>
</html>
Chrome浏览器窗口最小化时左上角单元格无法正确显示。
但是,在火狐浏览器中,问题不存在。
我该如何解决?
【问题讨论】:
-
高度:100vh;是根据设备高度制作视频高度的 Css
-
对不起,是我对问题的理解不正确,所以我更新了问题。
-
@TheKNVB 你能解释一下你所说的“最小化”是什么意思吗?通常,这会使窗口不可见,因此您应该看不到任何东西。虽然某些窗口管理器(如 Windows 资源管理器)允许您查看缩略图,但这通常是缓存的。您还可以在脚本中看到 Chrome 将完全停止绘制屏幕,或者每秒只绘制一次。在极端情况下,可以暂停整个页面上下文。
-
对不起,我的意思是缩小浏览器窗口。
标签: html css twitter-bootstrap google-chrome