How to embedd multiple videos in a youtube player
I'm trying to create a simple youtube player that should show thumbnail of videos and should play them consecutively. I know youtube instant does this but the JS is minified so I can't make much sense of it. I'm not looking for a premade playlist that can be embedded into a player, because eventually I want to be able to add more videos through an ajax load. For now I am simply trying to have a player that can play two videos.
This is what I have so far: http://jsfiddle.net/V2nJG/4/
Here is a list of player parameters that you can pass to YouTube: http://code.google.com/apis/youtube/player_parameters.html
Value is a comma-separated list of video IDs to play. If you specify a value, the first video that plays will be the VIDEO_ID specified in the URL path, and the videos specified in the playlist parameter will play thereafter.
Also, using an <iframe> embed is easier and puts more of the hassle on YouTube's shoulders. For instance YouTube will decide how to output the video based on the device it's playing on.
Your embed code can be this simple:
<iframe class="youtube-player" type="text/html" width="640" height="385" src="http://www.youtube.com/embed/VIDEO_ID" frameborder="0"> </iframe>