function audioPlayerSetupDone(){ /* This will get called when component is ready to receive public function calls. */ //console.log('audioPlayerSetupDone'); }
// SETTINGS var ap_settings = { /*defaultVolume: 0-1 */ defaultVolume:0.5, /*autoPlay: true/false (false on mobile by default) */ autoPlay:false, /*autoPlayAfterFirst: true/false (if autoPlay=false, after first song play, autoPlay=true) */ autoPlayAfterFirst:true, /*randomPlay: true/false */ randomPlay:false, /*loopingOn: true/false (loop on the end of the playlist) */ loopingOn:true, /* autoOpenPlaylist: true/false. Auto open playlist on beginning. Set this to false if you dont want to use (visible) playlist. */ autoOpenPlaylist: true, /* addNumbersInPlaylist: true/false. Prepend numbers in playlist items. */ addNumbersInPlaylist: true, /* useSongNameScroll: true/false. Use song name scrolling. */ useSongNameScroll: true, /* scrollSeparator: String to append between scrolling song name. */ scrollSeparator: ' *** ', /* mediaTimeSeparator: String between current and total song time. */ mediaTimeSeparator: ' - ', /* seekTooltipSeparator: String between current and total song position. */ seekTooltipSeparator: ' / ', /* scrollSpeed: speed of the scroll. */ scrollSpeed: 1, /* activePlaylist: set active playlist that will be loaded on beginning (pass element 'id' attributte) */ activePlaylist: 'playlist1', /* soundcloudApiKey: register you own api key here for free : http://soundcloud.com/you/apps/new and enter Client ID */ soundcloudApiKey: '', /* buttonsUrl: url of the buttons for normal and rollover state (rollover state is optional), so I dont hardcode them in jquery. */ buttonsUrl: {prev: '/media/data/icons/set1/prev.png', prevOn: 'media/data/icons/set1/prev_on.png', next: 'media/data/icons/set1/next.png', nextOn: 'media/data/icons/set1/next_on.png', pause: 'media/data/icons/set1/pause.png', pauseOn: 'media/data/icons/set1/pause_on.png', play: 'media/data/icons/set1/play.png', playOn: 'media/data/icons/set1/play_on.png', volume: 'media/data/icons/set1/volume.png', volumeOn: 'media/data/icons/set1/volume_on.png', mute: 'media/data/icons/set1/mute.png', muteOn: 'media/data/icons/set1/mute_on.png', loop: 'media/data/icons/set1/loop.png', loopOn: 'media/data/icons/set1/loop_on.png', shuffle: 'media/data/icons/set1/shuffle.png', shuffleOn: 'media/data/icons/set1/shuffle_on.png', playlist: 'media/data/icons/set1/playlist.png', playlistOn: 'media/data/icons/set1/playlist_on.png'} };
//sound manager settings (http://www.schillmania.com/projects/soundmanager2/) soundManager.allowScriptAccess = 'always'; soundManager.debugMode = false; soundManager.noSWFCache = true; soundManager.useConsole = false; soundManager.waitForWindowLoad = true; soundManager.url = 'swf/'; soundManager.flashVersion = 9; soundManager.preferFlash = false; // use HTML5 audio for MP3/MP4, if available soundManager.useHTML5Audio = true;
var audio = document.createElement('audio'), mp3Support, oggSupport; if (audio.canPlayType) { mp3Support = !!audio.canPlayType && "" != audio.canPlayType('audio/mpeg'); oggSupport = !!audio.canPlayType && "" != audio.canPlayType('audio/ogg; codecs="vorbis"'); }else{ //for IE<9 mp3Support = true; oggSupport = false; } //console.log('mp3Support = ', mp3Support, ' , oggSupport = ', oggSupport); /* FF - false, true OP - false, true IE9 - true, false SF - true, false CH - true, true */ soundManager.audioFormats = { 'mp3': { 'type': ['audio/mpeg; codecs="mp3"', 'audio/mpeg', 'audio/mp3', 'audio/MPA', 'audio/mpa-robust'], 'required': mp3Support }, 'mp4': { 'related': ['aac','m4a'], // additional formats under the MP4 container 'type': ['audio/mp4; codecs="mp4a.40.2"', 'audio/aac', 'audio/x-m4a', 'audio/MP4A-LATM', 'audio/mpeg4-generic'], 'required': false }, 'ogg': { 'type': ['audio/ogg; codecs=vorbis'], 'required': oggSupport }, 'wav': { 'type': ['audio/wav; codecs="1"', 'audio/wav', 'audio/wave', 'audio/x-wav'], 'required': false } }; jQuery(window).load(function() { jQuery.noConflict(); jQuery('#m0').children('a').css({ background : '#ccc', cursor : 'default' }); //init component jQuery.html5audio('#componentWrapper', ap_settings, 'sound_id1'); ap_settings = null; });






