Skip to content

Instantly share code, notes, and snippets.

@ghankerson
Created June 6, 2014 19:27
Show Gist options
  • Save ghankerson/53737e81574f173bc73f to your computer and use it in GitHub Desktop.
Save ghankerson/53737e81574f173bc73f to your computer and use it in GitHub Desktop.
if ($(this.e.currentTarget).hasClass('npr')) {
playable = APMPlayerFactory.getPlayable({
title: title,
identifier: 'npr:' + $(this.e.currentTarget).data('nprid'),
flash_server_url: $(this.e.currentTarget).data('flashserverurl'),
flash_file_path: $(this.e.currentTarget).data('flashfilepath'),
http_file_path: $(this.e.currentTarget).data('mp3'),
type: 'audio'
}); |
} else { //from APM (not from NPR)
playable = APMPlayerFactory.getPlayable({
title: title,
identifier: apmUrl,
flash_server_url: 'rtmp://ondemand-rtmp.stream.publicradio.org/music',
flash_file_path: 'mp3:ondemand' + httpPath,
http_file_path: 'http://play.publicradio.org/' + playRef + '/o' + httpPath,
type: 'audio'
});
}
$(this.config.audio).apmplayer_ui('addPlayable', playable);
$(this.config.audio).apmplayer_ui('gotoPlaylistItem', playable.identifier);
$(this.config.info).addClass('playing');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment