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)
|
Field Attributes | Field Name and Description |
---|---|
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.
|
|
Check the queue and execute it.
|
|
The constructor which is called once the context is set.
|
|
destroy()
Destructor.
|
|
get(plugin, callback)
Gets a plugin by name and calls callback when it is ready.
|
|
Loads all of the available plugins.
|
|
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)
- Parameters:
- {string} name
- The name of this plugin.
- {object} context
- The jQuery context.
- {object} options
- This components options.
Field Detail
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()
Check the queue and execute it.
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.
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.
loadPlugins()
Loads all of the available plugins.
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.