Class Index | File Index

Classes


Class minplayer.players.base


Extends minplayer.display.
The base media player class where all media players derive from.
Defined in: minplayer.players.base.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
minplayer.players.base(context, options, queue)
Field Summary
Field Attributes Field Name and Description
 
Reset the constructor.
 
The currently loaded media file.
 
The ready queue for this player.
Fields borrowed from class minplayer.display:
onResize
Fields borrowed from class minplayer.plugin:
active, context, lock, name, pluginReady, queue, triggered, uuid
Method Summary
Method Attributes Method Name and Description
 
Adds the media player.
<static>  
minplayer.players.base.canPlay(file)
Determine if we can play the media file.
 
Clears the media player.
 
 
Creates the media player and inserts it in the DOM.
 
defaultOptions(options)
Get the default options for this plugin.
 
 
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, prop, 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.
 
 
load(file, callback)
Loads a new media player.
 
Should be called when the media is complete.
 
onError(errorCode)
Called when an error occurs.
 
Should be called when the media is done loading.
 
Should be called when the media is paused.
 
Should be called when the media is playing.
 
Called when the player is ready to recieve events and commands.
 
Should be called when the player is waiting.
 
parseTime(string)
Parses a time value into seconds.
 
pause(callback)
Pause the loaded media file.
 
play(callback)
Play the loaded media file.
 
Returns if the media player is already within the DOM.
 
Resets all variables.
 
seek(pos, callback, noOffset)
Seek the loaded media.
 
Seeks to relative position.
 
Sets the start and stop points for the media.
 
Sets up a new media player.
 
setVolume(vol, callback)
Set the volume of the loaded minplayer.
 
Set the volume of the loaded minplayer.
 
stop(callback)
Stop the loaded media file.
 
whenReady(callback)
Calls the callback when this player is ready.
Methods borrowed from class minplayer.display:
fullscreen, fullScreenElement, getDisplay, getScaledRect, hide, initialize, isFullScreen, onFocus, showThenHide, toggleFullScreen
Methods borrowed from class minplayer.plugin:
addPlugin, bind, checkQueue, create, get, isEvent, isValid, onAdded, poll, ready, trigger, ubind, 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.

readyQueue
The ready queue for this player.
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} createPlayer()
Creates the media player and inserts it in the DOM.
Returns:
{object} The media player entity.

defaultOptions(options)
Get the default options for this plugin.
Parameters:
{object} options
The default options for this plugin.

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, prop, callback)
Gets a value from the player.
Parameters:
{string} getter
The getter method on the player.
{string} prop
The property to use when getting.
{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.
See:
minplayer.players.base#isReady

load(file, callback)
Loads a new media player.
Parameters:
{object} file
A minplayer.file object.
{function} callback
Called when it is done performing this operation.

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.

{number} parseTime(string)
Parses a time value into seconds.
Parameters:
string
time The time to parse to seconds.
Returns:
{number} The number of seconds this time represents.

pause(callback)
Pause the loaded media file.
Parameters:
{function} callback
Called when it is done performing this operation.

play(callback)
Play the loaded media file.
Parameters:
{function} callback
Called when it is done performing this operation.

{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.

seek(pos, callback, noOffset)
Seek the loaded media.
Parameters:
{number} pos
The position to seek the minplayer. 0 to 1.
{function} callback
Called when it is done performing this operation.
noOffset

seekRelative(pos)
Seeks to relative position.
Parameters:
{number} pos
Relative position. -1 to 1 (percent), > 1 (seconds).

{number} setStartStop()
Sets the start and stop points for the media.
Returns:
{number} The number of seconds we should seek.

setupPlayer()
Sets up a new media player.

setVolume(vol, callback)
Set the volume of the loaded minplayer.
Parameters:
{number} vol
The volume to set the media. 0 to 1.
{function} callback
Called when it is done performing this operation.

setVolumeRelative(vol)
Set the volume of the loaded minplayer.
Parameters:
{number} vol
-1 to 1 - The relative amount to increase or decrease.

stop(callback)
Stop the loaded media file.
Parameters:
{function} callback
Called when it is done performing this operation.

whenReady(callback)
Calls the callback when this player is ready.
Parameters:
{function} callback
Called when it is done performing this operation.

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Dec 04 2013 21:13:26 GMT-0600 (CST)