首页 > 解决方案 > 背景视频不适用于移动横幅

问题描述

我使用 Jquery 插件 covervid.min.js 在横幅上添加背景视频,它在桌面上工作,但视频不在移动视图中播放。

<div class=bgvideo>
  <div class="masthead">
    <video class="masthead-video" preload autoplay loop muted poster="images/banner/paragliding.jpg">
      <source src="images/aeros.mp4" type="video/mp4">
    </video>
    <div class="masthead-overlay"></div>
    <div class=owl_text>
      <div class=owl-carousel>
        <div class=text1>
          <h1>Explore the Exciting Landmarks of Malaysia</h1>
          <p>Choose the Best Suitable for You &amp; Your Family </p>
        </div>
        <div class=text2>
          <h1>Venture into the Land of Islands, Sea, and Incredible Countryside</h1>
          <p>Attractive and Exciting Rides at Affordable Price</p>
        </div>
        <div class=text3>
          <h1>A True Adventure Paradise</h1>
          <p>Lifetime Memory Flying Over the Natural Heritage</p>
        </div>
      </div>
    </div>
  </div>
</div>
coverVid(document.querySelector('.masthead-video'), 640, 360);
.masthead {
  position: relative;
  min-width: 100%;
  background-image: none;
}

.masthead-video {
  z-index: 0;
}

.masthead-overlay {
  background-color: #0000002e;
  opacity: 0.5;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 100%;
}

我还尝试了 youtube jquery 插件(jquery.youtubebackground.js),但它仍然无法在移动视图中工作。请帮我解决这个错误。感谢你在期待。

标签: jquery

解决方案


推荐阅读