Reputation: 2325
I am using the javascript youtube api to embed youtube videos, i am having difficulty in embedding playlists using the swfobject.embed functionality. The code im using which i found in the javascript api docs is:
var splitSrc = src.split(",");
var params = { allowScriptAccess: "always", wmode: "transparent", allowFullScreen: "true" };
var atts = { id: "myytplayer" };
if (splitSrc.length > 1) {
swfobject.embedSWF("http://www.youtube.com/v/" + splitSrc[0] + "?showsearch=0&enablejsapi=1&playerapiid=ytplayer&rel=0&fs=1&playlist=" + src,
"PlayerYoutube", "0", "0", "8", null, null, params, atts);
}
where src is a comma seperated list of video ids, but the player loads just the first video specified in splitSrc[0].
Is there another way of doing this? Am i doing this wrong?
Please could someone help me with this issue.
I have another work arround but its going to be a lot of implementation involved, i would rather have a simple solution to this.
Upvotes: 0
Views: 3343
Reputation: 1383
The embedded AS2 player has been deprecated and the playlist parameter doesn't appear to work with it.
You'll need to use the embedded AS3 player, which just requires you to add version=3
to the parameter list.
Example:
http://www.youtube.com/v/NKU6oOUho74?version=3&showsearch=0&version=3&enablejsapi=1&playerapiid=ytplayer&rel=0&fs=1&playlist=uDEQVgyNz88,AmKwF_Si734
Other tips:
Upvotes: 1