Edned Edned - 3 months ago 22
HTML Question

Embedding most recent YouTube video with Channel ID

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>


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?

Answer

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.

  • If the listType parameter value is user_uploads, then the list parameter value identifies the YouTube channel whose uploaded videos will be loaded.

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.

example

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

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

For more information, check this related SO question.