2

I'd like to create a playlist that loads all the videos a specific user has uploaded.

I was suggested to use the following code (assuming the account to pull in is YouTube):

loadPlaylist( { listType: 'user_uploads', list: 'youtube' } );

I have looked over the API pages as well: http://code.google.com/apis/youtube/js_api_reference.html

But I can't find an actual example code that uses load playlist. Being completely new to YouTube API I have no idea what type of wrapper code I need to make the above work. Something like this (of course I'm missing parts):

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>    
<script type="text/javascript">
loadPlaylist( { listType: 'user_uploads', list: 'youtube' } );
</script>

Or if someone could provide working example with the original loadplaylist line that would be great, and I can work on the other details I need on my own from there.

tshepang
  • 12,111
  • 21
  • 91
  • 136
TechRemarker
  • 2,788
  • 11
  • 37
  • 60
  • I think this should be on StackOverflow instead of StackApps. I've flagged for migration, no need for you to ask again on Stack Overflow. – jrg Feb 15 '12 at 23:29
  • Was on Stackoverflow but looked in the footer and say a StackOverflow site for "api/apps" and since this is an api question, this would be the right site no? – TechRemarker Feb 16 '12 at 01:49
  • StackApps is for questions related to the StackExchange/StackOverflow API/apps, not just generic APIs. :) – jrg Feb 16 '12 at 01:53

2 Answers2

1

Not sure looking at your snippet, but it appears you don't identify the player object to load. The object syntax is:

player.loadPlaylist({list:String,
                     listType:String,
                     index:Number,
                     startSeconds:Number,
                     suggestedQuality:String}):Void

Here is the YouTube link with more detail info on cueing and loading playlist:

https://developers.google.com/youtube/iframe_api_reference#Queueing_Functions

Paul Roub
  • 36,322
  • 27
  • 84
  • 93
CapnPamma
  • 25
  • 9
1

If you just want to embed the videos, you could use:

https://www.youtube.com/embed/videoseries?list=USERID

And the USERID is your youtube user id with 'UU' appended.

For example, if your user id is TlQ5niAIDsLdEHpQKQsupg then you should put UUTlQ5niAIDsLdEHpQKQsupg. If you only have the channel id (which you can find in your channel URL) then just replace the first two characters (UC) with UU.

So in the end you would have an URL like this: https://www.youtube.com/embed/videoseries?list=UCTlQ5niAIDsLdEHpQKQsupg

BTW. you can append &index=2 to specify which video should be played.

See answer on duplicate

espspinix
  • 166
  • 2
  • 4