0

I'm trying to get this code to work

<iframe width="300" height="200" src="http://www.youtube.com/embed?max-results=1&controls=0&showinfo=0&rel=0&listType=user_uploads&list=YOUR_CHANNEL_NAME_HERE" frameborder="0" allowfullscreen></iframe>

but it doesn't work. I think the reason for this is because there is a space in the username. I tried a lot of things like using a _ or - and a lot of other things hoping it would work. But it didn't work, so thats why i need help.

  • Tim
Sarbbottam
  • 5,410
  • 4
  • 30
  • 41
Tim Vld
  • 11
  • 1

1 Answers1

0

Try putting the username inside ' ' single quotes. i.e.

&list='YOUR CHANNEL NAME HERE'

The single quotes should be fine inside of the "" double quoted src string. It will hinge on whether the YouTube api will accept the channel name wrapped in them.

Update - Code to embed latest YouTube video from channel (HTML Auto Embedding Recent Uploaded videos from a youtube channel):

<iframe width="300" height="200" src="http://www.youtube.com/embed?max-results=1&controls=0&showinfo=0&rel=0&listType=user_uploads&list=YOUR_CHANNEL_NAME_HERE" frameborder="0" allowfullscreen></iframe>

So this brings us back to the problem with having a space in the username, so there is normally a hash string that represents the channel 'name' on YouTube. I would try using this hash key instead of the text channel name.

Community
  • 1
  • 1
Whiplash450
  • 943
  • 2
  • 12
  • 22
  • It didn't work, the friend i'm building the site for removed the space but when i type his username i get another account. I think someone else has the same username. Do you know a way to embed the latest youtube video using the channel url and not the name? – Tim Vld Nov 18 '15 at 17:04
  • updated my answer, try that or look at that question. – Whiplash450 Nov 18 '15 at 17:10