/** * SoundManager 2 homepage demo JS * ------------------------------- * MP3 player button, Muxtape/page player, * inline player and 360 player demo bits * combined and minified for optimal performance. * For raw source, see individual demo pages. * -------------------------------- * Source files: * demo/play-mp3-links/script/inlineplayer.js * demo/page-player/script/page-player.js * demo/mp3-player-button/script/mp3-player-button.js * demo/360-player/script/berniecode-animator.js * demo/360-player/script/360player.js * demo/index.js */ /* Animator.js 1.1.9 This library is released under the BSD license: Copyright (c) 2006, Bernard Sumption. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name BernieCode nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ function InlinePlayer(){var a=this,c=this,b=soundManager,d=navigator.userAgent.match(/msie/i);this.playableClass="inline-playable";this.excludeClass="inline-exclude";this.links=[];this.sounds=[];this.soundsByURL=[];this.indexByURL=[];this.lastSound=null;this.soundCount=0;this.config={playNext:!1,autoPlay:!1};this.css={sDefault:"sm2_link",sLoading:"sm2_loading",sPlaying:"sm2_playing",sPaused:"sm2_paused"};this.addEventHandler="undefined"!==typeof window.addEventListener?function(a,b,c){return a.addEventListener(b, c,!1)}:function(a,b,c){a.attachEvent("on"+b,c)};this.removeEventHandler="undefined"!==typeof window.removeEventListener?function(a,b,c){return a.removeEventListener(b,c,!1)}:function(a,b,c){return a.detachEvent("on"+b,c)};this.classContains=function(a,b){return"undefined"!=typeof a.className?a.className.match(RegExp("(\\s|^)"+b+"(\\s|$)")):!1};this.addClass=function(b,c){if(!b||!c||a.classContains(b,c))return!1;b.className=(b.className?b.className+" ":"")+c};this.removeClass=function(b,c){if(!b|| !c||!a.classContains(b,c))return!1;b.className=b.className.replace(RegExp("( "+c+")|("+c+")","g"),"")};this.getSoundByURL=function(b){return"undefined"!=typeof a.soundsByURL[b]?a.soundsByURL[b]:null};this.isChildOfNode=function(a,b){if(!a||!a.parentNode)return!1;b=b.toLowerCase();do a=a.parentNode;while(a&&a.parentNode&&a.nodeName.toLowerCase()!=b);return a.nodeName.toLowerCase()==b?a:null};this.events={play:function(){c.removeClass(this._data.oLink,this._data.className);this._data.className=c.css.sPlaying; c.addClass(this._data.oLink,this._data.className)},stop:function(){c.removeClass(this._data.oLink,this._data.className);this._data.className=""},pause:function(){c.removeClass(this._data.oLink,this._data.className);this._data.className=c.css.sPaused;c.addClass(this._data.oLink,this._data.className)},resume:function(){c.removeClass(this._data.oLink,this._data.className);this._data.className=c.css.sPlaying;c.addClass(this._data.oLink,this._data.className)},finish:function(){c.removeClass(this._data.oLink, this._data.className);this._data.className="";if(c.config.playNext){var a=c.indexByURL[this._data.oLink.href]+1;ac?"0"+c:c):{min:d,sec:c}};this.getSoundByObject=function(b){return"undefined"!== typeof a.soundsByObject[b.id]?a.soundsByObject[b.id]:null};this.getPreviousItem=function(a){if(a.previousElementSibling)a=a.previousElementSibling;else for(a=a.previousSibling;a&&a.previousSibling&&1!==a.previousSibling.nodeType;)a=a.previousSibling;return"li"!==a.nodeName.toLowerCase()?null:a.getElementsByTagName("a")[0]};this.playPrevious=function(b){b||(b=a.lastSound);if(!b)return!1;(b=a.getPreviousItem(b._data.oLI))&&c.handleClick({target:b});return b};this.getNextItem=function(a){if(a.nextElementSibling)a= a.nextElementSibling;else for(a=a.nextSibling;a&&a.nextSibling&&1!==a.nextSibling.nodeType;)a=a.nextSibling;return"li"!==a.nodeName.toLowerCase()?null:a.getElementsByTagName("a")[0]};this.playNext=function(b){b||(b=a.lastSound);if(!b)return!1;(b=a.getNextItem(b._data.oLI))&&c.handleClick({target:b});return b};this.setPageTitle=function(b){if(!a.config.updatePageTitle)return!1;try{document.title=(b?b+" - ":"")+a.pageTitle}catch(c){a.setPageTitle=function(){return!1}}};this.events={play:function(){c.removeClass(this._data.oLI, this._data.className);this._data.className=c.css.sPlaying;c.addClass(this._data.oLI,this._data.className);a.setPageTitle(this._data.originalTitle)},stop:function(){c.removeClass(this._data.oLI,this._data.className);this._data.className="";this._data.oPosition.style.width="0px";a.setPageTitle();a.resetPageIcon()},pause:function(){if(c.dragActive)return!1;c.removeClass(this._data.oLI,this._data.className);this._data.className=c.css.sPaused;c.addClass(this._data.oLI,this._data.className);a.setPageTitle(); a.resetPageIcon()},resume:function(){if(c.dragActive)return!1;c.removeClass(this._data.oLI,this._data.className);this._data.className=c.css.sPlaying;c.addClass(this._data.oLI,this._data.className)},finish:function(){c.removeClass(this._data.oLI,this._data.className);this._data.className="";this._data.oPosition.style.width="0px";a.config.playNext?c.playNext(this):(a.setPageTitle(),a.resetPageIcon())},whileloading:function(){function b(){this._data.oLoading.style.width=100*(this.bytesLoaded/this.bytesTotal)+ "%";!this._data.didRefresh&&this._data.metadata&&(this._data.didRefresh=!0,this._data.metadata.refresh())}if(c.config.useThrottling){var l=new Date;if(l&&50 | Load failed, d\'oh! '+(b.sandbox.noRemote? " Possible cause: Flash sandbox is denying remote URL access.":b.sandbox.noLocal?"Flash denying local filesystem access":"404?")+"";setTimeout(function(){a.innerHTML=c},5E3)}},whileplaying:function(){var d=null;if(c.dragActive||!c.config.useThrottling){a.updateTime.apply(this);9<=b.flashVersion&&(c.config.usePeakData&&this.instanceOptions.usePeakData&&a.updatePeaks.apply(this),(c.config.useWaveformData&&this.instanceOptions.useWaveformData||c.config.useEQData&&this.instanceOptions.useEQData)&& a.updateGraph.apply(this));if(this._data.metadata&&(d=new Date)&&500c.config.flashVersion||!c.config.useWaveformData&&!c.config.useEQData)return!1;var a=this._data.oGraph.getElementsByTagName("div"),b;if(c.config.useWaveformData)for(b=255;b--;)a[255-b].style.marginTop=9+Math.ceil(-8*this.waveformData.left[b])+"px";else for(b=255;b--;)a[255-b].style.marginTop=17+Math.ceil(-9*this.eqData[b])+"px"};this.resetGraph=function(){if(!c.config.useEQData||9>c.config.flashVersion)return!1;var a=this._data.oGraph.getElementsByTagName("div"),b= !c.config.useEQData?"9px":"17px",d=!c.config.fillGraph?"1px":"32px",e;for(e=255;e--;)a[255-e].style.marginTop=b,a[255-e].style.height=d};this.updateTime=function(){var b=a.strings.timing.replace("%s1",a.getTime(this.position,!0)),b=b.replace("%s2",a.getTime(a.getDurationEstimate(this),!0));this._data.oTiming.innerHTML=b};this.getTheDamnTarget=function(a){return a.target||(window.event?window.event.srcElement:null)};this.withinStatusBar=function(b){return a.isChildOfClass(b,"playlist")&&a.isChildOfClass(b, "controls")};this.handleClick=function(d){if(2===d.button)return c.config.allowRightClick||c.stopEvent(d),c.config.allowRightClick;var l=a.getTheDamnTarget(d),r,e,f;if(!l)return!0;a.dragActive&&a.stopDrag();if(a.withinStatusBar(l))return!1;"a"!==l.nodeName.toLowerCase()&&(l=a.getParentByNodeName(l,"a"));if(!l)return!0;l.getAttribute("href");if(!l.href||!b.canPlayLink(l)&&!a.hasClass(l,"playable")||a.hasClass(l,"exclude"))return!0;a.initUL(a.getParentByNodeName(l,"ul"));a.initItem(l);r=l.href;(e=a.getSoundByObject(l))? (a.setPageTitle(e._data.originalTitle),e===a.lastSound?2!==e.readyState?1!==e.playState?e.play():e.togglePause():b._writeDebug("Warning: sound failed to load (security restrictions, 404 or bad format)",2):(a.lastSound&&a.stopSound(a.lastSound),g&&e._data.oTimingBox.appendChild(g),e.togglePause())):(e=b.createSound({id:l.id,url:decodeURI(r),onplay:a.events.play,onstop:a.events.stop,onpause:a.events.pause,onresume:a.events.resume,onfinish:a.events.finish,type:l.type||null,whileloading:a.events.whileloading, whileplaying:a.events.whileplaying,onmetadata:a.events.metadata,onload:a.events.onload}),r=a.oControls.cloneNode(!0),f=l.parentNode,f.appendChild(r),g&&f.appendChild(g),a.soundsByObject[l.id]=e,e._data={oLink:l,oLI:f,oControls:a.select("controls",f),oStatus:a.select("statusbar",f),oLoading:a.select("loading",f),oPosition:a.select("position",f),oTimingBox:a.select("timing",f),oTiming:a.select("timing",f).getElementsByTagName("div")[0],oPeak:a.select("peak",f),oGraph:a.select("spectrum-box",f),className:a.css.sPlaying, originalTitle:l.innerHTML,metadata:null},g&&e._data.oTimingBox.appendChild(g),e._data.oLI.getElementsByTagName("ul").length&&(e._data.metadata=new Metadata(e)),l=a.strings.timing.replace("%s1",a.config.emptyTime),l=l.replace("%s2",a.config.emptyTime),e._data.oTiming.innerHTML=l,a.sounds.push(e),a.lastSound&&a.stopSound(a.lastSound),a.resetGraph.apply(e),e.play());a.lastSound=e;return a.stopEvent(d)};this.handleMouseDown=function(b){p&&b.touches&&(b=b.touches[0]);if(2===b.button)return c.config.allowRightClick|| c.stopEvent(b),c.config.allowRightClick;var l=a.getTheDamnTarget(b);if(!l||!a.withinStatusBar(l))return!0;a.dragActive=!0;a.lastSound.pause();a.setPosition(b);p?d.add(document,"touchmove",a.handleMouseMove):d.add(document,"mousemove",a.handleMouseMove);a.addClass(a.lastSound._data.oControls,"dragging");return a.stopEvent(b)};this.handleMouseMove=function(b){p&&b.touches&&(b=b.touches[0]);if(a.dragActive)if(a.config.useThrottling){var c=new Date;20b;b++)a.vuMeterData[b]=[];for(b=0;16>b;b++)for(c=0;16>c;c++)f.setAttribute("width",16),f.setAttribute("height",16),d.fillStyle=g,d.fillRect(0,0,7,15),d.fillRect(8,0,7,15),d.fillStyle=e,d.fillRect(0,15-b,7,16-(16-b)),d.fillRect(8,15-c,7,16-(16-c)),d.clearRect(0,3,16,1),d.clearRect(0,7,16,1),d.clearRect(0, 11,16,1),a.vuMeterData[b][c]=f.toDataURL("image/png")};this.testCanvas=function(){var a=document.createElement("canvas"),b=null;if(!a||"undefined"===typeof a.getContext)return null;b=a.getContext("2d");if(!b||"function"!==typeof a.toDataURL)return null;try{a.toDataURL("image/png")}catch(c){return null}return a};this.initItem=function(b){b.id||(b.id="pagePlayerMP3Sound"+a.soundCount++);a.addClass(b,a.css.sDefault)};this.initUL=function(c){9<=b.flashVersion&&a.addClass(c,a.cssBase)};this.init=function(h){function l(b){d[b](document, "click",a.handleClick);p?(d[b](document,"touchstart",a.handleMouseDown),d[b](document,"touchend",a.stopDrag)):(d[b](document,"mousedown",a.handleMouseDown),d[b](document,"mouseup",a.stopDrag));d[b](window,"unload",q)}h?(b._writeDebug("pagePlayer.init(): Using custom configuration"),this.config=this._mergeObjects(h,this.config)):b._writeDebug("pagePlayer.init(): Using default configuration");var r,v,k,u;this.cssBase=[];b.useFlashBlock=!0;9<=b.flashVersion?(b.defaultOptions.usePeakData=this.config.usePeakData, b.defaultOptions.useWaveformData=this.config.useWaveformData,b.defaultOptions.useEQData=this.config.useEQData,this.config.usePeakData&&this.cssBase.push("use-peak"),(this.config.useWaveformData||this.config.useEQData)&&this.cssBase.push("use-spectrum"),this.cssBase=this.cssBase.join(" "),this.config.useFavIcon&&((f=a.testCanvas())&&m?a.createVUData():this.config.useFavIcon=!1)):(this.config.usePeakData||this.config.useWaveformData||this.config.useEQData)&&b._writeDebug("Page player: Note: soundManager.flashVersion = 9 is required for peak/waveform/EQ features."); e=document.createElement("div");e.innerHTML='
\n
\n
\n
\n
\n
\n
\n
\n %s1 / %s2\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
'; if(9<=b.flashVersion){g=a.select("spectrum-container",e);g=e.removeChild(g);r=a.select("spectrum-box",g);v=r.getElementsByTagName("div")[0];k=document.createDocumentFragment();u=null;for(h=256;h--;)u=v.cloneNode(!1),u.style.left=h+"px",k.appendChild(u);r.removeChild(v);r.appendChild(k)}else e.removeChild(a.select("spectrum-container",e)),e.removeChild(a.select("peak",e));a.oControls=e.cloneNode(!0);h=a.select("timing-data",e);a.strings.timing=h.innerHTML;h.innerHTML="";h.id="";q=function(){l("remove")}; l("add");b._writeDebug("pagePlayer.init(): Ready",1);a.config.autoStart&&c.handleClick({target:c.getByClassName("playlist","ul")[0].getElementsByTagName("a")[0]})}}soundManager.useFlashBlock=!0;soundManager.onready(function(){pagePlayer=new PagePlayer;pagePlayer.init("undefined"!==typeof PP_CONFIG?PP_CONFIG:null)}); function BasicMP3Player(){var a=this,c=this,b=soundManager,d=navigator.userAgent.match(/ipad|iphone/i),f=navigator.userAgent.match(/msie/i);this.excludeClass="button-exclude";this.links=[];this.sounds=[];this.soundsByURL={};this.indexByURL={};this.lastSound=null;this.soundCount=0;this.config={playNext:!1,autoPlay:!1};this.css={sDefault:"sm2_button",sLoading:"sm2_loading",sPlaying:"sm2_playing",sPaused:"sm2_paused"};this.includeClass=this.css.sDefault;this.addEventHandler="undefined"!==typeof window.addEventListener? function(a,b,c){return a.addEventListener(b,c,!1)}:function(a,b,c){a.attachEvent("on"+b,c)};this.removeEventHandler="undefined"!==typeof window.removeEventListener?function(a,b,c){return a.removeEventListener(b,c,!1)}:function(a,b,c){return a.detachEvent("on"+b,c)};this.classContains=function(a,b){return"undefined"!==typeof a.className?a.className.match(RegExp("(\\s|^)"+b+"(\\s|$)")):!1};this.addClass=function(b,c){if(!b||!c||a.classContains(b,c))return!1;b.className=(b.className?b.className+" ": "")+c};this.removeClass=function(b,c){if(!b||!c||!a.classContains(b,c))return!1;b.className=b.className.replace(RegExp("( "+c+")|("+c+")","g"),"")};this.getSoundByURL=function(b){return"undefined"!==typeof a.soundsByURL[b]?a.soundsByURL[b]:null};this.isChildOfNode=function(b,a){if(!b||!b.parentNode)return!1;a=a.toLowerCase();do b=b.parentNode;while(b&&b.parentNode&&b.nodeName.toLowerCase()!==a);return b.nodeName.toLowerCase()===a?b:null};this.events={play:function(){c.removeClass(this._data.oLink, this._data.className);this._data.className=c.css.sPlaying;c.addClass(this._data.oLink,this._data.className)},stop:function(){c.removeClass(this._data.oLink,this._data.className);this._data.className=""},pause:function(){c.removeClass(this._data.oLink,this._data.className);this._data.className=c.css.sPaused;c.addClass(this._data.oLink,this._data.className)},resume:function(){c.removeClass(this._data.oLink,this._data.className);this._data.className=c.css.sPlaying;c.addClass(this._data.oLink,this._data.className)}, finish:function(){c.removeClass(this._data.oLink,this._data.className);this._data.className="";if(c.config.playNext){var b=c.indexByURL[this._data.oLink.href]+1;b=Math.abs(this.state-this.target)?this.state=this.target:this.state+=a;try{this.propagate()}finally{this.options.onStep.call(this),this.target==this.state&&(window.clearInterval(this.intervalId),this.intervalId=null,this.options.onComplete.call(this))}},play:function(){this.seekFromTo(0,1)},reverse:function(){this.seekFromTo(1,0)},inspect:function(){for(var a="#"}};Animator.applyDefaults=function(a,c){c=c||{};var b,d={};for(b in a)d[b]=void 0!==c[b]?c[b]:a[b];return d};Animator.makeArray=function(a){if(null==a)return[];if(!a.length)return[a];for(var c=[],b=0;b=b?b:2-b}}; Animator.tx={easeInOut:function(a){return-Math.cos(a*Math.PI)/2+0.5},linear:function(a){return a},easeIn:Animator.makeEaseIn(1.5),easeOut:Animator.makeEaseOut(1.5),strongEaseIn:Animator.makeEaseIn(2.5),strongEaseOut:Animator.makeEaseOut(2.5),elastic:Animator.makeElastic(1),veryElastic:Animator.makeElastic(3),bouncy:Animator.makeBounce(1),veryBouncy:Animator.makeBounce(3)}; function NumericalStyleSubject(a,c,b,d,f){this.els=Animator.makeArray(a);this.property="opacity"==c&&window.ActiveXObject?"filter":Animator.camelize(c);this.from=parseFloat(b);this.to=parseFloat(d);this.units=null!=f?f:"px"} NumericalStyleSubject.prototype={setState:function(a){a=this.getStyle(a);for(var c=0,b=0;b=d;d++)a=Math.max(0,Math.min(255,parseInt(b[d]))),c+=ColorStyleSubject.toColorPart(a);return c}if(b=ColorStyleSubject.parseColor.hexRe.exec(a)){if(3==b[1].length){for(d=0;3>d;d++)c+=b[1].charAt(d)+b[1].charAt(d);return c}return"#"+b[1]}return!1};ColorStyleSubject.toColorPart=function(a){255a?"0"+c:c};ColorStyleSubject.parseColor.rgbRe=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i; ColorStyleSubject.parseColor.hexRe=/^\#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;function DiscreteStyleSubject(a,c,b,d,f){this.els=Animator.makeArray(a);this.property=Animator.camelize(c);this.from=b;this.to=d;this.threshold=f||0.5}DiscreteStyleSubject.prototype={setState:function(a){for(var c=0;c=a?(this.forwards=!1,this.animators[this.current].seekTo(0)):(this.forwards=!0,this.animators[this.current].seekTo(1))}}; function Accordion(a){this.setOptions(a);a=this.options.initialSection;var c;this.options.rememberance&&(c=document.location.hash.substring(1));this.rememberanceTexts=[];this.ans=[];for(var b=this,d=0;da?1:0);this.options.rememberance&&(document.location.hash=this.rememberanceTexts[a])}};var threeSixtyPlayer,ThreeSixtyPlayer; (function(a){function c(){var b=this,c=this,f=soundManager,e=navigator.userAgent,h=e.match(/msie/i),g=e.match(/opera/i),k=e.match(/safari/i),m=e.match(/chrome/i);e.match(/firefox/i);var p=e.match(/ipad|iphone/i),q="undefined"===typeof a.G_vmlCanvasManager&&"undefined"!==typeof document.createElement("canvas").getContext("2d"),n=g||m?359.9:360;this.excludeClass="threesixty-exclude";this.links=[];this.sounds=[];this.soundsByURL=[];this.indexByURL=[];this.lastTouchedSound=this.lastSound=null;this.soundCount= 0;this.vuMeter=this.oUIImageMap=this.oUITemplate=null;this.callbackCount=0;this.peakDataHistory=[];this.config={playNext:!1,autoPlay:!1,allowMultiple:!1,loadRingColor:"#ccc",playRingColor:"#000",backgroundRingColor:"#eee",segmentRingColor:"rgba(255,255,255,0.33)",segmentRingColorAlt:"rgba(0,0,0,0.1)",loadRingColorMetadata:"#ddd",playRingColorMetadata:"rgba(128,192,256,0.9)",circleDiameter:null,circleRadius:null,animDuration:500,animTransition:a.Animator.tx.bouncy,showHMSTime:!1,scaleFont:!0,useWaveformData:!1, waveformDataColor:"#0099ff",waveformDataDownsample:3,waveformDataOutside:!1,waveformDataConstrain:!1,waveformDataLineRatio:0.64,useEQData:!1,eqDataColor:"#339933",eqDataDownsample:4,eqDataOutside:!0,eqDataLineRatio:0.54,usePeakData:!0,peakDataColor:"#ff33ff",peakDataOutside:!0,peakDataLineRatio:0.5,useAmplifier:!0,fontSizeMax:null,scaleArcWidth:1,useFavIcon:!1};this.css={sDefault:"sm2_link",sBuffering:"sm2_buffering",sPlaying:"sm2_playing",sPaused:"sm2_paused"};this.addEventHandler="undefined"!== typeof a.addEventListener?function(b,a,c){return b.addEventListener(a,c,!1)}:function(b,a,c){b.attachEvent("on"+a,c)};this.removeEventHandler="undefined"!==typeof a.removeEventListener?function(b,a,c){return b.removeEventListener(a,c,!1)}:function(b,a,c){return b.detachEvent("on"+a,c)};this.hasClass=function(b,a){return"undefined"!==typeof b.className?b.className.match(RegExp("(\\s|^)"+a+"(\\s|$)")):!1};this.addClass=function(a,c){if(!a||!c||b.hasClass(a,c))return!1;a.className=(a.className?a.className+ " ":"")+c};this.removeClass=function(a,c){if(!a||!c||!b.hasClass(a,c))return!1;a.className=a.className.replace(RegExp("( "+c+")|("+c+")","g"),"")};this.getElementsByClassName=function(a,c,d){var e=d||document;d=[];var f,g=[];if("undefined"!==typeof c&&"string"!==typeof c)for(f=c.length;f--;){if(!g||!g[c[f]])g[c[f]]=e.getElementsByTagName(c[f])}else g=c?e.getElementsByTagName(c):e.all||e.getElementsByTagName("*");if("string"!==typeof c)for(f=c.length;f--;)for(e=g[c[f]].length;e--;)b.hasClass(g[c[f]][e], a)&&d.push(g[c[f]][e]);else for(f=0;fc?"0"+c:c):{min:d,sec:c}};this.clearCanvas=function(a){var b=null,c;a.getContext&&(b=a.getContext("2d"));b&&(c=a.offsetWidth,a= a.offsetHeight,b.clearRect(-(c/2),-(a/2),c,a))};this.updatePlaying=function(){var a=this._360data.showHMSTime?b.getTime(this.position,!0):parseInt(this.position/1E3,10),c=b.config.scaleArcWidth;this.bytesLoaded&&(this._360data.lastValues.bytesLoaded=this.bytesLoaded,this._360data.lastValues.bytesTotal=this.bytesTotal);this.position&&(this._360data.lastValues.position=this.position);this.durationEstimate&&(this._360data.lastValues.durationEstimate=this.durationEstimate);b.drawSolidArc(this._360data.oCanvas, b.config.backgroundRingColor,this._360data.width,this._360data.radius*c,b.deg2rad(n),!1);b.drawSolidArc(this._360data.oCanvas,this._360data.metadata?b.config.loadRingColorMetadata:b.config.loadRingColor,this._360data.width,this._360data.radius*c,b.deg2rad(n*(this._360data.lastValues.bytesLoaded/this._360data.lastValues.bytesTotal)),0,!0);0!==this._360data.lastValues.position&&b.drawSolidArc(this._360data.oCanvas,this._360data.metadata?b.config.playRingColorMetadata:b.config.playRingColor,this._360data.width, this._360data.radius*c,b.deg2rad(1===this._360data.didFinish?n:n*(this._360data.lastValues.position/this._360data.lastValues.durationEstimate)),0,!0);this._360data.metadata&&this._360data.metadata.events.whileplaying();a!==this._360data.lastTime&&(this._360data.lastTime=a,this._360data.oTiming.innerHTML=a);(this.instanceOptions.useWaveformData||this.instanceOptions.useEQData)&&q&&b.updateWaveform(this);b.config.useFavIcon&&b.vuMeter&&b.vuMeter.updateVU(this)};this.updateWaveform=function(a){if(!b.config.useWaveformData&& !b.config.useEQData||!f.features.waveformData&&!f.features.eqData||!a.waveformData.left.length&&!a.eqData.length&&!a.peakData.left)return!1;a._360data.oCanvas.getContext("2d");var c=parseInt(a._360data.circleDiameter/2,10)/2,d,e,g,k,h,m,p,n,q;if(b.config.useWaveformData){g=b.config.waveformDataDownsample;g=Math.max(1,g);k=256/g;p=b.config.waveformDataOutside?1:b.config.waveformDataConstrain?0.5:0.565;c=b.config.waveformDataOutside?0.7:0.75;n=b.deg2rad(360/k*b.config.waveformDataLineRatio);for(d=0;256> d;d+=g)h=b.deg2rad(360*(1*(d/k)/g)),m=h+n,e=a.waveformData.left[d],0>e&&b.config.waveformDataConstrain&&(e=Math.abs(e)),b.drawSolidArc(a._360data.oCanvas,b.config.waveformDataColor,a._360data.width*p*(2-b.config.scaleArcWidth),1.25*(a._360data.radius*c)*e,m,h,!0)}if(b.config.useEQData){g=b.config.eqDataDownsample;g=Math.max(1,g);k=192;p=b.config.eqDataOutside?1:0.565;e=b.config.eqDataOutside?-1:1;c=b.config.eqDataOutside?0.5:0.75;n=b.deg2rad(360/(k/g)*b.config.eqDataLineRatio);q=b.deg2rad(1===a._360data.didFinish? 360:360*(a._360data.lastValues.position/a._360data.lastValues.durationEstimate));for(d=0;dq?b.config.eqDataColor:b.config.playRingColor,a._360data.width*p,a._360data.radius*c*a.eqData.left[d]*e,m,h,!0)}if(b.config.usePeakData&&!a._360data.animating){c=a.peakData.left||a.peakData.right;k=3;for(d=0;d',' ','
','
']}; this.uiTest=function(a){var c=document.createElement("div"),d,e;c.className="sm2-360ui";d=document.createElement("div");d.className="ui360"+(a?" "+a:"");c=d.appendChild(c.cloneNode(!0));d.style.position="absolute";d.style.left="-9999px";a=document.body.appendChild(d);e=b.getUIHTML(c.offsetWidth);c.innerHTML=e[1]+e[2]+e[3];c=parseInt(c.offsetWidth,10);e=parseInt(c/2,10);a=b.getElementsByClassName("sm2-timing","div",a)[0];a=parseInt(b.getStyle(a,"font-size"),10);isNaN(a)&&(a=null);d.parentNode.removeChild(d); return{circleDiameter:c,circleRadius:e,fontSizeMax:a}};this.init=function(){f._writeDebug("threeSixtyPlayer.init()");var c=b.getElementsByClassName("ui360","div"),d,e,g=[],k=!1,m=0,n,q,t,s,w;d=0;for(e=c.length;da;a++)c.vuMeterData[a]=[];for(a=0;16>a;a++)for(b=0;16>b;b++)c.vuDataCanvas.setAttribute("width",16),c.vuDataCanvas.setAttribute("height",16),e.fillStyle=h,e.fillRect(0,0,7,15),e.fillRect(8,0,7,15),e.fillStyle= f,e.fillRect(0,15-a,7,16-(16-a)),e.fillRect(8,15-b,7,16-(16-b)),e.clearRect(0,3,16,1),e.clearRect(0,7,16,1),e.clearRect(0,11,16,1),c.vuMeterData[a][b]=c.vuDataCanvas.toDataURL("image/png")};this.testCanvas=function(){var a=document.createElement("canvas"),b=null;if(!a||"undefined"===typeof a.getContext)return null;b=a.getContext("2d");if(!b||"function"!==typeof a.toDataURL)return null;try{a.toDataURL("image/png")}catch(c){return null}return a};this.init=function(){a.config.useFavIcon&&(c.vuDataCanvas= c.testCanvas(),c.vuDataCanvas&&(h||e)?c.createVUData():a.config.useFavIcon=!1)};this.init()};c.prototype.Metadata=function(a,c){soundManager._wD("Metadata()");var f=this,e=a._360data.oUI360,h=e.getElementsByTagName("ul")[0].getElementsByTagName("li");navigator.userAgent.match(/firefox/i);var g;this.lastWPExec=0;this.refreshInterval=250;this.totalTime=0;this.events={whileplaying:function(){var e=a._360data.width,g=a._360data.radius,h=a.durationEstimate||1E3*f.totalTime,q=null,n,l;n=0;for(l=f.data.length;n< l;n++)q=0===n%2,c.drawSolidArc(a._360data.oCanvas,q?c.config.segmentRingColorAlt:c.config.segmentRingColor,e,g/2,c.deg2rad(360*(f.data[n].endTimeMS/h)),c.deg2rad(360*((f.data[n].startTimeMS||1)/h)),!0);e=new Date;e-f.lastWPExec>f.refreshInterval&&(f.refresh(),f.lastWPExec=e)}};this.refresh=function(){var c,d,e=null,f=a.position,g=a._360data.metadata.data;c=0;for(d=g.length;c=g[c].startTimeMS&&f<=g[c].endTimeMS){e=c;break}e!==g.currentItem&&e