我用来在我的网站object-fit:cover
上播放背景视频(向下滚动)。Firefox 和 Chrome 可以正确显示它,但 Edge 不能 - 尽管它支持该属性。object-fit
.sec-content > div {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.bg-video {
position: absolute;
z-index:4;
left: 0;
top: 0;
width: calc(50% + 400px);
height: 100%;
}
.bg-video video {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
-o-object-fit: cover;
object-fit: cover;
box-sizing: border-box;
}
<div class="bgg-2 bg-video">
<video autoplay="autoplay" muted="muted" playsinline="" loop="loop" poster="/images/2.jpg" class="scroll-video">
<source src="/files/video-test.mp4" type="video/mp4">
</video>
</div>
为什么 Edge 没有像应有的那样显示它?