The goog.ui.media.MediaModel Class

goog.ui.media.MediaModel(opt_url, opt_caption, opt_description, opt_type, opt_medium, opt_duration, opt_width, opt_height)

An base data value class for all media data models. MediaModels are exact matches to the fields defined in the Yahoo RSS media specification {@link 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 {@code null} values are allowed. {@code goog.ui.media.MediaRenderer} checks whether the values are available before creating DOMs for them. TODO(user): support asynchronous data models by subclassing {@link goog.events.EventTarget} or {@link goog.ds.DataNode}. Understand why {@link http://goto/datanode} is not available in closure. Add setters to MediaModel once this is supported.

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.

The goog.ui.media.MediaModel.Category Class

A taxonomy to be set that gives an indication of the type of media content, and its particular contents. … more

The goog.ui.media.MediaModel.Credit Class

Indicates an entity that has contributed to a media object. Based on 'media.credit' in the rss spec. … more

The goog.ui.media.MediaModel.Medium Enum

Supported mediums, found here: {@link http://video.search.yahoo.com/mrss} … more

The goog.ui.media.MediaModel.MimeType Enum

The supported media mime types, a subset of the media types found here: {@link http://www.iana.org/assignments/media-types/} and here {@link http://en.wikipedia.org/wiki/Internet_media_type} … more

The goog.ui.media.MediaModel.Player Class

Constructs a player containing details of the player's URL and optionally its size. … more

The goog.ui.media.MediaModel.SubTitle Class

A reference to the subtitle URI for a media object. Implements the 'media.subTitle' in the rss spec. … more

The goog.ui.media.MediaModel.Thumbnail Class

Constructs a thumbnail containing details of the thumbnail's image URL and optionally its size. … more

.findCategoryWithScheme(scheme)

Finds the first category with the given scheme.

scheme {string}
The scheme to search for.
returns {goog.ui.media.MediaModel.Category}
The category that has the given scheme. May be null.

.findCreditsWithRole(role)

Finds all credits with the given role.

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.

.getCaption()

Gets the caption of this media.

returns {string|undefined}
The caption of the media.

.getCategories()

Gets the categories of the media.

returns {Array.<goog.ui.media.MediaModel.Category>}
The categories of the media.

.getCredits()

Gets the credits of the media.

returns {!Array.<goog.ui.media.MediaModel.Credit>}
The credits of the media.

.getDescription()

Gets the description of this media.

returns {string|undefined}
The description of the media.

.getDuration()

Gets the duration of the media.

returns {number|undefined}
The duration in seconds.

.getHeight()

Gets the height of the media in pixels.

returns {number|undefined}
The height in pixels.

.getMedium()

Gets the media medium.

returns {goog.ui.media.MediaModel.Medium|undefined}
The media medium.

.getPlayer()

Gets the player data.

returns {goog.ui.media.MediaModel.Player|undefined}
The media player data.

.getSubTitles()

Gets the subtitles for the media.

returns {Array.<goog.ui.media.MediaModel.SubTitle>}
The subtitles.

.getThumbnails()

Gets the thumbnail urls.

returns {Array.<goog.ui.media.MediaModel.Thumbnail>}
The list of thumbnails.

.getType()

Gets the media mime type.

returns {goog.ui.media.MediaModel.MimeType|undefined}
The media mime type.

.getUrl()

Gets the URL of this media.

returns {string|undefined}
The URL of the media.

.getWidth()

Gets the width of the media in pixels.

returns {number|undefined}
The width in pixels.

.setCaption(caption)

Sets the caption of this media.

caption {string}
The caption of the media.
returns {!goog.ui.media.MediaModel}
The object itself, used for chaining.

.setCategories(categories)

Sets the categories of the media

categories {Array.<goog.ui.media.MediaModel.Category>}
The categories of the media.
returns {!goog.ui.media.MediaModel}
The object itself, used for chaining.

.setCredits(credits)

Sets the credits of the media

credits {!Array.<goog.ui.media.MediaModel.Credit>}
The credits of the media.
returns {!goog.ui.media.MediaModel}
The object itself, used for chaining.

.setDescription(description)

Sets the description of this media.

description {string}
The description of the media.
returns {!goog.ui.media.MediaModel}
The object itself, used for chaining.

.setDuration(duration)

Sets duration of the media.

duration {number}
The duration of the media, in seconds.
returns {!goog.ui.media.MediaModel}
The object itself, used for chaining.

.setHeight(height)

Sets the height of the media.

height {number}
The height of the media, in pixels.
returns {!goog.ui.media.MediaModel}
The object itself, used for chaining.

.setMedium(medium)

Sets the media medium.

medium {goog.ui.media.MediaModel.Medium}
The media medium.
returns {!goog.ui.media.MediaModel}
The object itself, used for chaining.

.setPlayer(player)

Sets the player data.

player {goog.ui.media.MediaModel.Player}
The media player data.
returns {!goog.ui.media.MediaModel}
The object itself, used for chaining.

.setSubTitles(subtitles)

Sets the subtitles for the media

subtitles {Array.<goog.ui.media.MediaModel.SubTitle>}
The subtitles.
returns {!goog.ui.media.MediaModel}
The object itself.

.setThumbnails(thumbnails)

Sets the thumbnail list.

thumbnails {Array.<goog.ui.media.MediaModel.Thumbnail>}
The list of thumbnail.
returns {!goog.ui.media.MediaModel}
The object itself, used for chaining.

.setType(type)

Sets the media mime type.

type {goog.ui.media.MediaModel.MimeType}
The media mime type.
returns {!goog.ui.media.MediaModel}
The object itself, used for chaining.

.setUrl(url)

Sets the URL of this media.

url {string}
The URL of the media.
returns {!goog.ui.media.MediaModel}
The object itself, used for chaining.

.setWidth(width)

Sets the width of the media.

width {number}
The width of the media, in pixels.
returns {!goog.ui.media.MediaModel}
The object itself, used for chaining.