ui.media.MediaModel Extends
An base data value class for all media data models. MediaModels are exact matches to the fields defined in the Yahoo RSS media specification http://search.yahoo.com/mrss/. The current common data shared by medias is to have URLs, mime types, captions, descriptions, thumbnails and players. Some of these may not be available, or applications may not want to render them, so null values are allowed. goog.ui.media.MediaRenderer checks whether the values are available before creating DOMs for them. TODO(user): support asynchronous data models by subclassing goog.events.EventTarget or goog.ds.DataNode. Understand why http://goto/datanode is not available in closure. Add setters to MediaModel once this is supported.

Inheritance

Constructor

goog.ui.media.MediaModel(opt_urlopt_captionopt_descriptionopt_typeopt_mediumopt_durationopt_widthopt_height)

Parameters

opt_url : string=
An optional URL of the media.
opt_caption : string=
An optional caption of the media.
opt_description : string=
An optional description of the media.
opt_type : goog.ui.media.MediaModel.MimeType=
The type of the media.
opt_medium : goog.ui.media.MediaModel.Medium=
The medium of the media.
opt_duration : number=
The duration of the media in seconds.
opt_width : number=
The width of the media in pixels.
opt_height : number=
The height of the media in pixels.

Instance Methods

Public Protected Private
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

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 »

Enumerations

goog.ui.media.MediaModel.Medium :
Supported mediums, found here: http://video.search.yahoo.com/mrss
Constants:
AUDIO
No description.
DOCUMENT
No description.
EXECUTABLE
No description.
IMAGE
No description.
VIDEO
No description.
Code »
goog.ui.media.MediaModel.MimeType :
The supported media mime types, a subset of the media types found here: http://www.iana.org/assignments/media-types/ and here http://en.wikipedia.org/wiki/Internet_media_type
Constants:
FLASH
No description.
GIF
No description.
HTML
No description.
JPEG
No description.
PLAIN
No description.
PNG
No description.
Code »

Package ui.media

Package Reference