jQuery Google Search Videobar Reference

A jQuery plugin that sets a division to show a Google Search Videobar. If you find this plugin useful please vote for it on the jQuery site.

This page provides a documentation reference for working with the plugin v1.0.2. See a demonstration of the Google Search Videobar plugin and download the code from there.

For more detail on the Google Search Videobar functionality, see the Google API documentation.

Instance Settings

A separate GSVideobar instance is created for each targetted division and has its own settings:

$('divs').gsvideobar({...});

closeText | cycleMode | cycleTime | horizontal | manyResults | master | player | search | statusArea | thumbnailSize

NameTypeDefaultComments
horizontalbooleantrue Controls the orientation of the videobar, being horizontal (true) or vertical (false).
thumbnailSizeenumeratedthis.thumbnailsMedium Control the sizing of the video thumbnails. Use either $.gsvideobar.thumbnailsSmall or $.gsvideobar.thumbnailsMedium.
playerstring, object, element'' The jQuery selector, jQuery object, or individual element for the video player area (typically a division). If more than one element is selected, only the first is used. Leave as blank to create a floating video player that appears close to the selected video.
masterstring, object, element'' The jQuery selector, jQuery object, or individual element for the master videobar for which this videobar is the slave. The latter shares the video player area of the former. If more than one element is selected, only the first is used.
closeTextstring'' The text displayed at the top of the video player area to allow stopping of the current video. If left at blank it defaults to 'i'm done watching this'.
searchstring or string[]'jquery' The single term to search for, or a list of terms to cycle through, or a combination of the specialised YouTube search terms: one of ytMostViewed, ytRecentlyFeatured, or ytTopRated with one of ytToday, ytThisWeek, ytThisMonth, or ytAllTime.
manyResultsbooleanfalse Control how many results are returned, being few (false) or many (true).
cycleTimeenumeratedthis.cycleMedium Specify the interval between cycles when multiple search terms are provided. Use one of $.gsvideobar.cycleVShort (3 seconds), $.gsvideobar.cycleShort (10 seconds), $.gsvideobar.cycleMedium (15 seconds), or $.gsvideobar.cycleLong (30 seconds).
cycleModeenumeratedthis.cycleRandom Specify the order in which search terms are used when multiple are provided. Use either $.gsvideobar.cycleRandom or $.gsvideobar.cycleLinear.
statusAreastring, object, element'' The jQuery selector, jQuery object, or individual element for the status area for the videobar. This area shows the list of search terms specified, indicates which one is currently being shown, and allows the user to select another one immediately. If more than one element is selected, only the first is used.

Constants

NameComments
cycleVShort, cycleShort, cycleMedium, cycleLong Possible values for the cycleTime setting.
cycleRandom, cycleLinear Possible values for the cycleMode setting.
thumbnailsSmall, thumbNailsMedium Possible values for the thumbnailSize setting.
ytMostViewed, ytRecentlyFeatured, ytTopRated Possible values for the search setting.
ytToday, ytThisWeek, ytThisMonth, ytAllTime Possible additional values for the search setting when appended to the values above.

Functions

SignatureReturnsComments
$.gsvideobar.setDefaults(settings)GSVideobar object Update the default instance settings to use with all GSVideobar instances.
$.gsvideobar.youTube(channel)string Create a search term for a YouTube channel.
channel (string) is the channel to find.
$(div).gsvideobar('change', settings)jQuery object Update the settings for the GSVideobar instance(s) attached to the given div(s).
$(div).gsvideobar('destroy')jQuery object Remove the GSVideobar functionality from the given div(s).
$(div).gsvideobar('search', terms)jQuery object Execute a new search for the GSVideobar.
terms (string) the keywords to search for.

Contact Keith Wood at kbwood{at}iinet.com.au with comments or suggestions.


Valid HTML 4.01 Strict