嵌入带有频道ID的最新YouTube视频 [英] Embedding most recent YouTube video with Channel ID

查看:148
本文介绍了嵌入带有频道ID的最新YouTube视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为朋友建立一个网站,但YouTube播放器API遇到了一些麻烦.这是我到目前为止拥有的嵌入式HTML IFrame:

I am building a website for a friend and I'm having some trouble with the YouTube player API. This is the embed HTML IFrame I have so far:

<body>    
    <iframe style="max-width: 480px" width="100%" height="360" src="http://www.youtube.com/embed?max-results=1&controls=0&showinfo=0&rel=0&listType=user_uploads&list=UCvDJ_vg2dics1kmwUPnTo_A" frameborder="0" allowfullscreen></iframe>
</body> 

由于他的YouTube频道使用了新的ID系统,并且未在"user_uploads"类型中检测到这一事实,因此无法使用.有什么想法吗?

This does not work due to the fact that his YouTube channel uses the new ID system and it doesn't detect that in the "user_uploads" type. Any ideas?

推荐答案

播放器参数中进行了说明 列表参数 listType参数一起,标识将在播放器中加载的内容.

It is stated in the Player Parameter of Iframe API that the list parameter, in conjunction with the listType parameter, identifies the content that will load in the player.

  • 如果 listType 参数值为 user_uploads ,则 list 参数值将标识其上传视频的YouTube频道 将被加载.
  • If the listType parameter value is user_uploads, then the list parameter value identifies the YouTube channel whose uploaded videos will be loaded.

这里没有说明您需要在列表参数中放置频道ID. list参数值标识要加载其上传视频的YouTube频道.

It is not stated here that you need to place Channel ID in the list parameter. The list parameter value identifies the YouTube channel whose uploaded videos will be loaded.

因此,您需要在此处放置用户名.

So what you need to place here is the USER NAME.

示例

https://www.youtube.com/user/Nightblue3

尝试在请求的list parameter中使用 Nightblue3 .这样您的嵌入视频就可以了.

Try to use the Nightblue3 here in the list parameter of your request. And your embed video will work.

有关更多信息,请检查以下相关的 SO问题.

For more information, check this related SO question.

这篇关于嵌入带有频道ID的最新YouTube视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆