有个需求,客户想做个打开官网自动播放一段视频,楼主使用了video标签,即下面的代码:
<div class='popup_video'>
<video id="myVideo" style="z-index:-1" width="100%" -webkit-playsinline="true"
controls="controls" loop="loop" autoplay="autoplay" poster="http://XXX.com/5_20.png"
src="http://XXX.com/5_20.mp4"
type="video/mp4">
</video>
<div class="close"></div>
</div>
可以试一下下面的解决方案:
<div class='popup_video'>
<video autoplay loop muted playsinline id="myVideo" style="z-index:-1" width="100%" -webkit-playsinline="true"
controls="controls" poster="http://XXX.com/5_20.png"
src="http://http://XXX.com/5_20.mp4"
type="video/mp4">
</video>
<div class="close"></div>
</div>
这是跟我们部门的老司机学的