title: Embedding YouTube Playlist using SWFObject.embedSWF()
body: <p>I'm trying to use YouTube's JavaScript API to embed a playlist to my Facebook app.</p>
  
  <p>I tried using the standard code as shown by Google <a href="http://code.google.com/apis/ajax/playground/?exp=youtube#simple_embed" rel="nofollow"><strong><em>here</em></strong></a> to embed a simple video and it worked.</p>
  
  <p>The code is:</p>
  
  <pre><code>    function loadPlayer() {
          // The video to load
          var videoID = "[My Video ID]";
          // Lets Flash from another domain call JavaScript
          var params = { allowScriptAccess: "always" };
          // The element id of the Flash embed
          var atts = { id: "ytPlayer" };
          // All of the magic handled by SWFObject (http://code.google.com/p/swfobject/)
          swfobject.embedSWF("http://www.youtube.com/v/" + videoID + 
                             "?fs=1&amp;version=3&amp;enablejsapi=1&amp;playerapiid=player1", 
                             "videoDiv", "420", "315", "9", null, null, params, atts);
        }
  </code></pre>
  
  <p>But how do I use the YouTube API to <strong>embed a Playlist</strong>?</p>
  
  <p>I'm aware of the <strong>playlist parameter</strong> on the embedSWF URL parameter, but what it does is <strong>append</strong> videos as to make a playlist on the fly.</p>
  
  <p>I already have a playlist on my YouTube account, now I want to embed it using the API.</p>
  
  <p>How can this be done? </p>
  
  <p>Thanks!</p>