Class minplayer.player
Extends
minplayer.display.
The core media player class which governs the media player
functionality.
Usage:
// Create a media player.
var player = jQuery("#player").minplayer({
});
Defined in: minplayer.player.js.
Constructor Attributes | Constructor Name and Description |
---|---|
minplayer.player(context, options)
|
Field Attributes | Field Name and Description |
---|---|
Reset the constructor.
|
|
Variable to store the current media player.
|
Method Attributes | Method Name and Description |
---|---|
Adds key events to the player.
|
|
error(error)
Sets an error on the player.
|
|
getDuration(callback)
Get the current media duration.
|
|
getFiles()
Returns all the media files available for this player.
|
|
getMediaFile(files)
Returns the full media player object.
|
|
getVolume(callback)
Get the current volume setting.
|
|
load(files)
Load a set of files or a single file for the media player.
|
|
pause()
Pause the media.
|
|
play()
Play the currently loaded media file.
|
|
resize()
Called when the player is resized.
|
|
seek(pos)
Seek the media to the provided position.
|
|
setVolume(vol)
Set the volume of the media being played.
|
|
stop()
Stop the media.
|
- Methods borrowed from class minplayer.display:
- bind, getElements, getScaledRect, isValid, onResize, trigger
- Methods borrowed from class minplayer.plugin:
- addPlugin, destroy, eachPlugin, getPlugin, loadPlugins, setPlayer
Class Detail
minplayer.player(context, options)
- Parameters:
- {object} context
- The jQuery context.
- {object} options
- This components options.
Field Detail
constructor
Reset the constructor.
currentPlayer
Variable to store the current media player.
Method Detail
addKeyEvents()
Adds key events to the player.
construct()
- See:
- minplayer.plugin.construct
error(error)
Sets an error on the player.
- Parameters:
- {string} error
- The error to display on the player.
{number}
getDuration(callback)
Get the current media duration.
- Parameters:
- {function} callback
- The callback that is called when the duration is known.
- Returns:
- {number} The current media duration.
{array}
getFiles()
Returns all the media files available for this player.
- Returns:
- {array} All the media files for this player.
{object}
getMediaFile(files)
Returns the full media player object.
- Parameters:
- {array} files
- An array of files to chose from.
- Returns:
- {object} The best media file to play in the current browser.
{number}
getVolume(callback)
Get the current volume setting.
- Parameters:
- {function} callback
- The callback that is called when the volume is known.
- Returns:
- {number} The current volume level. 0 to 1.
load(files)
Load a set of files or a single file for the media player.
- Parameters:
- {array} files
- An array of files to chose from to load.
pause()
Pause the media.
play()
Play the currently loaded media file. Use load first to load a
media file into the media player.
resize()
Called when the player is resized.
seek(pos)
Seek the media to the provided position.
- Parameters:
- {number} pos
- The position to seek. 0 to 1.
setVolume(vol)
Set the volume of the media being played.
- Parameters:
- {number} vol
- The volume to set. 0 to 1.
stop()
Stop the media.