我有以下代码用于响应式YouTube视频,但根本不显示。当我删除类时,视频显示但其宽度非常短。 Here是托管它的网站。
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="<?php echo get_field( "youtube_video" );?>" frameborder="0" allowfullscreen></iframe>
<div class="more-videos">
<button type="button" class="btn btn-warning">View More Videos From Matt</button>
</div>
</div>
网站上显示的HTML,
<div class="row">
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="http://www.youtube.com/v/lQ2EZdkLCfc&version=3&loop=1&playlist=gq_zxxutiok,GEuouxgqa3Q,iwiXhnjlRuw" frameborder="0" allowfullscreen></iframe>
<div class="more-videos">
<button type="button" class="btn btn-warning">View More Videos From Matt</button>
</div>
</div>
</div>
答案 0 :(得分:2)
Youtube网址错误。将v
替换为网址中的embed
,并将第一个&
替换为?
,以表示查询字符串的开头。
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" rel="stylesheet">
<div class="row">
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="http://www.youtube.com/embed/lQ2EZdkLCfc?version=3&loop=1&playlist=gq_zxxutiok,GEuouxgqa3Q,iwiXhnjlRuw" frameborder="0" allowfullscreen></iframe>
<div class="more-videos">
<button type="button" class="btn btn-warning">View More Videos From Matt</button>
</div>
</div>
</div>
&#13;