2017-07-06 49 views
0

我在我的materializecss網站內有以下html。我提到了文檔http://materializecss.com/media-css.html)。如何在使用實體化CSS構建的網站中顯示YouTube視頻?

<div class = "col s12 m6"> 
    <div class="video-container"> 
     <iframe src="//www.youtube.com/embed/7yDXeEJEi0A?wmode=opaque" frameborder="0" allowfullscreen></iframe> 
    </div> 
</div> 

當我瀏覽這個頁面,我看到的是一條錯誤消息。該視頻在YouTube上運行良好(我也試過其他視頻,沒有運氣)。

此頁面上的其他元素(圖像,文字,下拉菜單)工作正常。任何幫助將不勝感激。

`

回答

0

嘗試增加http://我檢查了之前視頻網址 。它在我的最後工作正常,如果我添加http://或https://(https需要您的服務器/網頁上的SSL)才能正常播放。

<div class = "col s12 m6"> 
    <div class="video-container"> 
     <iframe src="http://www.youtube.com/embed/7yDXeEJEi0A?wmode=opaque" frameborder="0" allowfullscreen></iframe> 
    </div> 
</div>