I\'m trying to play a youtube playlist using this JavaScript API for iframe-embeds introduced this January. http://apiblog.youtube.com/2011/01/introducing-javascript-player-api-
I found the answer.
Just add 'playlist' to your playerVars and the playlist String|Array.
playerVars: { 'autoplay': 0, 'controls': 1, 'playlist':['your_video_id', '...']},
Like de example below:
var player;
function onYouTubePlayerAPIReady() {
player = new YT.Player('player', {
height: '390',
width: '640',
videoId: 'your_video_id',
playerVars: { 'autoplay': 0, 'controls': 1, 'playlist':['your_video_id', '...']},
events: {
'onReady': onPlayerReady,
'onStateChange': onPlayerStateChange
}
});
}