title: YouTube API — not firing 'onYouTubePlayerReady()'
body: <p>From what I've read, this is how I should setup the <a href="http://en.wikipedia.org/wiki/YouTube" rel="noreferrer">YouTube</a> API:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
    &lt;head&gt;
      &lt;meta content='text/html;charset=UTF-8' http-equiv='content-type' /&gt;
      &lt;title&gt;Youtube Player&lt;/title&gt;
      &lt;script src="jquery.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" charset="utf-8"&gt;
        function onYouTubePlayerReady(id) {
          console.log("onYouTubePlayerReady() Fired!");
          var player = $("#youtube_player").get(0);
        }
  
        var params = { allowScriptAccess: "always" };
        var atts = { id: "youtube_player" };
        swfobject.embedSWF("http://www.youtube.com/apiplayer?enablejsapi=1", 
                           "youtube", "425", "356", "8", null, null, params, atts);
  
      &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;div id="youtube"&gt;&lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>However, 'onYouTubePlayerReady()' doesn't fire at all, and if I manually get a reference to the player, a lot of methods are undefined; for example, cueVideoById() works, but playVideo() doesn't.</p>
  
  <p>How can I fix this problem?</p>