Class $.fn.apmplayer_ui

Class Summary

$.fn.apmplayer_ui(args)
main integration point between jQuery, APMPlayerUI, and APMPlayer. The $.fn.apmplayer_ui is tested and compliant with all versions of jQuery >= v1.4
//note: see CustomSchemes for this example
$('#apm_media_wrapper').apmplayer_ui({
   playables : [
       {
           identifier: 'apm_audio:/performance_today/2012/04/24/pt2_20120424_128.mp3'
       }
   ]
});
$('#apm_media_wrapper').apmplayer_ui({
   playables : [
       {
          identifier: 'my audio',
          type: 'audio',
          description: 'more info about my audio',
          flash_server_url: 'rtmp://server/',
          flash_file_path: 'mp3:path/file.mp3',
          http_file_path: 'http://server/file.mp3'
       }
   ]
});
$('#apm_media_wrapper').apmplayer_ui({
   settings : {
       volume : 0.8,
       autoplay : true
   },
   playables : [
      {
         identifier: 'apm_live_audio:/mpr_current',
         description: 'live streaming from 89.3',
         program: '89.3 the Current',
         host: 'Mark Wheat',
         date: 'March 24, 2012',
         detail: 'during this hour...',
         image_sm: 'http://mpr.org/images/current.gif'
      },
      {
          identifier: 'apm_audio:/performance_today/2012/04/24/pt2_20120424_128.mp3',
          program: 'on Being',
          downloadable: false
      }
   ],
   onPlaylistUpdate : function (playable) {
      // implement
   },
   onMetadata : function (playable) {
      // implement
   }
});
Parameters:
{Object} args
object literal used to instantiate APMPlayerUI
{Object} args.settings
object literal containing initial values to set on APMPlayer initialization.
{Number} args.settings.volume
sets volume on initialization. (eg. volume : 0.5)
{Boolean} args.settings.autoplay
autoplays current Playable in Playlist after library init completes. (default : false)
{Boolean} args.settings.fetchMetadata
retrieves and sets additional metadata for each Playable. Note that this will only override a value in Playable if it is currently not set. Values passed in when adding a Playable will take precedence. (default : true)
{Array} args.playables
an array of Playable objects.
{Function} args.onPlaylistUpdate()
a method that will fire when Events.type.PLAYLIST_CURRENT_CHANGE is fired, or the playlist is updated. (see Events).
{Function} args.onMetadata()
a method that will fire when Events.type.METADATA is fired. (see Events).

Method Summary

Method Detail

  • addPlayable()
    adds a Playable, if valid, to Playlist.
    $('#player_container_div').apmplayer_ui('addPlayable', playable);
  • gotoPlaylistItem()
    changes position in Playlist to the Playable that matches the passed identifier, and begins playing the item.
    $('#player_container_div').apmplayer_ui('gotoPlaylistItem', identifier);