Class media.players.base
Extends
media.display.
The base media player class where all media players derive from.
Defined in: drupal.media.players.base.js.
Constructor Attributes | Constructor Name and Description |
---|---|
media.players.base(context, options, mediaFile)
|
Field Attributes | Field Name and Description |
---|---|
The currently loaded media file.
|
Method Attributes | Method Name and Description |
---|---|
<static> |
media.players.base.canPlay(file)
Determine if we can play the media file.
|
create()
Creates the media player and inserts it in the DOM.
|
|
destroy()
Destroy the media player instance from the DOM.
|
|
Return the duration of the loaded media.
|
|
Returns the media player object.
|
|
<static> |
media.players.base.getPriority()
Get the priority of this media player.
|
Get the volume from the loaded media.
|
|
load(file)
Loads a new media player.
|
|
pause()
Pause the loaded media file.
|
|
play()
Play the loaded media file.
|
|
Returns if the media player is already within the DOM.
|
|
seek(pos)
Seek the loaded media.
|
|
setVolume(vol)
Set the volume of the loaded media.
|
|
stop()
Stop the loaded media file.
|
|
trigger(type, data)
Trigger a media event.
|
- Methods borrowed from class media.display:
- getElements, isValid
- Methods borrowed from class media.plugin:
- setPlayer
Class Detail
media.players.base(context, options, mediaFile)
- Parameters:
- {object} context
- The jQuery context.
- {object} options
- This components options.
- mediaFile
Field Detail
mediaFile
The currently loaded media file.
Method Detail
<static>
media.players.base.canPlay(file)
Determine if we can play the media file.
- Parameters:
- {object} file
- A media.file object.
construct()
- See:
- media.plugin.construct
{object}
create()
Creates the media player and inserts it in the DOM.
- Returns:
- {object} The media player entity.
destroy()
Destroy the media player instance from the DOM.
{number}
getDuration()
Return the duration of the loaded media.
- Returns:
- {number} The duration of the loaded media.
{object}
getPlayer()
Returns the media player object.
- Returns:
- {object} The media player object.
<static>
{number}
media.players.base.getPriority()
Get the priority of this media player.
- Returns:
- {number} The priority of this media player.
{number}
getVolume()
Get the volume from the loaded media.
- Returns:
- {number} The volume of the media; 0 to 1.
load(file)
Loads a new media player.
- Parameters:
- {object} file
- A media.file object.
pause()
Pause the loaded media file.
play()
Play the loaded media file.
{boolean}
playerFound()
Returns if the media player is already within the DOM.
- Returns:
- {boolean} TRUE - if the player is in the DOM, FALSE otherwise.
seek(pos)
Seek the loaded media.
- Parameters:
- {number} pos
- The position to seek the media. 0 to 1.
setVolume(vol)
Set the volume of the loaded media.
- Parameters:
- {number} vol
- The volume to set the media. 0 to 1.
stop()
Stop the loaded media file.
trigger(type, data)
Trigger a media event.
- Parameters:
- {string} type
- The event type.
- {object} data
- The event data object.