youtube.js
No description.

File Location

/goog/ui/media/youtube.js

Classes

goog.ui.media.Youtube
Subclasses a goog.ui.media.MediaRenderer to provide a Youtube specific media renderer. This class knows how to parse youtube urls, and render the DOM structure of youtube video players and previews. This class is meant to be used as a singleton static stateless class, that takes goog.ui.media.Media instances and renders it. It expects goog.ui.media.Media.getModel to return a well formed, previously constructed, youtube video id, which is the data model this renderer will use to construct the DOM structure. for a example of constructing a control with this renderer. goog.ui.media.Youtube currently supports all goog.ui.Component.State. It will change its DOM structure between SELECTED and !SELECTED, and rely on CSS definitions on the others. On !SELECTED, the renderer will render a youtube static , with a thumbnail of the video. On SELECTED, the renderer will append to the DOM a flash object, that contains the youtube video. This design is patterned after http://go/closure_control_subclassing It uses goog.ui.media.FlashObject to embed the flash object.
goog.ui.media.YoutubeModel
The goog.ui.media.Youtube media data model. It stores a required videoId field, sets the youtube URL, and allows a few optional parameters.

Public Protected Private

Global Functions

goog.ui.media.YoutubeModel.buildUrl(videoId) string
The opposite of goog.ui.media.Youtube.newInstance: it takes a videoId and returns a youtube URL.
Arguments:
videoId : string
The youtube video ID.
Returns: string  The youtube URL.
code »
goog.ui.media.YoutubeModel.getFlashUrl(videoIdopt_autoplay) string
A static auxiliary method that builds URL of the flash movie to be embedded, out of the youtube video id.
Arguments:
videoId : string
The youtube video ID.
opt_autoplay : boolean=
Whether the flash movie should start playing as soon as it is shown, or if it should show a 'play' button.
Returns: string  The flash URL to be embedded on the page.
code »
goog.ui.media.Youtube.getInstance()
No description.
code »
goog.ui.media.YoutubeModel.getThumbnailUrl(youtubeId) string
A static auxiliary method that builds a static image URL with a preview of the youtube video. NOTE(user): patterned after Gmail's gadgets/youtube, TODO(user): how do I specify the width/height of the resulting image on the url ? is there an official API for http://ytimg.com ?
Arguments:
youtubeId : string
The youtube video ID.
Returns: string  An URL that contains an image with a preview of the youtube movie.
code »
goog.ui.media.Youtube.newControl(youtubeModelopt_domHelper) !goog.ui.media.Media
A static convenient method to construct a goog.ui.media.Media control out of a youtube model. It sets it as the data model goog.ui.media.Youtube renderer uses, sets the states supported by the renderer, and returns a Control that binds everything together. This is what you should be using for constructing Youtube videos, except if you need finer control over the configuration.
Arguments:
youtubeModel : goog.ui.media.YoutubeModel
The youtube data model.
opt_domHelper : goog.dom.DomHelper=
Optional DOM helper, used for document interaction.
Returns: !goog.ui.media.Media  A Control binded to the youtube renderer.
code »
goog.ui.media.YoutubeModel.newInstance(youtubeUrlopt_captionopt_description) !goog.ui.media.YoutubeModel
A auxiliary static method that parses a youtube URL, extracting the ID of the video, and builds a YoutubeModel.
Arguments:
youtubeUrl : string
A youtube URL.
opt_caption : string=
An optional caption of the youtube video.
opt_description : string=
An optional description of the youtube video.
Returns: !goog.ui.media.YoutubeModel  The data model that represents the youtube URL.
code »

Directory media

File Reference