2015-04-22 89 views
0

我使用引導程序,我想從YouTube上添加一些視頻到我的網站。我看過here這樣做的一些代碼,但是當我嘗試它here它不起作用,視頻不顯示。嵌入式響應式YouTube視頻不顯示

這是代碼:

HTML

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"> 

<!-- jQuery library --> 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> 

<!-- Latest compiled JavaScript --> 
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script> 

<!-- 16:9 aspect ratio --> 
<div class="embed-responsive embed-responsive-16by9"> 
    <iframe class="embed-responsive-item" src="https://www.youtube.com/watch?v=PIh2xe4jnpk"></iframe> 
</div> 

<!-- 4:3 aspect ratio --> 
<div class="embed-responsive embed-responsive-4by3"> 
    <iframe class="embed-responsive-item" src="https://www.youtube.com/watch?v=PIh2xe4jnpk"></iframe> 
</div> 

回答

4

您輸入錯誤的網址YOTUBE。你需要嵌入視頻...

<!-- 16:9 aspect ratio --> 
<div class="embed-responsive embed-responsive-16by9"> 
    <iframe class="embed-responsive-item" src="https://www.youtube.com/embed/PIh2xe4jnpk"></iframe> 
</div> 
<!-- 4:3 aspect ratio --> 
<div class="embed-responsive embed-responsive-4by3"> 
    <iframe class="embed-responsive-item" src="https://www.youtube.com/embed/PIh2xe4jnpk"></iframe> 
</div> 
+0

哦,天哪,你是對的,我沒有注意到哈哈哈,很多很多謝謝! – Fernando