Class minplayer.players.base
Extends
minplayer.display.
The base media player class where all media players derive from.
Defined in: minplayer.players.base.js.
Constructor Attributes | Constructor Name and Description |
---|---|
minplayer.players.base(context, options, queue)
|
Field Attributes | Field Name and Description |
---|---|
Reset the constructor.
|
|
The currently loaded media file.
|
- Fields borrowed from class minplayer.display:
- onResize
- Fields borrowed from class minplayer.plugin:
- active, context, lock, name, options, pluginReady, queue, triggered
Method Attributes | Method Name and Description |
---|---|
Adds the media player.
|
|
<static> |
minplayer.players.base.canPlay(file)
Determine if we can play the media file.
|
clear()
Clears the media player.
|
|
create()
Creates the media player and inserts it in the DOM.
|
|
destroy()
|
|
getBytesLoaded(callback)
Return the bytes of media loaded.
|
|
getBytesStart(callback)
Return the start bytes for the loaded media.
|
|
getBytesTotal(callback)
Return the total amount of bytes.
|
|
getCurrentTime(callback)
Get the current time for the media being played.
|
|
getDuration(callback)
Return the duration of the loaded media.
|
|
<static> |
minplayer.players.base.getMediaId(file)
Returns the ID for the media being played.
|
Returns the media player object.
|
|
<static> |
minplayer.players.base.getPriority(file)
Get the priority of this media player.
|
getValue(getter, callback)
Gets a value from the player.
|
|
getVolume(callback)
Get the volume from the loaded media.
|
|
Determines if the player should show the controller.
|
|
hasPlayLoader(preview)
Determines if the player should show the playloader.
|
|
isReady()
|
|
load(file)
Loads a new media player.
|
|
Should be called when the media is complete.
|
|
onError(errorCode)
Called when an error occurs.
|
|
onLoaded()
Should be called when the media is done loading.
|
|
onPaused()
Should be called when the media is paused.
|
|
Should be called when the media is playing.
|
|
onReady()
Called when the player is ready to recieve events and commands.
|
|
Should be called when the player is waiting.
|
|
pause()
Pause the loaded media file.
|
|
play()
Play the loaded media file.
|
|
Returns if the media player is already within the DOM.
|
|
reset()
Resets all variables.
|
|
seek(pos)
Seek the loaded media.
|
|
seekRelative(pos)
Seeks to relative position.
|
|
setVolume(vol)
Set the volume of the loaded minplayer.
|
|
setVolumeRelative(vol)
Set the volume of the loaded minplayer.
|
|
stop()
Stop the loaded media file.
|
- Methods borrowed from class minplayer.display:
- fullscreen, fullScreenElement, getDisplay, getScaledRect, hide, isFullScreen, onFocus, toggleFullScreen
- Methods borrowed from class minplayer.plugin:
- addPlugin, bind, checkQueue, get, isValid, poll, ready, trigger, unbind
Class Detail
minplayer.players.base(context, options, queue)
- Parameters:
- {object} context
- The jQuery context.
- {object} options
- This components options.
- {object} queue
- The event queue to pass events around.
Field Detail
constructor
Reset the constructor.
mediaFile
The currently loaded media file.
Method Detail
addPlayer()
Adds the media player.
<static>
{boolean}
minplayer.players.base.canPlay(file)
Determine if we can play the media file.
- Parameters:
- {object} file
- A minplayer.file object.
- Returns:
- {boolean} If this player can play this media type.
clear()
Clears the media player.
construct()
- See:
- minplayer.plugin.construct
{object}
create()
Creates the media player and inserts it in the DOM.
- Returns:
- {object} The media player entity.
destroy()
- See:
- minplayer.plugin.destroy.
{int}
getBytesLoaded(callback)
Return the bytes of media loaded.
- Parameters:
- {function} callback
- Called when the bytes loaded is determined.
- Returns:
- {int} The amount of bytes loaded.
{int}
getBytesStart(callback)
Return the start bytes for the loaded media.
- Parameters:
- {function} callback
- Called when the start bytes is determined.
- Returns:
- {int} The bytes that were started.
{int}
getBytesTotal(callback)
Return the total amount of bytes.
- Parameters:
- {function} callback
- Called when the bytes total is determined.
- Returns:
- {int} The total amount of bytes for this media.
{number}
getCurrentTime(callback)
Get the current time for the media being played.
- Parameters:
- {function} callback
- Called when the time is determined.
- Returns:
- {number} The volume of the media; 0 to 1.
{number}
getDuration(callback)
Return the duration of the loaded media.
- Parameters:
- {function} callback
- Called when the duration is determined.
- Returns:
- {number} The duration of the loaded media.
{object}
getElements()
- Returns:
- {object} The elements for this display.
- See:
- minplayer.display.getElements
<static>
{string}
minplayer.players.base.getMediaId(file)
Returns the ID for the media being played.
- Parameters:
- {object} file
- A minplayer.file object.
- Returns:
- {string} The ID for the provided media.
{object}
getPlayer()
Returns the media player object.
- Returns:
- {object} The media player object.
<static>
{number}
minplayer.players.base.getPriority(file)
Get the priority of this media player.
- Parameters:
- {object} file
- A minplayer.file object.
- Returns:
- {number} The priority of this media player.
getValue(getter, callback)
Gets a value from the player.
- Parameters:
- {string} getter
- The getter method on the player.
- {function} callback
- The callback function.
{number}
getVolume(callback)
Get the volume from the loaded media.
- Parameters:
- {function} callback
- Called when the volume is determined.
- Returns:
- {number} The volume of the media; 0 to 1.
{bool}
hasController()
Determines if the player should show the controller.
- Returns:
- {bool} If this player implements its own controller.
{bool}
hasPlayLoader(preview)
Determines if the player should show the playloader.
- Parameters:
- {string} preview
- The preview image.
- Returns:
- {bool} If this player implements its own playLoader.
{boolean}
isReady()
- Returns:
- {boolean} Checks to see if the Flash is ready.
{boolean}
load(file)
Loads a new media player.
- Parameters:
- {object} file
- A minplayer.file object.
- Returns:
- {boolean} If this action was performed.
onComplete()
Should be called when the media is complete.
onError(errorCode)
Called when an error occurs.
- Parameters:
- {string} errorCode
- The error that was triggered.
onLoaded()
Should be called when the media is done loading.
onPaused()
Should be called when the media is paused.
onPlaying()
Should be called when the media is playing.
onReady()
Called when the player is ready to recieve events and commands.
onWaiting()
Should be called when the player is waiting.
{boolean}
pause()
Pause the loaded media file.
- Returns:
- {boolean} If this action was performed.
{boolean}
play()
Play the loaded media file.
- Returns:
- {boolean} If this action was performed.
{boolean}
playerFound()
Returns if the media player is already within the DOM.
- Returns:
- {boolean} TRUE - if the player is in the DOM, FALSE otherwise.
reset()
Resets all variables.
{boolean}
seek(pos)
Seek the loaded media.
- Parameters:
- {number} pos
- The position to seek the minplayer. 0 to 1.
- Returns:
- {boolean} If this action was performed.
seekRelative(pos)
Seeks to relative position.
- Parameters:
- {number} pos
- Relative position. -1 to 1 (percent), > 1 (seconds).
{boolean}
setVolume(vol)
Set the volume of the loaded minplayer.
- Parameters:
- {number} vol
- The volume to set the media. 0 to 1.
- Returns:
- {boolean} If this action was performed.
setVolumeRelative(vol)
Set the volume of the loaded minplayer.
- Parameters:
- {number} vol
- -1 to 1 - The relative amount to increase or decrease.
{boolean}
stop()
Stop the loaded media file.
- Returns:
- {boolean} If this action was performed.