A light-weight, barebones YouTube plugin for jQuery 1.3+.

Download it here.

View a Demo

Why use SimpleTube?

  • Easy implementation to display playlists, search queries and single videos.
  • Generates clean, basic HTML for the thumbnails and player. Thumbnails are just a basic set of divs.
  • Written in jQuery plugin format and can be chained with other jQuery commands.
  • Generates W3C valid XHTML and adds no JS global variables & passes JSLint.
  • Released under theĀ MIT License.

Tested In: Chrome, Firefox 3+, Safari 3+, Internet Explorer 6+.

Instructions

The simpletube method takes a key/value object.

Format:

$('selector').simpletube({key:value, key:value, key:value});

Example:

$('#videoholder').simpletube({displaytype: 'single', feedid: 'xOfe1nwSCZU'});

Example:

$('#videoholder').simpletube({displaytype: 'playlist',
feedid: '7A970084B73399A8', activeclass: 'selectedclip'});

Parameters

Key Default Descriptions
feedid “LieNielsen” Feed url/video ID. This is the only required parameter
maxresults 10 Number of results to show. 0 for no limit.
defaultvideo ‘none’ Sets the default video to display initially when more than one video is in the playlist. Uses the YouTube video id parameter.
displaytype ‘single’ Controls the display type. Can be set to “playlist”, “single”, or “user”
activeclass ‘active’ Sets the CSS class applied to the thumbnail div when it is the current video playing.
videowidth 450 Width of the displayed video.
videoheight 356 Height of the displayed video.
showthumbnails true Show or hide the playlist thumbnails.
showdescription false Show or hide the video description.
related false Show or hide related videos that appears after the video completes playing.
thumbpos “after” Arrange the thumbnails “before” or “after” the video display area.

Upcoming Features

  • Add templating system to allow for greater control over the generated HTML
  • Add options for specifying the CSS classes applied to the thumbnails when active or inactive
  • Add support for non-jQuery SWFObject display