Class minplayer.plugin
The base class for all plugins.
Defined in: minplayer.plugin.js.
Constructor Attributes | Constructor Name and Description |
---|---|
minplayer.plugin(name, context, options, queue)
|
Field Attributes | Field Name and Description |
---|---|
Say that we are active.
|
|
Keep track of the context.
|
|
Create a queue lock.
|
|
The name of this plugin.
|
|
The options for this plugin.
|
|
The ready flag.
|
|
The event queue.
|
|
Keep track of already triggered events.
|
Method Attributes | Method Name and Description |
---|---|
addPlugin(name, plugin)
Adds a new plugin to this player.
|
|
bind(type, data, fn)
Bind to a media event.
|
|
checkQueue(plugin)
Check the queue and execute it.
|
|
The constructor which is called once the context is set.
|
|
create(name, base, context)
Creates a new plugin within this context.
|
|
destroy()
Destructor.
|
|
get(plugin, callback)
Gets a plugin by name and calls callback when it is ready.
|
|
isValid()
Returns if this component is valid.
|
|
poll(callback, interval)
Create a polling timer.
|
|
ready()
Plugins should call this method when they are ready.
|
|
trigger(type, data)
Trigger a media event.
|
|
unbind(type, fn)
Unbind a media event.
|
Class Detail
minplayer.plugin(name, context, options, queue)
- Parameters:
- {string} name
- The name of this plugin.
- {object} context
- The jQuery context.
- {object} options
- This components options.
- {object} queue
- The event queue to pass events around.
Field Detail
active
Say that we are active.
context
Keep track of the context.
lock
Create a queue lock.
name
The name of this plugin.
options
The options for this plugin.
pluginReady
The ready flag.
queue
The event queue.
triggered
Keep track of already triggered events.
Method Detail
addPlugin(name, plugin)
Adds a new plugin to this player.
- Parameters:
- {string} name
- The name of this plugin.
- {object} plugin
- A new plugin object, derived from media.plugin.
{object}
bind(type, data, fn)
Bind to a media event.
- Parameters:
- {string} type
- The event type.
- {object} data
- The data to bind with the event.
- {function} fn
- The callback function.
- Returns:
- {object} The plugin object.
checkQueue(plugin)
Check the queue and execute it.
- Parameters:
- {object} plugin
- The plugin object to check the queue against.
construct()
The constructor which is called once the context is set.
Any class deriving from the plugin class should place all context
dependant functionality within this function instead of the standard
constructor function since it is called on object derivation as well
as object creation.
{object}
create(name, base, context)
Creates a new plugin within this context.
- Parameters:
- {string} name
- The name of the plugin you wish to create.
- {object} base
- The base object for this plugin.
- {object} context
- The context which you would like to create.
- Returns:
- {object} The new plugin object.
destroy()
Destructor.
{object}
get(plugin, callback)
Gets a plugin by name and calls callback when it is ready.
- Parameters:
- {string} plugin
- The plugin of the plugin.
- {function} callback
- Called when the plugin is ready.
- Returns:
- {object} The plugin if no callback is provided.
{boolean}
isValid()
Returns if this component is valid.
- Returns:
- {boolean} TRUE if the plugin display is valid.
poll(callback, interval)
Create a polling timer.
- Parameters:
- {function} callback
- The function to call when you poll.
- {integer} interval
- The interval you would like to poll.
ready()
Plugins should call this method when they are ready.
{object}
trigger(type, data)
Trigger a media event.
- Parameters:
- {string} type
- The event type.
- {object} data
- The event data object.
- Returns:
- {object} The plugin object.
{object}
unbind(type, fn)
Unbind a media event.
- Parameters:
- {string} type
- The event type.
- {function} fn
- The callback function.
- Returns:
- {object} The plugin object.