Youtube嵌入式视频显示空白屏幕

时间:2015-01-04 18:29:27

标签: html5 iframe

我刚刚复制了链接,在我的localhost网站上嵌入了YouTube视频。

<div class="video">
    <iframe width="420" height="315" src="//www.youtube.com/embed/sewZ2a-LBcQ?feature=player_detailpage" frameborder="0" allowfullscreen>
    </iframe>
</div>

div容器中只显示空白屏幕。

有什么问题?在灯具现场可能有所不同吗?

更新1:

似乎localhost(lamp)存在一些问题,因为它在http://jsfiddle.net中运行。

更新2:

这很令人尴尬,但视频现在正在显示。不知道为什么以前没有。

1 个答案:

答案 0 :(得分:0)

您是否尝试过在src中使用协议而不是“//”。 https://www.youtube.com/embed/sewZ2a-LBcQ?feature=player_detailpage。如果您在本地测试,它会尝试将网址解析为“file://www.youtube.com/embed/sewZ2a-LBcQ?feature = player_detailpage”。

相关问题