4

我正在尝试将 Youtube 频道嵌入 HTML 页面。

比如我取这个频道地址:http ://www.youtube.com/aaaa

我使用了这段代码:

<html>
<head>
</head>
<body>
    <iframe src="http://www.youtube.com/aaaa"></iframe> 
</body>
</html>

问题是它不起作用。我尝试了另一个站点,它可以工作。可能是什么问题?

4

4 回答 4

1

问题似乎是由这个网址引起的:http://www.youtube.com/aaaa。

我尝试了其他一些 URL,它可以工作。

您可以在这里轻松尝试一些 URL 。


尝试这个:

  <script src="http://www.gmodules.com/ig/ifr?url=http://www.google.com/ig/modules/youtube.xml&amp;up_channel=aaaa&amp;synd=open&amp;w=320&amp;h=390&amp;title=&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;output=js"></script>
于 2012-08-20T15:19:40.103 回答
0

尝试这个:

<div name="iframe" style="width:100%; height:635px; border:2px solid grey; overflow:hidden">
  <iframe src="http://yourchannel-URL" style="width:100%; height:700px; margin-top: -65px" scrolling="true">
     If you can see this, your browser doesn't support iframes. Click <a href="http://mychannel.url">here to see my YouTube channel.</a>
  </iframe>
</div>

这应该嵌入一个没有 youtube 搜索栏的完整 youtube 频道。

于 2012-08-20T15:19:16.440 回答
0
<iframe class="youtube-player" type="text/html" width="640" height="385" src="http://www.youtube.com/aaaa" frameborder="0">
</iframe>

这是取自 youtube这里

看来 IE(和其他)只能使用 [youtube.com/embed/videoID](HTML5 播放器)——至少是我实现它们的方式。

于 2012-08-20T15:21:09.347 回答
-2

要显示您的 YouTube 频道最新视频的缩略图库,您可以使用 iframe:

<iframe
    onload="javascript:this.style.height = this.contentWindow.document.body.scrollHeight + 'px';"
    scrolling="no"
    height="600"
    marginheight="0"
    frameborder="0"
    width="480"
    src="http://youtubechannelembed.com/gallery.php?vids=9&user=doitfordummies&row=3&width=150&margin_right=15&desc=100&title=30&views=1&likes=1&dislikes=1&fav=1">
</iframe>
于 2013-05-24T21:22:51.217 回答