jQuery YouTube playlist plugin

back to blog post

The html code for the following examples: (note that div.yt_holder is not required for the plugin and is used here simply to style the video area)

    <div class="yt_holder">
    <div id="ytvideo"></div>
    <ul class="demo1">
        <li><a href="http://www.youtube.com/watch?v=QBBWKvY-VDc">Video 1</a></li>
        <li><a href="http://www.youtube.com/watch?v=ZXMQqLnRhRI">Video 2</a></li>
        <li><a href="http://www.youtube.com/watch?v=Wvo-g_JvURI">Video 3</a></li>
    </ul>
            

javascript for the following example (basic setup, no options used)

    $("ul.demo1").ytplaylist();
            

javascript for the following example with autoplay off, thumbnails and a new holder id

    $("ul.demo2").ytplaylist({addThumbs:true, autoPlay: false, holderId: 'ytvideo2'});