ui.media.YoutubeModel Extends goog.ui.media.MediaModel
The goog.ui.media.Youtube media data model. It stores a required videoId field, sets the youtube URL, and allows a few optional parameters.

Inheritance

Constructor

goog.ui.media.YoutubeModel(videoIdopt_captionopt_description)

Parameters

videoId : string
The youtube video id.
opt_caption : string=
An optional caption of the youtube video.
opt_description : string=
An optional description of the youtube video.

Instance Methods

Public Protected Private
getVideoId() string
Gets the Youtube video id.
Returns: string  The Youtube video id.
code »
findCategoryWithScheme(scheme) goog.ui.media.MediaModel.Category
Finds the first category with the given scheme.
Arguments:
scheme : string
The scheme to search for.
Returns: goog.ui.media.MediaModel.Category  The category that has the given scheme. May be null.
code »
findCreditsWithRole(role) !Array.<!goog.ui.media.MediaModel.Credit>
Finds all credits with the given role.
Arguments:
role : string
The role to search for.
Returns: !Array.<!goog.ui.media.MediaModel.Credit>  An array of credits with the given role. May be empty.
code »
getCaption() string | undefined
Gets the caption of this media.
Returns: string | undefined  The caption of the media.
code »
Gets the categories of the media.
Returns: Array.<goog.ui.media.MediaModel.Category>  The categories of the media.
code »
Gets the credits of the media.
Returns: !Array.<goog.ui.media.MediaModel.Credit>  The credits of the media.
code »
getDescription() string | undefined
Gets the description of this media.
Returns: string | undefined  The description of the media.
code »
getDuration() number | undefined
Gets the duration of the media.
Returns: number | undefined  The duration in seconds.
code »
getHeight() number | undefined
Gets the height of the media in pixels.
Returns: number | undefined  The height in pixels.
code »
getMedium() goog.ui.media.MediaModel.Medium | undefined
Gets the media medium.
Returns: goog.ui.media.MediaModel.Medium | undefined  The media medium.
code »
getPlayer() goog.ui.media.MediaModel.Player | undefined
Gets the player data.
Returns: goog.ui.media.MediaModel.Player | undefined  The media player data.
code »
Gets the subtitles for the media.
Returns: Array.<goog.ui.media.MediaModel.SubTitle>  The subtitles.
code »
Gets the thumbnail urls.
Returns: Array.<goog.ui.media.MediaModel.Thumbnail>  The list of thumbnails.
code »
getType() goog.ui.media.MediaModel.MimeType | undefined
Gets the media mime type.
Returns: goog.ui.media.MediaModel.MimeType | undefined  The media mime type.
code »
getUrl() string | undefined
Gets the URL of this media.
Returns: string | undefined  The URL of the media.
code »
getWidth() number | undefined
Gets the width of the media in pixels.
Returns: number | undefined  The width in pixels.
code »
setCaption(caption) !goog.ui.media.MediaModel
Sets the caption of this media.
Arguments:
caption : string
The caption of the media.
Returns: !goog.ui.media.MediaModel  The object itself, used for chaining.
code »
setCategories(categories) !goog.ui.media.MediaModel
Sets the categories of the media
Arguments:
categories : Array.<goog.ui.media.MediaModel.Category>
The categories of the media.
Returns: !goog.ui.media.MediaModel  The object itself, used for chaining.
code »
setCredits(credits) !goog.ui.media.MediaModel
Sets the credits of the media
Arguments:
credits : !Array.<goog.ui.media.MediaModel.Credit>
The credits of the media.
Returns: !goog.ui.media.MediaModel  The object itself, used for chaining.
code »
setDescription(description) !goog.ui.media.MediaModel
Sets the description of this media.
Arguments:
description : string
The description of the media.
Returns: !goog.ui.media.MediaModel  The object itself, used for chaining.
code »
setDuration(duration) !goog.ui.media.MediaModel
Sets duration of the media.
Arguments:
duration : number
The duration of the media, in seconds.
Returns: !goog.ui.media.MediaModel  The object itself, used for chaining.
code »
setHeight(height) !goog.ui.media.MediaModel
Sets the height of the media.
Arguments:
height : number
The height of the media, in pixels.
Returns: !goog.ui.media.MediaModel  The object itself, used for chaining.
code »
setMedium(medium) !goog.ui.media.MediaModel
Sets the media medium.
Arguments:
medium : goog.ui.media.MediaModel.Medium
The media medium.
Returns: !goog.ui.media.MediaModel  The object itself, used for chaining.
code »
setPlayer(player) !goog.ui.media.MediaModel
Sets the player data.
Arguments:
player : goog.ui.media.MediaModel.Player
The media player data.
Returns: !goog.ui.media.MediaModel  The object itself, used for chaining.
code »
setSubTitles(subtitles) !goog.ui.media.MediaModel
Sets the subtitles for the media
Arguments:
subtitles : Array.<goog.ui.media.MediaModel.SubTitle>
The subtitles.
Returns: !goog.ui.media.MediaModel  The object itself.
code »
setThumbnails(thumbnails) !goog.ui.media.MediaModel
Sets the thumbnail list.
Arguments:
thumbnails : Array.<goog.ui.media.MediaModel.Thumbnail>
The list of thumbnail.
Returns: !goog.ui.media.MediaModel  The object itself, used for chaining.
code »
setType(type) !goog.ui.media.MediaModel
Sets the media mime type.
Arguments:
type : goog.ui.media.MediaModel.MimeType
The media mime type.
Returns: !goog.ui.media.MediaModel  The object itself, used for chaining.
code »
setUrl(url) !goog.ui.media.MediaModel
Sets the URL of this media.
Arguments:
url : string
The URL of the media.
Returns: !goog.ui.media.MediaModel  The object itself, used for chaining.
code »
setWidth(width) !goog.ui.media.MediaModel
Sets the width of the media.
Arguments:
width : number
The width of the media, in pixels.
Returns: !goog.ui.media.MediaModel  The object itself, used for chaining.
code »

Instance Properties

constructor :
No description.
Code »
videoId_ :
The Youtube video id.
Code »
caption_ :
The caption of the media.
Code »
categories_ :
The list of categories that are applied to this media.
Code »
credits_ :
The list of credits that pertain to this media object.
Code »
description_ :
A description of the media, typically user generated comments about it.
Code »
duration_ :
The duration of the media in seconds.
Code »
height_ :
The height of the media in pixels.
Code »
medium_ :
The medium of the media.
Code »
The media player.
Code »
subTitles_ :
The list of subtitles for the media object.
Code »
thumbnails_ :
A list of thumbnails representations of the media (eg different sizes of the same photo, etc).
Code »
type_ :
The mime type of the media.
Code »
url_ :
The URL of the media.
Code »
width_ :
The width of the media in pixels.
Code »

Static Methods

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.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.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 »

Static Properties

goog.ui.media.YoutubeModel.MATCHER_ :
A youtube regular expression matcher. It matches the VIDEOID of URLs like http://www.youtube.com/watch?v=VIDEOID. Based on: googledata/contentonebox/opencob/specs/common/YTPublicExtractorCard.xml
Code »
goog.ui.media.YoutubeModel.superClass_ :
No description.
Code »

Package ui.media

Package Reference