Google TV

Google TV jQuery UI Lib Reference (1.0)

This is the API reference for the Google TV jQuery UI Library. The library provides keyboard navigation, custom controls, and ready-to-use pages.

  1. Keyboard Navigation
  2. Controls
  3. Pages
  4. Get the Code
  5. API Reference

Library Overview

Keyboard Navigation

This library includes a keyboard navigation controller class (KeyController) that is used by all of the controls in the library. This key controller provides a unified means for navigating around a site using a keyboard and mouse. It provides separation of control between different sections of the screen and can manage multiple 'layers' (such as popups, full screen displays, etc) independently of each other.

Controls

The library also includes a number of controls that are intended to provide a starting point for a 10-foot UI. These controls all support keyboard navigation. They include:

  • RowControl - A scrolling, horizontal list of items on the page. See a demo.
  • SideNavControl - A menu presenting a list of choices in a horizontal or vertical orientation. Can be statically displayed, pop-out from a side, or fade in. See a demo.
  • SlidingControl - A paging display of rows of items. Pages of items slide in from the right/left as the user navigates. See a demo.
  • PhotoControl - A photo slideshow display with Play, Pause, Next, and Back buttons. Supports media keys. See a demo.
  • VideoControl - A video playback control with Play, Pause, Next and back buttons. Supports media keys. See a demo.
  • RollerControl - A multi-row 'roller' that vertically animates scrolling rows into focus as the user navigates. See a demo.
  • RotatorControl - A single row that rotates in each item from a list into view as the user navigates up/down. See a demo.
  • StackControl - Provides a central display for a single items and 'stacks' items to the left and right, rotating in each item as the user navigates left/right through the stack. See a demo.

Pages

Finally, the library provides two full-page displays for quick-starts

  • BuilderPhotoPage - Constructs a page with a photo slide show and a scrolling thumbnail display, given a URL to a JSON-compatible feed of photos. See a demo.
  • BuilderVideoPage - Constructs a page with a YouTube video player and a scrolling thumbnail display, given a URL to a YouTube feed. See a demo.

Get the Code

The library code can be found at: http://code.google.com/p/gtv-ui-lib

Library Reference

Table of Contents

Class gtv.jq.BuildParams

Field Summary

Array.<string> feedContentSeeker
Array of names, in hierarchical order starting from the entry, used to locate the photo URL.
Array.<string> feedItemsSeeker
Array of names, in hierarchical order, used to locate the array of entries in the feed.
Array.<string> feedThumbSeeker
Array of names, in hierarchical order starting from the entry, used to locate thumbnail URL.
gtv.jq.KeyController keyController
The key controller the page should use.
Array.<string> layerNames
Array of layer names the page should exist on.
string navbarType
The type of SideNav to use, one of 'popUp' or 'fade'.
gtv.jq.Size size
Size of the player in pixels.
number slideshowSpeed
Delay, in seconds, between photos.
number thumbnailHeight
Height in pixels of the thumbnails.
 

Constructor Summary

gtv.jq.BuildParams()
BuildParams class holds parameters used to create the page.
 

Field Detail

feedContentSeeker

Array.<string> feedContentSeeker
    Array of names, in hierarchical order starting from the entry, used to locate the photo URL.

feedItemsSeeker

Array.<string> feedItemsSeeker
    Array of names, in hierarchical order, used to locate the array of entries in the feed.

feedThumbSeeker

Array.<string> feedThumbSeeker
    Array of names, in hierarchical order starting from the entry, used to locate thumbnail URL.

keyController

gtv.jq.KeyController keyController
    The key controller the page should use.

layerNames

Array.<string> layerNames
    Array of layer names the page should exist on. If not supplied, uses the default layer.

navbarType

string navbarType
    The type of SideNav to use, one of 'popUp' or 'fade'.

size

gtv.jq.Size size
    Size of the player in pixels. Width defaults to 1024. If not supplied, height it calculated from the player width assuming a 16:10 ratio.

slideshowSpeed

number slideshowSpeed
    Delay, in seconds, between photos. Defaults to 4.

thumbnailHeight

number thumbnailHeight
    Height in pixels of the thumbnails.

Constructor Detail

gtv.jq.BuildParams

gtv.jq.BuildParams()
    BuildParams class holds parameters used to create the page.

Back to top

Class gtv.jq.BuilderPhotoPage

Constructor Summary

gtv.jq.BuilderPhotoPage(buildParams)
BuilderPhotoPage class.
 

Method Summary

deletePage()
Removes the page's controls from the window.
makePage(topParent)
Creates a photo playback page.
 

Constructor Detail

gtv.jq.BuilderPhotoPage

gtv.jq.BuilderPhotoPage(buildParams)
    BuilderPhotoPage class. This creates a complete page for viewing a slideshow of photos. Provided with an RSS feed in JSONP format and references to the thumbnails and full-size images in that feed, this will build a photo control to display a full-size image, a row of thumbnails to display all the images in the feed, and the key zones to handle movement between them.
    Parameters:
      gtv.jq.BuildParams buildParams - Initialization values for the photo page.

Method Detail

deletePage

deletePage()
    Removes the page's controls from the window.

makePage

makePage(topParent)
    Creates a photo playback page.
    Parameters:
      jQuery.Element topParent - The parent element for the page.

Back to top

Class gtv.jq.BuilderVideoPage

Constructor Summary

gtv.jq.BuilderVideoPage(buildParams)
BuilderVideoPage class.
 

Method Summary

deletePage()
Removes the page's controls from the window.
makePage(topParent)
Creates a photo playback page.
 

Constructor Detail

gtv.jq.BuilderVideoPage

gtv.jq.BuilderVideoPage(buildParams)
    BuilderVideoPage class. This creates a complete page for viewing a slideshow of videos. Provided with an RSS feed in JSONP format and references to the thumbnails and YouTube videos in that feed, this will build a video control to play the video, a row of thumbnails to display the video thumbnails in the feed, and the key zones to handle movement between them.
    Parameters:
      gtv.jq.BuildParams buildParams

Method Detail

deletePage

deletePage()
    Removes the page's controls from the window.

makePage

makePage(topParent)
    Creates a photo playback page.
    Parameters:
      jQuery.Element topParent - The parent element for the page.

Back to top

Class gtv.jq.CaptionItem

Field Summary

jQuery.Element caption
The caption for the item, to be displayed beneath it.
object data
If supplied, this item will be given an active hover style by the key controller when selected.
jQuery.Element item
The item that will be outlined by selection.
 

Constructor Summary

gtv.jq.CaptionItem()
Describes an item that has a caption and a data item to go with it.
 

Field Detail

caption

jQuery.Element caption
    The caption for the item, to be displayed beneath it. The container of this caption will be styled so that it will be clipped at the width of the item.

data

object data
    If supplied, this item will be given an active hover style by the key controller when selected. This allows items with data to be visually distinguished from those without. For example, an item that can be navigated to when chosen might have this value non-null; and item that cannot will have it null. The two different selection styles applied (styles.selected, styles.hasData) provide a visual clue to the user.

item

jQuery.Element item
    The item that will be outlined by selection. This will be the child of the element with the CSS class styles.item.

Constructor Detail

gtv.jq.CaptionItem

gtv.jq.CaptionItem()
    Describes an item that has a caption and a data item to go with it. Not all controls support CaptionItem (StackControl, SlidingControl). Use this instead of a simple items array when an item that needs selection (say, a thumbnail) also needs a caption (say, photo title) but the selection outline should only be drawn around the item.

Back to top

Class gtv.jq.ControlContents

Field Summary

Array.<gtv.jq.CaptionItem> captionItems
Simple array of items to add to the control.
Array.<gtv.jq.ControlContents> contentsArray
Array of ControlContents objects to add to a control.
Array.<jQuery.Element> items
Simple array of items to add to the control.
 

Constructor Summary

gtv.jq.ControlContents(opt_params)
Describes the contents to be added to a control.
 

Field Detail

captionItems

Array.<gtv.jq.CaptionItem> captionItems
    Simple array of items to add to the control. These items will be added to the control in the order they appear in the array. Each item is added as a child of a separate Element to contain it. These container elements are created by the control and given the Styles.item CSS class.

contentsArray

Array.<gtv.jq.ControlContents> contentsArray
    Array of ControlContents objects to add to a control. Some multi-row controls (such as the RollerControl) require this so that each row can be described explicitly. That is, each row has a very specific contents instead of being created as-needed and filled in. Since this is an array of ControlContents objects, each element is can in turn be a simple array of items or an itemsGenerator. (It could also take an itemsArray, but no existing controls take an array of arrays of arrays.)

items

Array.<jQuery.Element> items
    Simple array of items to add to the control. These items will be added to the control in the order they appear in the array. Each item is added as a child of a separate Element to contain it. These container elements are created by the control and given the Styles.item CSS class.

Constructor Detail

gtv.jq.ControlContents

gtv.jq.ControlContents(opt_params)
    Describes the contents to be added to a control. Passed with ShowParams object, used when calling showControl on a control object. items, itemsArray and itemsGenerator, indicate how new items will be added to the control being displayed. Only one of these should be supplied in an instance of the object.
    Parameters:
      gtv.jq.ControlContents opt_params - Optional initialization values.

Back to top

Class gtv.jq.CreationParams

Field Summary

Function(selectedItem) choiceCallback
Callback to make when the user chooses an item (if applicable to the control)
string containerId
The ID of the control container (an element will be created with this ID).
KeyController keyController
Instance of the key controller this control is using.
string layerNames
Array of Layer name to add the control to, or 'default' if not supplied.
Object styles
CSS classes used to style the row.
 

Constructor Summary

gtv.jq.CreationParams(opt_params)
Holds parameters used to create the library controls.
 

Field Detail

choiceCallback

Function(selectedItem) choiceCallback
    Callback to make when the user chooses an item (if applicable to the control)

containerId

string containerId
    The ID of the control container (an element will be created with this ID).

keyController

KeyController keyController
    Instance of the key controller this control is using.

layerNames

string layerNames
    Array of Layer name to add the control to, or 'default' if not supplied.

styles

Object styles
    CSS classes used to style the row. page {string} CSS class to style the container for each page of rows. row {string} CSS class to style the row. itemsDiv {string} CSS class to style the DIV holding the items. itemDiv {string} CSS class to style the DIV holding a single item. item {string} CSS class to style the individual item. selected {string} CSS class to style the item that has the selection. hasData {string} CSS class to style the item that has the selection, for controls that support different selection styles based on associated data (see gtv.jq.CaptionItem). normal {string} For controls that maintain a sticky item choice, such as SideNav. CSS class to style an item that has been 'chosen', that is, the ENTER key was pressed while it had selection, or it received a mouse click. chosen {string} For controls that maintain a sticky item choice, such as SideNav. CSS class to style an item that has been 'chosen', that is, the ENTER key was pressed while it had selection, or it received a mouse click.

Constructor Detail

gtv.jq.CreationParams

gtv.jq.CreationParams(opt_params)
    Holds parameters used to create the library controls.
    Parameters:
      ?gtv.jq.CreationParams opt_params - CreationParams to initialize this new object with.

Back to top

Class gtv.jq.KeyActions

Field Summary

Function(item) click
Called when the user clicks the mouse button on an item.
Function() enterZone
Called when a zone is entered.
Function(selectedItem) leaveZone
Called when a zone is exited.
Function(selectedItem, newSelected) moveSelected
Called after the selection has moved to a new item in the zone.
Function(newZone, newSelected, syncCallback) scrollIntoView
Called every time an item in the zone receives the selection.
 

Constructor Summary

gtv.jq.KeyActions()
KeyActions class.
 

Field Detail

click

Function(item) click
    Called when the user clicks the mouse button on an item.

enterZone

Function() enterZone
    Called when a zone is entered. This is called in descending order from a parent to child zones. Optionally returns a the item to be selected after the zone is entered. This is only honored if the zone is at the end of the parent-child heirarchy.

leaveZone

Function(selectedItem) leaveZone
    Called when a zone is exited. This is called in ascending order from child to parent zones.

moveSelected

Function(selectedItem, newSelected) moveSelected
    Called after the selection has moved to a new item in the zone.

scrollIntoView

Function(newZone, newSelected, syncCallback) scrollIntoView
    Called every time an item in the zone receives the selection. This method must determine if the selected item is in view and, if it is, position it such that it is completely visible on the page. If the item is already visible, for performance reasons it is best to do nothing and return immediately.

Constructor Detail

gtv.jq.KeyActions

gtv.jq.KeyActions()
    KeyActions class. Provides the key controller zone with a set of callbacks to make when certain events happen in the key controller.

Back to top

Class gtv.jq.KeyBehaviorZone

Constructor Summary

gtv.jq.KeyBehaviorZone(createParams)
KeyBehaviorZone class.
 

Constructor Detail

gtv.jq.KeyBehaviorZone

gtv.jq.KeyBehaviorZone(createParams)
    KeyBehaviorZone class. Defines a zone of key navigation rules.
    Parameters:
      gtv.jq.KeyZoneCreationParams createParams - Initialization data for the new zone.

Back to top

Class gtv.jq.KeyController

Constructor Summary

gtv.jq.KeyController()
KeyController class.
 

Method Summary

addBehaviorZone(zone, opt_selectOnInit, opt_layerNames)
Adds a new zone to a layer in the key controller.
 KeyZoneLayer_ createLayer(layerName, priority)
Creates a layer of the specified name and priority.
 boolean deleteLayer(layerName)
Deletes the named layer.
removeAllLayers()
Removes all layers from the Key Controller.
 Array.<KeyBehaviorZone> removeAllZones(opt_layerName)
Removes all zones from a layer and returns the zones.
removeBehaviorZone(zone)
Removes a zone from the key controller.
setGlobalKeyMapping(keyMapping)
Sets a key mapping for the global key controller.
setLayer(opt_layerName)
Makes the specified layer the active one, and moves selection to the first zone in that layer.
setLayerKeyMapping(keyMapping, opt_layerName)
Sets a key mapping for specified layer.
setSelected(newSelected, finishedCallback)
Sets the specified item as the selected item.
 boolean setZone(newZone, opt_force)
Moves the selection to the specified zone only if there is not already a zone with selection.
setZones(zones, opt_selectOnInit, opt_layerNames)
Installs an array of zones into a layer.
 boolean start(initialZone, opt_selectOnInit, opt_layerName)
Starts the Key Controller.
stop()
Stops all key controller activity.
 

Constructor Detail

gtv.jq.KeyController

gtv.jq.KeyController()
    KeyController class. Manages navigation for a page.

Method Detail

addBehaviorZone

addBehaviorZone(zone, opt_selectOnInit, opt_layerNames)
    Adds a new zone to a layer in the key controller.
    Parameters:
      KeyBehaviorZone zone - The zone to add.
      ?boolean opt_selectOnInit - If true, the zone will receive the selection if no other zone in the controller has the selection.
      ?Array.<string> opt_layerNames - The names of the layers to add the zone to. If not supplied, the default layer is used.

createLayer

KeyZoneLayer_ createLayer(layerName, priority)
    Creates a layer of the specified name and priority. If priority isn't needed, callers can instead rely on the implicit layer creation when adding a zone.
    Parameters:
      string layerName - The name of the layer.
      ?number priority - Priority of the layer (presently unused).
    Returns:
      KeyZoneLayer_  The newly created layer.

deleteLayer

boolean deleteLayer(layerName)
    Deletes the named layer. If the layer is the currently active one, the default layer is selected as a replacement and selection is moved to the first zone.
    Parameters:
      string layerName - The name of the layer to delete.
    Returns:
      boolean  False if the layer doesn't exist or the caller is trying to delete the default layer. True otherwise.

removeAllLayers

removeAllLayers()
    Removes all layers from the Key Controller.

removeAllZones

Array.<KeyBehaviorZone> removeAllZones(opt_layerName)
    Removes all zones from a layer and returns the zones. Selection is moved to the next zone (thus activating a new layer), if available.
    Parameters:
      ?string opt_layerName - The layer to remove the zones from. If not supplied, uses the default layer.
    Returns:
      Array.<KeyBehaviorZone>  Array of zones removed.

removeBehaviorZone

removeBehaviorZone(zone)
    Removes a zone from the key controller. If the active zone is removed, selection is moved to the next zone.
    Parameters:
      KeyBehaviorZone zone - The zone to remove.

setGlobalKeyMapping

setGlobalKeyMapping(keyMapping)
    Sets a key mapping for the global key controller.
    Parameters:
      KeyMap keyMapping - The key mapping to install.

setLayer

setLayer(opt_layerName)
    Makes the specified layer the active one, and moves selection to the first zone in that layer.
    Parameters:
      ?string opt_layerName - The name of the layer to active. If not, supplied activates the default layer.

setLayerKeyMapping

setLayerKeyMapping(keyMapping, opt_layerName)
    Sets a key mapping for specified layer.
    Parameters:
      KeyMap keyMapping - The key mapping to install in the layer.
      ?string opt_layerName - The name of the layer to install the mapping. If not supplied, the default layer is used.

setSelected

setSelected(newSelected, finishedCallback)
    Sets the specified item as the selected item. The item can be in any zone.
    Parameters:
      jQuery.Element newSelected - The item to move selection to.
      Function finishedCallback - The function to call when any movement animations have completed.

setZone

boolean setZone(newZone, opt_force)
    Moves the selection to the specified zone only if there is not already a zone with selection.
    Parameters:
      KeyBehaviorZone newZone - The zone to move selection to.
      boolean opt_force - Set the zone even if there is already an active zone.
    Returns:
      boolean  True if selection moved, false otherwise.

setZones

setZones(zones, opt_selectOnInit, opt_layerNames)
    Installs an array of zones into a layer. Replaces any existing zones.
    Parameters:
      Array.<KeyBehaviorZone> zones - Array of zones to add.
      ?boolean opt_selectOnInit - If true, selects the first zone.
      ?Array.<string> opt_layerNames - The layer to install the zones into. If not supplied, uses the default layer.

start

boolean start(initialZone, opt_selectOnInit, opt_layerName)
    Starts the Key Controller. Zones can be added to the controller both before and after it is started.
    Parameters:
      ?KeyBehaviorZone initialZone - Optional initial zone to select. If not supplied, the first zone is selected.
      ?boolean opt_selectOnInit - If supplied, initialZone will be selected.
      ?string opt_layerName - If supplied, the specified layer will be the active layer. If both an initialZone and opt_layerName are supplied, the layer of initialZone will be active layer, and this value will be ignored.
    Returns:
      boolean  True if the controller starts successfully.

stop

stop()
    Stops all key controller activity. Unbinds event handlers and removes all layers.

Back to top

Class gtv.jq.KeyMapping

Field Summary

object keyCallback
Key mapping callbacks should be numbered by keycode, for example, passing: var keyMapping = { 13: enterCallback }; will cause the function 'enterCallback' to be called when the ENTER key is pressed.
 

Constructor Summary

gtv.jq.KeyMapping()
KeyMapping class.
 

Field Detail

keyCallback

object keyCallback
    Key mapping callbacks should be numbered by keycode, for example, passing: var keyMapping = { 13: enterCallback }; will cause the function 'enterCallback' to be called when the ENTER key is pressed.

Constructor Detail

gtv.jq.KeyMapping

gtv.jq.KeyMapping()
    KeyMapping class. Holds key mappings to be called by the key controller when a key event is received. Each entry should be numbered by the keycode (e.g., ENTER = 13) paired with a callback.

Back to top

Class gtv.jq.KeyNavSelectors

Field Summary

string item
The jQuery selector to use to determine if an element is an item, that is, a navigable element on the page.
string itemPage
The jQuery selector to use to determine if an element represents a page of itemRows or itemParents.
string itemParent
The jQuery selector to use to determine if an element is the immediate container of an 'item'
string itemRow
The jQuery selector to use to determine if an element is the parent of an item parent.
 

Constructor Summary

gtv.jq.KeyNavSelectors()
KeyNavSelectors class.
 

Field Detail

item

string item
    The jQuery selector to use to determine if an element is an item, that is, a navigable element on the page.

itemPage

string itemPage
    The jQuery selector to use to determine if an element represents a page of itemRows or itemParents. Used to segment items to support paging.

itemParent

string itemParent
    The jQuery selector to use to determine if an element is the immediate container of an 'item'

itemRow

string itemRow
    The jQuery selector to use to determine if an element is the parent of an item parent. All itemParent children of a row are navigated horizontally, that is, with the left/right arrows. Rows themselves are navigated vertically (up/down arrows).

Constructor Detail

gtv.jq.KeyNavSelectors

gtv.jq.KeyNavSelectors()
    KeyNavSelectors class.

Back to top

Class gtv.jq.KeySelectionCssClasses

Field Summary

string basic
Used to highlight items that do not meet the criteria for any other selection class.
string hasData
Used to highlight items that have a jQuery.data() value for the zone's navigableData string.
 

Constructor Summary

gtv.jq.KeySelectionCssClasses()
KeySelectionCssClasses class.
 

Field Detail

basic

string basic
    Used to highlight items that do not meet the criteria for any other selection class. At present, this means that if an item does not have a jQuery.data() value for zone's navigableData string, this class will be used to highlight.

hasData

string hasData
    Used to highlight items that have a jQuery.data() value for the zone's navigableData string. That is, if navigableData is 'destUrl', then any element where element.data('destUrl') != undefined will be highlighted with this CSS class.

Constructor Detail

gtv.jq.KeySelectionCssClasses

gtv.jq.KeySelectionCssClasses()
    KeySelectionCssClasses class. A collection of CSS classes for highlighting selected items of various states

Back to top

Class gtv.jq.KeyZoneCreationParams

Field Summary

gtv.jq.KeyActions actions
Callbacks for supported Key Controller actions.
string containerSelector
jQuery selector that uniquely identifies the containing zone on the page.
gtv.jq.KeyMapping keyMapping
Mapping of key code numbers to callback methods.
string navigableData
Optional string that, if found in the element's jQuery.data(), will cause the item to be highlighted with the hasData selection class.
gtv.jq.KeyNavSelectors navSelectors
A collection of jQuery selectors for non-geometry key navigation.
boolean saveRowPosition
If true, a multi-row zone will save the selected item for each row, and return selection to that item when selection returns to that row.
boolean selectHidden
If true, the key controller will move the selection to a non-visible element on the page.
gtv.jq.KeySelectionCssClasses selectionClasses
CSS classes to determine how to highlight a particular selected item.
boolean useGeometry
If true, the key controller determines the next selected item by examining the page and finding the closest item in the direction the user has navigated.
 

Constructor Summary

gtv.jq.KeyZoneCreationParams()
KeyZoneCreationParams class.
 

Field Detail

actions

gtv.jq.KeyActions actions
    Callbacks for supported Key Controller actions.

containerSelector

string containerSelector
    jQuery selector that uniquely identifies the containing zone on the page.

keyMapping

gtv.jq.KeyMapping keyMapping
    Mapping of key code numbers to callback methods.

navigableData

string navigableData
    Optional string that, if found in the element's jQuery.data(), will cause the item to be highlighted with the hasData selection class.

navSelectors

gtv.jq.KeyNavSelectors navSelectors
    A collection of jQuery selectors for non-geometry key navigation.

saveRowPosition

boolean saveRowPosition
    If true, a multi-row zone will save the selected item for each row, and return selection to that item when selection returns to that row.

selectHidden

boolean selectHidden
    If true, the key controller will move the selection to a non-visible element on the page. (The zone would likely supply a scrollIntoView callback that made the item visible when selected.)

selectionClasses

gtv.jq.KeySelectionCssClasses selectionClasses
    CSS classes to determine how to highlight a particular selected item.

useGeometry

boolean useGeometry
    If true, the key controller determines the next selected item by examining the page and finding the closest item in the direction the user has navigated.

Constructor Detail

gtv.jq.KeyZoneCreationParams

gtv.jq.KeyZoneCreationParams()
    KeyZoneCreationParams class. Holds params used to initialize a new KeyBehaviorZone.

Back to top

Class gtv.jq.PhotoControl

Constructor Summary

gtv.jq.PhotoControl(photoParams)
PhotoControl class.
 

Method Summary

deleteControl()
Removes the photo control from its container and removes its key zone from the key controller.
loadPhoto(url)
Loads the specified photo and, once loaded, fades out any currently displayed photo and fades in the new photo.
pause()
Pauses the slideshow.
play()
Starts playing the slideshow.
playPause()
Toggles the playing state of the slideshow.
showControl(showParams)
Creates a new PhotoControl with the specified buttons and adds it to a container on the page.
 

Constructor Detail

gtv.jq.PhotoControl

gtv.jq.PhotoControl(photoParams)
    PhotoControl class. The Photo control plays back photos from a feed, either in slideshow mode or manual control. The user can select the photo to view from a thumbnail on a row control.
    Parameters:
      gtv.jq.PhotoParams photoParams - Creation params for the control.

Method Detail

deleteControl

deleteControl()
    Removes the photo control from its container and removes its key zone from the key controller.

loadPhoto

loadPhoto(url)
    Loads the specified photo and, once loaded, fades out any currently displayed photo and fades in the new photo.
    Parameters:
      string url - Url of the photo to display.

pause

pause()
    Pauses the slideshow.

play

play()
    Starts playing the slideshow.

playPause

playPause()
    Toggles the playing state of the slideshow.

showControl

showControl(showParams)
    Creates a new PhotoControl with the specified buttons and adds it to a container on the page.
    Parameters:
      gtv.jq.ShowParams showParams - Params for creating the control.

Back to top

Class gtv.jq.PhotoParams

Constructor Summary

gtv.jq.PhotoParams(opt_params)
PhotoParams class.
 

Constructor Detail

gtv.jq.PhotoParams

gtv.jq.PhotoParams(opt_params)
    PhotoParams class. Holds values for initialized a PhotoControl
    Parameters:
      opt_params

Back to top

Class gtv.jq.PlayerButtons

Constructor Summary

gtv.jq.PlayerButtons(opt_initial)
PlayerButtons describes the buttons used for playback control.
 

Constructor Detail

gtv.jq.PlayerButtons

gtv.jq.PlayerButtons(opt_initial)
    PlayerButtons describes the buttons used for playback control.
    Parameters:
      gtv.jq.PlayerButtons opt_initial - Optional initial values.

Back to top

Class gtv.jq.PlayerCallbacks

Constructor Summary

gtv.jq.PlayerCallbacks(opt_initial)
PlayerCallbacks class holds set of callbacks implemented by client.
 

Constructor Detail

gtv.jq.PlayerCallbacks

gtv.jq.PlayerCallbacks(opt_initial)
    PlayerCallbacks class holds set of callbacks implemented by client.
    Parameters:
      gtv.jq.PlayerCallbacks opt_initial - Optional initial values.

Back to top

Class gtv.jq.RollerControl

Constructor Summary

gtv.jq.RollerControl(rollerParams)
RollerControl class.
 

Method Summary

deleteControl()
Removes a roller control from its container and disables key control.
enableNavigation()
Call this to enables key controller navigation for the control.
showControl(showParams)
Creates a new RollerControl with the specified itms and adds it to a container on the page.
 

Constructor Detail

gtv.jq.RollerControl

gtv.jq.RollerControl(rollerParams)
    RollerControl class. RollerControl displays a vertial stack of RowControls and 'rolls' them up/down as the user scrolls between the rows.
    Parameters:
      RollerParams rollerParams - Values to initialize the control with.

Method Detail

deleteControl

deleteControl()
    Removes a roller control from its container and disables key control.

enableNavigation

enableNavigation()
    Call this to enables key controller navigation for the control. Key navigation must be explicitly enabled for the roller control.

showControl

showControl(showParams)
    Creates a new RollerControl with the specified itms and adds it to a container on the page.
    Parameters:
      gtv.jq.ShowParams showParams - Parameters for creating the control.

Back to top

Class gtv.jq.RollerParams

Constructor Summary

gtv.jq.RollerParams(opt_params)
RollerParams class contains roller-control specific creation params.
 

Constructor Detail

gtv.jq.RollerParams

gtv.jq.RollerParams(opt_params)
    RollerParams class contains roller-control specific creation params.
    Parameters:
      gtv.jq.RollerParams opt_params - Optional initial values.

Back to top

Class gtv.jq.RotatorControl

Constructor Summary

gtv.jq.RotatorControl(createParams)
RotatorControl class.
 

Method Summary

deleteControl()
Removes the control from its container and from the key controller.
 boolean showControl(showParams)
Creates a new RotatorControl with the specified items and adds it to a container on the page.
 

Constructor Detail

gtv.jq.RotatorControl

gtv.jq.RotatorControl(createParams)
    RotatorControl class. Rotator control displays a single item of a list at a time, rotating new items into view when user presses up/down.
    Parameters:
      gtv.jq.CreationParams createParams

Method Detail

deleteControl

deleteControl()
    Removes the control from its container and from the key controller.

showControl

boolean showControl(showParams)
    Creates a new RotatorControl with the specified items and adds it to a container on the page.
    Parameters:
      gtv.jq.ShowParams showParams - Params for creating the control.
    Returns:
      boolean  true on success

Back to top

Class gtv.jq.RowControl

Constructor Summary

gtv.jq.RowControl(createParams)
Creates a new RowControl object.
 

Method Summary

deleteControl()
Removes a row control from its container and disables key control.
enableNavigation()
Enables key controller navigation for the control.
showControl(showParams)
Creates a new RowControl with the specified items and adds it to a container on the page.
 

Constructor Detail

gtv.jq.RowControl

gtv.jq.RowControl(createParams)
    Creates a new RowControl object.
    Parameters:
      CreationParams createParams - Configuration params for the control.

Method Detail

deleteControl

deleteControl()
    Removes a row control from its container and disables key control.

enableNavigation

enableNavigation()
    Enables key controller navigation for the control.

showControl

showControl(showParams)
    Creates a new RowControl with the specified items and adds it to a container on the page. The container will trigger a 'load' event when the contents have finished loading.
    Parameters:
      gtv.jq.ShowParams showParams - Parameters for creating the control.

Back to top

Class gtv.jq.ShowParams

Field Summary

gtv.jq.ControlContents contents
The contents the control should have.
jQuery.Element topParent
Parent element on the page that holds the control.
 

Constructor Summary

gtv.jq.ShowParams(opt_params)
Holds parameters used to show the library controls.
 

Field Detail

contents

gtv.jq.ControlContents contents
    The contents the control should have. See gtv.jq.ControlContents for details.

topParent

jQuery.Element topParent
    Parent element on the page that holds the control.

Constructor Detail

gtv.jq.ShowParams

gtv.jq.ShowParams(opt_params)
    Holds parameters used to show the library controls.
    Parameters:
      ?gtv.jq.ShowParams opt_params - Optional parameters to initialize the new object with.

Back to top

Class gtv.jq.SideNavBehaviors

Constructor Summary

gtv.jq.SideNavBehaviors(opt_behaviors)
SideNavBehaviors configures the behaviors for a SideNav control.
 

Constructor Detail

gtv.jq.SideNavBehaviors

gtv.jq.SideNavBehaviors(opt_behaviors)
    SideNavBehaviors configures the behaviors for a SideNav control.
    Parameters:
      gtv.jq.SideNavBehaviors opt_behaviors - Optional initial values.

Back to top

Class gtv.jq.SideNavControl

Constructor Summary

gtv.jq.SideNavControl(sidenavParams)
SideNavControl class.
 

Method Summary

deleteControl()
Removes the control from its container and its key control zone.
selectControl()
Moves selection to the SideNav Control.
setBehaviors(behaviors, force)
Applies a new set of behaviors to the control.
showControl(showParams)
Creates a new SideNavControl with the specified items and adds it to a container_ on the page.
 

Constructor Detail

gtv.jq.SideNavControl

gtv.jq.SideNavControl(sidenavParams)
    SideNavControl class. SideNav control is a pop-out or fade-in menu control that can manage selection or contain other controls.
    Parameters:
      gtv.jq.SideNavParams sidenavParams

Method Detail

deleteControl

deleteControl()
    Removes the control from its container and its key control zone.

selectControl

selectControl()
    Moves selection to the SideNav Control.

setBehaviors

setBehaviors(behaviors, force)
    Applies a new set of behaviors to the control.
    Parameters:
      Object behaviors - New behaviors to apply to the control.
      boolean force - Set the new behaviors even if identical.

showControl

showControl(showParams)
    Creates a new SideNavControl with the specified items and adds it to a container_ on the page.
    Parameters:
      gtv.jq.ShowParams showParams - Params for creating the control.

Back to top

Class gtv.jq.SideNavParams

Field Summary

SideNavBehaviors behaviors
Behaviors for the SideNav control.
CreationParams createParams
CreationParams for the SideNav control.
 

Constructor Summary

gtv.jq.SideNavParams(opt_params)
SideNavParams class holds configuration values specific to SideNav.
 

Field Detail

behaviors

SideNavBehaviors behaviors
    Behaviors for the SideNav control.

createParams

CreationParams createParams
    CreationParams for the SideNav control.

Constructor Detail

gtv.jq.SideNavParams

gtv.jq.SideNavParams(opt_params)
    SideNavParams class holds configuration values specific to SideNav.
    Parameters:
      gtv.jq.SideNavParams opt_params - Optional initialization values.

Back to top

Class gtv.jq.Size

Constructor Summary

gtv.jq.Size(width, height)
Size class holds a width/height dimension pair.
 

Constructor Detail

gtv.jq.Size

gtv.jq.Size(width, height)
    Size class holds a width/height dimension pair.
    Parameters:
      number width
      number height

Back to top

Class gtv.jq.SlidingControl

Constructor Summary

gtv.jq.SlidingControl(createParams)
SlidingControl class.
 

Method Summary

deleteControl()
Removes the control from its container and from the key controller.
showControl(controlParams)
Creates a new SideNavControl with the specified items and adds it to a container on the page.
 

Constructor Detail

gtv.jq.SlidingControl

gtv.jq.SlidingControl(createParams)
    SlidingControl class. Creates a series of sliding "pages", left-right, that hold thumbnails/content in a rectangular arrangement.
    Parameters:
      gtv.jq.CreationParams createParams - Initial values for creation of the control.

Method Detail

deleteControl

deleteControl()
    Removes the control from its container and from the key controller.

showControl

showControl(controlParams)
    Creates a new SideNavControl with the specified items and adds it to a container on the page.
    Parameters:
      gtv.jq.ShowParams controlParams - Params for creating the control. ControlContents.captionItems must be passed to this control.

Back to top

Class gtv.jq.StackControl

Constructor Summary

gtv.jq.StackControl(stackParams)
StackControl class.
 

Method Summary

deleteControl()
Removes the control from its container and from the key controller.
showControl(showParams)
Creates a new StackControl with the specified items and adds it to a container on the page.
 

Constructor Detail

gtv.jq.StackControl

gtv.jq.StackControl(stackParams)
    StackControl class. This control arranges individual items, rotated at 90 degrees, with just a label showing, at the right side of a page and, through key navigation, moves the items to the center of the page (off of the "stack") and into the middle, and then to a new stack on the left of the page (again, rotated with only the label showing). This can be useful in presenting items on a widescreen display without taking up vertical real estate for navigation controls, while visually focusing on the item in the middle of the page.
    Parameters:
      StackParams stackParams - Parameters for initializing the control.

Method Detail

deleteControl

deleteControl()
    Removes the control from its container and from the key controller.

showControl

showControl(showParams)
    Creates a new StackControl with the specified items and adds it to a container on the page.
    Parameters:
      gtv.jq.ShowParams showParams - Params for showing the control. Requires captionItems passed in the controlContents. The caption will become the title of the item.

Back to top

Class gtv.jq.StackParams

Constructor Summary

gtv.jq.StackParams(opt_params)
StackParams class holds creation params for the StackControl.
 

Constructor Detail

gtv.jq.StackParams

gtv.jq.StackParams(opt_params)
    StackParams class holds creation params for the StackControl.
    Parameters:
      gtv.jq.StackParams opt_params - Optional initialization values.

Back to top

Class gtv.jq.VideoControl

Constructor Summary

gtv.jq.VideoControl(videoParams)
VideoControl class.
 

Method Summary

deleteControl()
Removes a video control from its container, unregisters its player, and removes its key control zone.
loadVideo(videoId)
Loads the video with the specified video id.
pause()
Pauses the current video.
play()
Starts playing the current video.
playPause()
Toggles the play/pause state of a video.
showControl(showParams)
Creates a new VideoControl with the specified buttons and adds it to a container on the page.
 

Constructor Detail

gtv.jq.VideoControl

gtv.jq.VideoControl(videoParams)
    VideoControl class. The Video control plays back YouTube videos from a feed, automatically playing each video in turn, allowing the user to skip videos or select a different video from a row control showing video thumbnails.
    Parameters:
      gtv.jq.VideoParams videoParams - Creation values for the control.

Method Detail

deleteControl

deleteControl()
    Removes a video control from its container, unregisters its player, and removes its key control zone.

loadVideo

loadVideo(videoId)
    Loads the video with the specified video id.
    Parameters:
      string videoId - The ID of the YouTube video to play.

pause

pause()
    Pauses the current video. Makes a callback to callbacks.pause, if supplied, which returns true if it wishes to prevent the video from pausing.

play

play()
    Starts playing the current video. Makes a callback to callbacks.play, if supplied, which returns true if it wishes to prevent the video from playing.

playPause

playPause()
    Toggles the play/pause state of a video.

showControl

showControl(showParams)
    Creates a new VideoControl with the specified buttons and adds it to a container on the page.
    Parameters:
      gtv.jq.ShowParams showParams - Params for creating the control.

Back to top

Class gtv.jq.VideoParams

Constructor Summary

gtv.jq.VideoParams(opt_params)
VideoParams class.
 

Constructor Detail

gtv.jq.VideoParams

gtv.jq.VideoParams(opt_params)
    VideoParams class. Holds values for initialized a VideoControl
    Parameters:
      gtv.jq.VideoParams opt_params - Optional initial values.

Back to top

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.