Class APMPlayerFactory

Class Summary

APMPlayerFactory()
factory pattern used to prohibit multiple copies of APMPlayer (singleton) + provides access to Playlist and Playable creation

Method Summary

Method Detail

  • {CustomSchemes} getCustomSchemes(params)
    returns a CustomSchemes object to initialize the map of CustomSchemes, used as a short-cut for constructing Playable objects -- see CustomSchemes for more detail.
    Parameters:
    {Object} params object literal used to initialize CustomSchemes -- the object can contain any number of attributes already defined for Playable objects.
    Returns:
    {CustomSchemes}
  • {Playable} getPlayable(params)
    validates params argument and constructs a new Playable object upon each call, if valid. Returns an empty Playable if passed arguments are invalid. see also Playable.isValid
    regular example:
    APMPlayerFactory.getPlayable(
    {
      type: 'audio',
      identifier: 'my_audio',
      flash_server_url: 'rtmp://server/',
      flash_file_path: 'mp3:path/file.mp3',
      http_file_path: 'http://server/file.mp3',
      buffer_time: 5
    });
    CustomScheme example:
    APMPlayerFactory.getPlayable(
    {
      identifier: 'apm_audio:/being/programs/2011/12/15/20111222_prophetic_imagination_128.mp3'
    });
    
    (note that in this example, the CustomScheme provides attributes that are pre-defined
    (eg, flash_server_url, flash_file_path, http_file_path, type, buffer_time)
    Parameters:
    {Object} params object literal used to build Playable.
    Returns:
    {Playable}
  • {APMPlayer} getPlayer()
    returns singleton instance of APMPlayer.
    Returns:
    {APMPlayer}
  • {Playlist} getPlaylist()
    constructs and returns a new Playlist.
    Returns:
    {Playlist}