The goog.ui.media.GoogleVideo Class

goog.ui.media.GoogleVideo
> goog.ui.media.MediaRenderer
> goog.ui.ControlRenderer

goog.ui.media.GoogleVideo()

Subclasses a goog.ui.media.MediaRenderer to provide a GoogleVideo specific media renderer. This class knows how to parse GoogleVideo URLs, and render the DOM structure of GoogleVideo video players. This class is meant to be used as a singleton static stateless class, that takes {@code goog.ui.media.Media} instances and renders it. It expects {@code goog.ui.media.Media.getModel} to return a well formed, previously constructed, GoogleVideo video id, which is the data model this renderer will use to construct the DOM structure. {@see goog.ui.media.GoogleVideo.newControl} for a example of constructing a control with this renderer. This design is patterned after http://go/closure_control_subclassing It uses {@link goog.ui.media.FlashObject} to embed the flash object.

.CSS_CLASS {string}

Default CSS class to be applied to the root element of components rendered by this renderer.

.canDecorate(element)

Inherited from goog.ui.ControlRenderer .

Returns true if this renderer can decorate the element, false otherwise. The default implementation always returns true.

element {Element}
Element to decorate.
returns {boolean}
Whether the renderer can decorate the element.

.createDom(c)

Creates the initial DOM structure of the GoogleVideo video, which is basically a the flash object pointing to a GoogleVideo video player.

c {goog.ui.Control}
The media control.
returns {Element}
The DOM structure that represents this control.
@suppress
{visibility} Calling protected control.setElementInternal().

.decorate(control, element)

Inherited from goog.ui.ControlRenderer .

Default implementation of {@code decorate} for {@link goog.ui.Control}s. Initializes the control's ID, content, and state based on the ID of the element, its child nodes, and its CSS classes, respectively. Returns the element.

control {goog.ui.Control}
Control instance to decorate the element.
element {Element}
Element to decorate.
returns {Element}
Decorated element.
@suppress
{visibility} setContentInternal and setStateInternal

.enableClassName(control, className, enable)

Inherited from goog.ui.ControlRenderer .

Updates the control's DOM by adding or removing the specified class name to/from its root element. May add additional combined classes as needed in IE6 and lower. Because of this, subclasses should use this method when modifying class names on the control's root element.

control {goog.ui.Control|Element}
Control instance (or root element) to be updated.
className {string}
CSS class name to add or remove.
enable {boolean}
Whether to add or remove the class name.

.enableExtraClassName(control, className, enable)

Inherited from goog.ui.ControlRenderer .

Updates the control's DOM by adding or removing the specified extra class name to/from its element.

control {goog.ui.Control}
Control to be updated.
className {string}
CSS class name to add or remove.
enable {boolean}
Whether to add or remove the class name.

.getAriaRole()

Inherited from goog.ui.ControlRenderer .

Returns the ARIA role to be applied to the control. See http://wiki/Main/ARIA for more info.

returns {goog.dom.a11y.Role|undefined}
ARIA role.

.getContentElement(element)

Inherited from goog.ui.ControlRenderer .

Takes the control's root element and returns the parent element of the control's contents. Since by default controls are rendered as a single DIV, the default implementation returns the element itself. Subclasses with more complex DOM structures must override this method as needed.

element {Element}
Root element of the control whose content element is to be returned.
returns {Element}
The control's content element.

.getCssClass()

Returns the CSS class to be applied to the root element of components rendered using this renderer.

returns {string}
Renderer-specific CSS class.

.getIe6ClassCombinations()

Inherited from goog.ui.ControlRenderer .

Returns an array of combinations of classes to apply combined class names for in IE6 and below. See {@link IE6_CLASS_COMBINATIONS} for more detail. This method doesn't reference {@link IE6_CLASS_COMBINATIONS} so that it can be compiled out, but subclasses should return their IE6_CLASS_COMBINATIONS static constant instead.

returns {Array.<Array.<string>>}
Array of class name combinations.

.getKeyEventTarget(control)

Inherited from goog.ui.ControlRenderer .

Returns the element within the component's DOM that should receive keyboard focus (null if none). The default implementation returns the control's root element.

control {goog.ui.Control}
Control whose key event target is to be returned.
returns {Element}
The key event target.

.getStructuralCssClass()

Inherited from goog.ui.ControlRenderer .

Returns the name of a DOM structure-specific CSS class to be applied to the root element of all components rendered or decorated using this renderer. Unlike the class name returned by {@link #getCssClass}, the structural class name may be shared among different renderers that generate similar DOM structures. The structural class name also serves as the basis of derived class names used to identify and style structural elements of the control's DOM, as well as the basis for state-specific class names. The default implementation returns the same class name as {@link #getCssClass}, but subclasses are expected to override this method as needed.

returns {string}
DOM structure-specific CSS class name (same as the renderer- specific CSS class name by default).

.initializeDom(control)

Inherited from goog.ui.ControlRenderer .

Initializes the control's DOM by configuring properties that can only be set after the DOM has entered the document. This implementation sets up BiDi and keyboard focus. Called from {@link goog.ui.Control#enterDocument}.

control {goog.ui.Control}
Control whose DOM is to be initialized as it enters the document.

.isFocusable(control)

Inherited from goog.ui.ControlRenderer .

Returns true if the control's key event target supports keyboard focus (based on its {@code tabIndex} attribute), false otherwise.

control {goog.ui.Control}
Control whose key event target is to be checked.
returns {boolean}
Whether the control's key event target is focusable.

.newControl(dataModel, opt_domHelper)

A static convenient method to construct a goog.ui.media.Media control out of a GoogleVideo model. It sets it as the data model goog.ui.media.GoogleVideo 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 GoogleVideo videos, except if you need finer control over the configuration.

dataModel {goog.ui.media.GoogleVideoModel}
The GoogleVideo data model.
opt_domHelper {goog.dom.DomHelper=}
Optional DOM helper, used for document interaction.
returns {goog.ui.media.Media}
A Control binded to the GoogleVideo renderer.

.setAllowTextSelection(element, allow)

Inherited from goog.ui.ControlRenderer .

Allows or disallows text selection within the control's DOM.

element {Element}
The control's root element.
allow {boolean}
Whether the element should allow text selection.

.setAriaRole(element, opt_preferredRole)

Inherited from goog.ui.ControlRenderer .

Sets the element's ARIA role.

element {Element}
Element to update.
opt_preferredRole {?goog.dom.a11y.Role=}
The preferred ARIA role.

.setAriaStates(control, element)

Inherited from goog.ui.ControlRenderer .

Sets the element's ARIA states. An element does not need an ARIA role in order to have an ARIA state. Only states which are initialized to be true will be set.

control {!goog.ui.Control}
Control whose ARIA state will be updated.
element {!Element}
Element whose ARIA state is to be updated.

.setContent(element, content)

Inherited from goog.ui.ControlRenderer .

Takes a control's root element, and sets its content to the given text caption or DOM structure. The default implementation replaces the children of the given element. Renderers that create more complex DOM structures must override this method accordingly.

element {Element}
The control's root element.
content {goog.ui.ControlContent}
Text caption or DOM structure to be set as the control's content. The DOM nodes will not be cloned, they will only moved under the content element of the control.

.setFocusable(control, focusable)

Inherited from goog.ui.ControlRenderer .

Updates the control's key event target to make it focusable or non-focusable via its {@code tabIndex} attribute. Does nothing if the control doesn't support the {@code FOCUSED} state, or if it has no key event target.

control {goog.ui.Control}
Control whose key event target is to be updated.
focusable {boolean}
Whether to enable keyboard focus support on the control's key event target.

.setRightToLeft(element, rightToLeft)

Inherited from goog.ui.ControlRenderer .

Applies special styling to/from the control's element if it is rendered right-to-left, and removes it if it is rendered left-to-right.

element {Element}
The control's root element.
rightToLeft {boolean}
Whether the component is rendered right-to-left.

.setState(control, state, enable)

Inherited from goog.ui.ControlRenderer .

Updates the appearance of the control in response to a state change.

control {goog.ui.Control}
Control instance to update.
state {goog.ui.Component.State}
State to enable or disable.
enable {boolean}
Whether the control is entering or exiting the state.

.setVisible(element, visible)

Inherited from goog.ui.ControlRenderer .

Shows or hides the element.

element {Element}
Element to update.
visible {boolean}
Whether to show the element.