问题描述
我似乎无法让视频自动播放我选择不使用 video 属性,因为我希望在播放视频之前静态图像看起来更好。
要播放视频,我需要单击播放按钮,然后才会出现视频的小缩略图。然后我需要点击小缩略图才能播放视频。在台式机或笔记本电脑上的 chrome 浏览器上,它似乎工作正常,在移动设备和 Safari 上播放没有问题,它需要此操作,而不仅仅是自动播放。
.why-choose {
background: #fff;
}
.why-choose .choose-right {
height: 100%;
width: 100%;
background-image: url('img/video-bg.jpg');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
position: relative;
}
.why-choose .choose-right .video {
color: #fff;
height: 70px;
width: 70px;
line-height: 70px;
text-align: center;
border-radius: 100%;
position: absolute;
left: 50%;
top: 50%;
margin-left: -35px;
margin-top: -35px;
font-size: 21px;
background: #1a76d1;
padding-left: 4px;
}
.why-choose .choose-right .video:hover {
transform: scale(1.1);
}
.why-choose .video-image .waves-block .waves {
position: absolute;
width: 200px;
height: 200px;
background: #fff;
opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
border-radius: 100%;
-webkit-animation: waves 3s ease-in-out infinite;
animation: waves 3s ease-in-out infinite;
left: 50%;
margin-left: -100px;
top: 50%;
margin-top: -100px;
}
.why-choose .video-image .waves-block .wave-1 {
-webkit-animation-delay: 0s;
animation-delay: 0s;
}
.why-choose .video-image .waves-block .wave-2 {
-webkit-animation-delay: 1s;
animation-delay: 1s;
}
.why-choose .video-image .waves-block .wave-3 {
-webkit-animation-delay: 2s;
animation-delay: 2s;
.mfp-iframe-holder .mfp-close {
color: #FFF;
right: -6px;
text-align: right;
padding-right: 6px;
width: 100%;
}
.mfp-iframe-holder {
padding-top: 40px;
padding-bottom: 40px;
}
.mfp-iframe-holder .mfp-content {
line-height: 0;
width: 100%;
max-width: 900px;
}
.mfp-iframe-holder .mfp-close {
top: -40px;
}
.mfp-iframe-scaler {
width: 100%;
height: 0;
overflow: hidden;
padding-top: 56.25%;
}
.mfp-iframe-scaler iframe {
position: absolute;
display: block;
top: 0;
left: 0;
width: 100%;
height: 100%;
Box-shadow: 0 0 8px rgba(0,0.6);
background: #000;
}
<div class="col-lg-6 col-12">
<!-- Start Choose Rights -->
<div class="choose-right">
<div class="video-image">
<!-- Video Animation -->
<div class="promo-video">
<div class="waves-block">
<div class="waves wave-1"></div>
<div class="waves wave-2"></div>
<div class="waves wave-3"></div>
</div>
</div>
<!--/ End Video Animation -->
<a href="video/emergency-plumber-bristol.mp4" class="video video-popup mfp-iframe"><i class="fa fa-play"></i></a>
</div>
</div>
<!-- End Choose Rights -->
</div>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)