Class Events
Method Summary
Field Detail
{Object}
type
holds all valid event types -- See Event Summary for details
{Array[Object]}
handlers
array of event handler objects in form of { 'handler_name', function() {} }.
Method Detail
-
addListener(name, handler)adds an event listener
APMPlayer.events.addListener(APMPlayer.events.type.PLAYER_READY, function() {});
- Parameters:
- {string} name the name of the event to listen for
- {Object} handler function to fire when event is called.
-
removeListeners()clears out all listeners in this events objec
APMPlayer.events.removeListeners();
-
trigger(name, eventArgs)fires all events handlers that match 'name' and passes eventArgs to each handler.
APMPlayer.events.trigger(player.events.type.MEDIA_READY, { 'identifier' : this.ID });
- Parameters:
- {string} name name of event to fire
- {Object} eventArgs object literal to pass to all functon handlers
Event Detail
AUDIO_LIB_READY
fires after Audio library has initialized (only used internally)
Events.type.AUDIO_LIB_READY
BUFFER_END
fires when player buffering ends
Events.type.BUFFER_END
BUFFER_START
fires when player starts buffering
Events.type.BUFFER_START
CONNECTION_LOST
fires if the network connection is lost
Events.type.CONNECTION_LOST
FINISHED
fires when playable finishes playing
Events.type.FINISHED
MEDIA_READY
fires when media has successfully loaded and is ready to be played
Events.type.MEDIA_READY
METADATA
important for statistic tracking (web trends) fires each time a new playable is encountered, or when a new item begins playing in a live stream
A Playable is always the data for each METADATA event
Events.type.METADATA
MISSING_FILE
fires if a file that was attempted to be played is missing
Events.type.MISSING_FILE
PAUSED
fires when playable is paused
Events.type.PAUSED
PLAYER_FAILURE
fires when no suitable playback mechanism can be determined (final failure)
Events.type.PLAYER_FAILURE
PLAYER_READY
fires when player has completely initialized
Events.type.PLAYER_READY
PLAYING
fires when playable begins playback
Events.type.PLAYING
PLAYLIST_CURRENT_CHANGE
fires when current item in playlist has updated
Events.type.PLAYLIST_CURRENT_CHANGE
POSITION_UPDATE
fires each time player head updates while playing-- a number in miliseconds usually accompanies the event to report current position in miliseconds.
Events.type.POSITION_UPDATE
UNLOADED
fires when a playable is stopped or unloaded from player
Events.type.UNLOADED
VOLUME_UPDATED
fires when volume is updated
Events.type.VOLUME_UPDATED