title: Drupal 7.x and onYouTubePlayerReady
body: <p>I am attempting to hide a DIV once a embedded Youtube video is finished.  My platform is Drupal 7.x an I am using JQuery to show and hide the div.  I am having troubles getting the onYouTubePlayerReady function to fire which prevents all this from happening.  All files are on my webserver, I am not trying this locally as YouTube explains it does not work locally ( <a href="http://goo.gl/5qeKC" rel="nofollow">http://goo.gl/5qeKC</a> )</p>
  
  <p>My head section:</p>
  
  <pre><code>&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="http://dev.mydomain.com/mytheme/site/sites/all/themes/mytheme/js/hfbusiness.js?m4hr22"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>In the hfbusiness.js file I have the following (this file is loading and working as I can fire a javascript alert which displays):</p>
  
  <pre><code>function onYouTubePlayerReady(id) {
      console.log("onYouTubePlayerReady() Fired!");
      var player = $("#youtube_player").get(0);
    }
  </code></pre>
  
  <p>Index.php contains:</p>
  
  <pre><code>&lt;div class="marketing_video"&gt;
  &lt;iframe id="ytplayer" type="text/html" width="640" height="360" src="http://www.youtube.com/embed/hIaqCG8O5uU?version=3&amp;enablejsapi=1&amp;rel=0&amp;showinfo=0" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The video shows and plays without a problem with the defined options in the iframe.  However, the YouTubePlayerReady function is never fired.  I am beating my head against the wall on this, so far I have only accomplished a headache.  </p>
  
  <p>Thank you for any help.  </p>