Class APMPlayer

Class Summary

APMPlayer()
main container for Audio/Video playback.

Method Summary

Field Detail

debug
reference to APMPlayer Debug logger
APMPlayer.debug.log('debug message', APMPlayer.debug.type.info, 'ObjectName');

Debug types:
APMPlayer.debug.type.info
APMPlayer.debug.type.warn
APMPlayer.debug.type.error
events
reference to the main Events object for APMPlayer
APMPlayer.events.addListener(APMPlayer.events.type.PLAYER_READY, function() {} );
mechanism
reference to internal PlaybackMechanism object.
APMPlayer.mechanism.getCurrentSolution();
mediaTypes
reference to supported MediaTypes (currently AUDIO, LIVE_AUDIO)
player_ui.playlist.current().type == APMPlayer.mediaTypes.LIVE_AUDIO
state
reference to current PlaybackState object
APMPlayer.state.getCurrent() === APMPlayer.state.type.PLAYING;
base_path
returns the base_path of the project, relative to this file. checks for both apmplayer-all.min.js and apmplayer.js
http://localhost/apmplayer/1.2/

Method Detail

  • init()
    initializes APMPlayer library; NOTE: init() must be called immediately after instantiation to ensure SoundManager2 init doesn't timeout
  • mute()
    mutes sound; returns nothing, triggers nothing.
  • pause()
    if static audio, pauses currently loaded Playable; However, if type LIVE_AUDIO, the playable is automatically unloaded.
    Events:
    Events.type.PAUSED, or Events.type.UNLOADED will fire depending on type, on success. (see Events).
  • play()
    loads item (if not loaded), then plays it-- automatically unloads any previous Playable that was loaded/playing
    Events:
    Events.type.PLAYING will fire when audio successfully starts playing. (see Events).
  • reset(playback_solutions)
    resets APMPlayer -- sets PlaybackMechanism solutions + resets Audio playback library
    Parameters:
    {string[]} playback_solutions array of accepted playback mechanisms to use (ie FLASH, HTML5)
  • seek(percent_decimal)
    moves play head to current percentage of media Playable.
    Parameters:
    {number} percent_decimal the point in the media file to seek to. (eg, 0 is beginning / .50 is half-way / 1 is end)
    Events:
    Events.type.POSITION_UPDATE will continue to fire after position is updated by seek() (see Events).
  • setVolume(percent_decimal)
    sets volume.
    Parameters:
    {number} percent_decimal the percentage to set the volume to 0 to 1
    Events:
    Events.type.VOLUME_UPDATED fires event after sucessfully setting volume (see Events).
  • unload()
    stops, unloads, and destroys the current Playable
    Events:
    Events.type.UNLOADED will be fired if audio successfully unloads (see Events).
  • unmute()
    unmutes sound; returns nothing, triggers nothing.