2017-02-17 126 views
0

我遇到了一个问题,导致我疯了,我不知道该怎么办。我从pixelarity dot com购买了模板“Formula”。在演示中,该网站有一个视频在后台循环播放。但是,下载版本具有用于背景的不同视频(命名横幅)。我将要播放的视频复制到图像文件夹(以.mp4和webm格式),并更新了代码,如下所示,我的视频名称为“forwes”,但在预览页面时它不会加载(它仍在播放附带视频的下载。视频未加载/ html5

任何想法,为什么它时,页面加载不玩了?请记住,我在网页设计一个小白和编码

谢谢!

排除文件扩展名,模板将自动在支持背景视频的平台上生成多格式*标记,并简单地跳过对那些没有作用的人来说是0步(落后于你设定的背景图像)。

   * Your video must be offered in both .mp4 and .webm formats to work everywhere. 
      --> 
       <section id="banner" data-video="images/forwes"> 
        <div class="inner"> 
         <header> 
          <h1>Our Business Name</h1> 
          <p>W we will repair your computers, phones, printers and all other electronic devices. <br /> We provide both in-store support as well as provide full service, onsite IT support for businesses. Contact us for your free consultation today!.</p> 
         </header> 
         <ul class="actions"> 
          <li><a href="#" class="button special big">Get Started</a></li> 
         </ul> 
        </div> 
        <a href="#one" class="more">Learn More</a> 
       </section> 
+0

你必须需要添加正确的'video'然后'具体玩视频source'标签'ogg' ,'webm'和'mp4'格式我在答案上加了一个例子.............. – Momin

回答

0

试试这个以正确的视频格式和标签

.container{ 
 
margin: 30px auto; 
 
display:block; 
 
max-width:1200px; 
 
}
<div class="container"> 
 
    <video class="video" poster="" id="bgvid" playsinline autoplay muted loop> 
 
      <!-- WCAG general accessibility recommendation is that media such as background video play through only once. Loop turned on for the purposes of illustration; if removed, the end of the video will fade in the same way created by pressing the "Pause" button --> 
 
      <source src="http://vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> 
 
      </source> 
 
      <source src="http://vjs.zencdn.net/v/oceans.webm" type="video/webm"> 
 
      </source> 
 
      <source src="http://vjs.zencdn.net/v/oceans.ogv" type="video/ogg"> 
 
      </source> 
 
     </video> 
 
</div>

+0

它的工作...我只需要关闭并重新打开我的浏览器... smh – rvapcgirl

+0

你可以还通过跟随此链接控制视频播放,暂停和更多 https://codepen.io/dudleystorey/pen/knqyK – Momin