2017-02-17 116 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