Get this jQuery Youtube Playlist working? Drupal 7.  I'm trying to get this to work - seems simple enough.  I added the .js file through my theme's .info file, and it's picking that up.  I selected "Full HTML" as the format for my block, and pasted the code in (both the js and the ul).  Just doesn't work.

http://www.geckonewmedia.com/blog/2009/8/14/jquery-youtube-playlist-plugin---youtubeplaylist

Any ideas?  I suspect the js needs to be loaded somewhere else, that maybe it's being stripped out from the block code?



Per SoftArtisans (thanks) this is now what I have in the Body of my custom block (set to full HTML):

    &lt;script type="text/ecmascript"&gt;

(function ($) {
  $("ul.aintv").ytplaylist({addThumbs:true, autoPlay: false, holderId: 'ytvideo'});
}(jQuery));
       
&lt;/script&gt;


&lt;div class="yt_holder"&gt;

&lt;div id="ytvideo"&gt;&lt;/div&gt;

  &lt;ul class="aintv"&gt;
    &lt;li&gt;&lt;a href="http://www.youtube.com/watch?v=QBBWKvY-VDc"&gt;Video 1&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.youtube.com/watch?v=ZXMQqLnRhRI"&gt;Video 2&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.youtube.com/watch?v=Wvo-g_JvURI"&gt;Video 3&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;


It's still not working.  I verified the other .js file is being picked up in the source.
In Drupal, you can't just call jQuery quite like that. The reason is mostly because there my be other JavaScript libraries in use so jQuery is not aliased as $() in Drupal. For more details on that you can view the Drupal Docs about JavaScript compatibility, or the specific issue in the queue.

The solution is to wrap your jQuery code as described in the Drupal docs page linked to above. In your case it would look something like this...

(function ($) {
  $("ul.demo1").ytplaylist();
})(jQuery);