28e7b63568
- Intro Screen - Share buttons (Twitter/Facebook) - SoundManager - Add audio files - Some CleanUp
71 lines
30 KiB
JavaScript
71 lines
30 KiB
JavaScript
/** @license
|
|
|
|
SoundManager 2: Javascript Sound for the Web
|
|
--------------------------------------------
|
|
http://schillmania.com/projects/soundmanager2/
|
|
|
|
Copyright (c) 2007, Scott Schiller. All rights reserved.
|
|
Code provided under the BSD License:
|
|
http://schillmania.com/projects/soundmanager2/license.txt
|
|
|
|
V2.97a.20110101
|
|
*/
|
|
(function(L){function pa(Fa,Ga){function qa(){if(b.debugURLParam.test(T))b.debugMode=true}this.flashVersion=8;this.debugFlash=this.debugMode=false;this.useConsole=true;this.waitForWindowLoad=this.consoleOnly=false;this.nullURL="about:blank";this.allowPolling=true;this.useFastPolling=false;this.useMovieStar=true;this.bgColor="#ffffff";this.useHighPerformance=false;this.flashPollingInterval=null;this.flashLoadTimeout=1E3;this.wmode=null;this.allowScriptAccess="always";this.useHTML5Audio=this.useFlashBlock=
|
|
false;this.html5Test=/^probably$/i;this.ondebuglog=false;this.audioFormats={mp3:{type:['audio/mpeg; codecs="mp3"',"audio/mpeg","audio/mp3","audio/MPA","audio/mpa-robust"],required:true},mp4:{related:["aac","m4a"],type:['audio/mp4; codecs="mp4a.40.2"',"audio/aac","audio/x-m4a","audio/MP4A-LATM","audio/mpeg4-generic"],required:true},ogg:{type:["audio/ogg; codecs=vorbis"],required:false},wav:{type:['audio/wav; codecs="1"',"audio/wav","audio/wave","audio/x-wav"],required:false}};this.defaultOptions={autoLoad:false,
|
|
stream:true,autoPlay:false,loops:1,onid3:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onstop:null,onfailure:null,onfinish:null,onbeforefinish:null,onbeforefinishtime:5E3,onbeforefinishcomplete:null,onjustbeforefinish:null,onjustbeforefinishtime:200,multiShot:true,multiShotEvents:false,position:null,pan:0,type:null,usePolicyFile:false,volume:100};this.flash9Options={isMovieStar:null,usePeakData:false,useWaveformData:false,useEQData:false,onbufferchange:null,
|
|
ondataerror:null,onstats:null};this.movieStarOptions={bufferTime:3,serverURL:null,onconnect:null,bufferTimes:null,duration:null};this.version=null;this.versionNumber="V2.97a.20110101";this.movieURL=null;this.url=Fa||null;this.altURL=null;this.enabled=this.swfLoaded=false;this.o=null;this.movieID="sm2-container";this.id=Ga||"sm2movie";this.swfCSS={swfBox:"sm2-object-box",swfDefault:"movieContainer",swfError:"swf_error",swfTimedout:"swf_timedout",swfUnblocked:"swf_unblocked",sm2Debug:"sm2_debug",highPerf:"high_performance",
|
|
flashDebug:"flash_debug"};this.oMC=null;this.sounds={};this.soundIDs=[];this.muted=false;this.debugID="soundmanager-debug";this.debugURLParam=/([#?&])debug=1/i;this.didFlashBlock=this.specialWmodeCase=false;this.filePattern=null;this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};this.baseMimeTypes=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;this.netStreamMimeTypes=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;this.netStreamTypes=["aac","flv","mov","mp4","m4v","f4v","m4a","mp4v",
|
|
"3gp","3g2"];this.netStreamPattern=RegExp("\\.("+this.netStreamTypes.join("|")+")(\\?.*)?$","i");this.mimePattern=this.baseMimeTypes;this.features={buffering:false,peakData:false,waveformData:false,eqData:false,movieStar:false};this.sandbox={};this.hasHTML5=null;this.html5={usingFlash:null};this.ignoreFlash=false;var ba,b=this,G,w=navigator.userAgent,T=L.location.href.toString(),p=this.flashVersion,k=document,n=L,ca,U,z=[],M=false,N=false,t=false,B=false,ra=false,O,v,da,C,H,ea,V,sa,fa,D,ta,P,I,ga,
|
|
ha,W,ia,ua,va,X,wa,Q=null,ja=null,E,ka,J,Y,Z,la,q,$=false,ma=false,xa,ya,F=null,za,aa,x=false,R,A,na,Aa,r,Ha=Array.prototype.slice,Ba=w.match(/pre\//i),Ia=w.match(/(ipad|iphone|ipod)/i);w.match(/mobile/i);var y=w.match(/MSIE/i),Ca=w.match(/webkit/i),S=w.match(/safari/i)&&!w.match(/chrome/i),oa=typeof k.hasFocus!=="undefined"?k.hasFocus():null,K=typeof k.hasFocus==="undefined"&&S,Da=!K;this._use_maybe=T.match(/sm2\-useHTML5Maybe\=1/i);this._overHTTP=k.location?k.location.protocol.match(/http/i):null;
|
|
this.useAltURL=!this._overHTTP;if(Ia||Ba){b.useHTML5Audio=true;b.ignoreFlash=true}if(Ba||this._use_maybe)b.html5Test=/^(probably|maybe)$/i;this.supported=this.ok=function(){return F?t&&!B:b.useHTML5Audio&&b.hasHTML5};this.getMovie=function(c){return y?n[c]:S?G(c)||k[c]:G(c)};this.createSound=function(c){function a(){g=Y(g);b.sounds[e.id]=new ba(e);b.soundIDs.push(e.id);return b.sounds[e.id]}var g=null,h=null,e=null;if(!t||!b.ok()){la("soundManager.createSound(): "+E(!t?"notReady":"notOK"));return false}if(arguments.length===
|
|
2)c={id:arguments[0],url:arguments[1]};e=g=v(c);if(q(e.id,true))return b.sounds[e.id];if(aa(e)){h=a();h._setup_html5(e)}else{if(p>8&&b.useMovieStar){if(e.isMovieStar===null)e.isMovieStar=e.serverURL||(e.type?e.type.match(b.netStreamPattern):false)||e.url.match(b.netStreamPattern)?true:false;if(e.isMovieStar)if(e.usePeakData)e.usePeakData=false}e=Z(e,"soundManager.createSound(): ");h=a();if(p===8)b.o._createSound(e.id,e.onjustbeforefinishtime,e.loops||1,e.usePolicyFile);else{b.o._createSound(e.id,
|
|
e.url,e.onjustbeforefinishtime,e.usePeakData,e.useWaveformData,e.useEQData,e.isMovieStar,e.isMovieStar?e.bufferTime:false,e.loops||1,e.serverURL,e.duration||null,e.autoPlay,true,e.bufferTimes,e.onstats?true:false,e.autoLoad,e.usePolicyFile);if(!e.serverURL){h.connected=true;e.onconnect&&e.onconnect.apply(h)}}}if(e.autoLoad||e.autoPlay)if(h)if(b.isHTML5){h.autobuffer="auto";h.preload="auto"}else h.load(e);e.autoPlay&&h.play();return h};this.destroySound=function(c,a){if(!q(c))return false;var g=b.sounds[c],
|
|
h;g._iO={};g.stop();g.unload();for(h=0;h<b.soundIDs.length;h++)if(b.soundIDs[h]===c){b.soundIDs.splice(h,1);break}a||g.destruct(true);delete b.sounds[c];return true};this.load=function(c,a){if(!q(c))return false;return b.sounds[c].load(a)};this.unload=function(c){if(!q(c))return false;return b.sounds[c].unload()};this.start=this.play=function(c,a){if(!t||!b.ok()){la("soundManager.play(): "+E(!t?"notReady":"notOK"));return false}if(!q(c)){a instanceof Object||(a={url:a});if(a&&a.url){a.id=c;return b.createSound(a).play()}else return false}return b.sounds[c].play(a)};
|
|
this.setPosition=function(c,a){if(!q(c))return false;return b.sounds[c].setPosition(a)};this.stop=function(c){if(!q(c))return false;return b.sounds[c].stop()};this.stopAll=function(){for(var c in b.sounds)b.sounds[c]instanceof ba&&b.sounds[c].stop()};this.pause=function(c){if(!q(c))return false;return b.sounds[c].pause()};this.pauseAll=function(){for(var c=b.soundIDs.length;c--;)b.sounds[b.soundIDs[c]].pause()};this.resume=function(c){if(!q(c))return false;return b.sounds[c].resume()};this.resumeAll=
|
|
function(){for(var c=b.soundIDs.length;c--;)b.sounds[b.soundIDs[c]].resume()};this.togglePause=function(c){if(!q(c))return false;return b.sounds[c].togglePause()};this.setPan=function(c,a){if(!q(c))return false;return b.sounds[c].setPan(a)};this.setVolume=function(c,a){if(!q(c))return false;return b.sounds[c].setVolume(a)};this.mute=function(c){var a=0;if(typeof c!=="string")c=null;if(c){if(!q(c))return false;return b.sounds[c].mute()}else{for(a=b.soundIDs.length;a--;)b.sounds[b.soundIDs[a]].mute();
|
|
b.muted=true}return true};this.muteAll=function(){b.mute()};this.unmute=function(c){if(typeof c!=="string")c=null;if(c){if(!q(c))return false;return b.sounds[c].unmute()}else{for(c=b.soundIDs.length;c--;)b.sounds[b.soundIDs[c]].unmute();b.muted=false}return true};this.unmuteAll=function(){b.unmute()};this.toggleMute=function(c){if(!q(c))return false;return b.sounds[c].toggleMute()};this.getMemoryUse=function(){if(p===8)return 0;if(b.o)return parseInt(b.o._getMemoryUse(),10)};this.disable=function(c){if(typeof c===
|
|
"undefined")c=false;if(B)return false;B=true;for(var a=b.soundIDs.length;a--;)va(b.sounds[b.soundIDs[a]]);O(c);r.remove(n,"load",H);return true};this.canPlayMIME=function(c){var a;if(b.hasHTML5)a=R({type:c});return!F||a?a:c?c.match(b.mimePattern)?true:false:null};this.canPlayURL=function(c){var a;if(b.hasHTML5)a=R(c);return!F||a?a:c?c.match(b.filePattern)?true:false:null};this.canPlayLink=function(c){if(typeof c.type!=="undefined"&&c.type)if(b.canPlayMIME(c.type))return true;return b.canPlayURL(c.href)};
|
|
this.getSoundById=function(c){if(!c)throw Error("SoundManager.getSoundById(): sID is null/undefined");return b.sounds[c]};this.onready=function(c,a){if(c&&c instanceof Function){a||(a=n);da("onready",c,a);C();return true}else throw E("needFunction","onready");};this.ontimeout=function(c,a){if(c&&c instanceof Function){a||(a=n);da("ontimeout",c,a);C({type:"ontimeout"});return true}else throw E("needFunction","ontimeout");};this.getMoviePercent=function(){return b.o&&typeof b.o.PercentLoaded!=="undefined"?
|
|
b.o.PercentLoaded():null};this._wD=this._writeDebug=function(c,a,g){b.ondebuglog&&b.ondebuglog(c,a,g);return true};this._debug=function(){};this.reboot=function(){var c,a;for(c=b.soundIDs.length;c--;)b.sounds[b.soundIDs[c]].destruct();try{if(y)ja=b.o.innerHTML;Q=b.o.parentNode.removeChild(b.o)}catch(g){}ja=Q=null;b.enabled=t=$=ma=M=N=B=b.swfLoaded=false;b.soundIDs=b.sounds=[];b.o=null;for(c in z)if(z.hasOwnProperty(c))for(a=z[c].length;a--;)z[c][a].fired=false;n.setTimeout(function(){b.beginDelayedInit()},
|
|
20)};this.destruct=function(){b.disable(true)};this.beginDelayedInit=function(){ra=true;I();setTimeout(ta,20);V()};ba=function(c){var a=this,g,h,e,j,o,l,i;this.sID=c.id;this.url=c.url;this._iO=this.instanceOptions=this.options=v(c);this.pan=this.options.pan;this.volume=this.options.volume;this._lastURL=null;this.isHTML5=false;this.id3={};this._debug=function(){};this._debug();this.load=function(d){var f=null;if(typeof d!=="undefined"){a._iO=v(d);a.instanceOptions=a._iO}else{d=a.options;a._iO=d;a.instanceOptions=
|
|
a._iO;if(a._lastURL&&a._lastURL!==a.url){a._iO.url=a.url;a.url=null}}if(a._iO.url===a.url&&a.readyState!==0&&a.readyState!==2)return a;a._lastURL=a.url;a.loaded=false;a.readyState=1;a.playState=0;if(aa(a._iO)){f=a._setup_html5(a._iO);f.load();a._iO.autoPlay&&a.play()}else try{a.isHTML5=false;a._iO=Z(Y(a._iO));p===8?b.o._load(a.sID,a._iO.url,a._iO.stream,a._iO.autoPlay,a._iO.whileloading?1:0,a._iO.loops||1,a._iO.usePolicyFile):b.o._load(a.sID,a._iO.url,a._iO.stream?true:false,a._iO.autoPlay?true:false,
|
|
a._iO.loops||1,a._iO.autoLoad?true:false,a._iO.usePolicyFile)}catch(m){ia()}return a};this.unload=function(){if(a.readyState!==0){if(a.isHTML5){j();if(i){i.pause();i.src=""}}else p===8?b.o._unload(a.sID,b.nullURL):b.o._unload(a.sID);g()}return a};this.destruct=function(d){if(a.isHTML5){j();if(i){i.pause();i.src="about:blank";i.load();i=a._audio=null}}else{a._iO.onfailure=null;b.o._destroySound(a.sID)}d||b.destroySound(a.sID,true)};this.start=this.play=function(d,f){var m;f=typeof f==="undefined"?
|
|
true:f;d||(d={});a._iO=v(d,a._iO);a._iO=v(a._iO,a.options);a.instanceOptions=a._iO;if(a._iO.serverURL)if(!a.connected){a.getAutoPlay()||a.setAutoPlay(true);return a}if(aa(a._iO)){a._setup_html5(a._iO);o()}if(a.playState===1&&!a.paused)if(m=a._iO.multiShot)a.isHTML5&&a.setPosition(a._iO.position);else return a;if(!a.loaded)if(a.readyState===0)if(a.isHTML5){a.load(a._iO);a.readyState=1}else{if(!a._iO.serverURL){a._iO.autoPlay=true;a.load(a._iO)}}else if(a.readyState===2)return a;if(a.paused&&a.position&&
|
|
a.position>0)a.resume();else{a.playState=1;a.paused=false;if(!a.instanceCount||a._iO.multiShotEvents||p>8&&!a.isHTML5&&!a.getAutoPlay())a.instanceCount++;a.position=typeof a._iO.position!=="undefined"&&!isNaN(a._iO.position)?a._iO.position:0;if(!a.isHTML5)a._iO=Z(Y(a._iO));if(a._iO.onplay&&f){a._iO.onplay.apply(a);a._onplay_called=true}a.setVolume(a._iO.volume,true);a.setPan(a._iO.pan,true);if(a.isHTML5){o();a._setup_html5().play()}else b.o._start(a.sID,a._iO.loops||1,p===9?a.position:a.position/
|
|
1E3)}return a};this.stop=function(d){if(a.playState===1){a._onbufferchange(0);a.resetOnPosition(0);if(!a.isHTML5)a.playState=0;a.paused=false;a._iO.onstop&&a._iO.onstop.apply(a);if(a.isHTML5){if(i){a.setPosition(0);i.pause();a.playState=0;a._onTimer();j();a.unload()}}else{b.o._stop(a.sID,d);a._iO.serverURL&&a.unload()}a.instanceCount=0;a._iO={}}return a};this.setAutoPlay=function(d){a._iO.autoPlay=d;b.o._setAutoPlay(a.sID,d);d&&!a.instanceCount&&a.readyState===1&&a.instanceCount++};this.getAutoPlay=
|
|
function(){return a._iO.autoPlay};this.setPosition=function(d){if(d===undefined)d=0;d=a.isHTML5?Math.max(d,0):Math.min(a.duration||a._iO.duration,Math.max(d,0));a.position=d;a.resetOnPosition(a.position);a._iO.position=d;if(a.isHTML5){if(i){if(a.playState)try{i.currentTime=a.position/1E3}catch(f){}if(a.paused){a._onTimer(true);a._iO.useMovieStar&&a.resume()}}}else{d=p===9?a.position:a.position/1E3;a.serverURL&&a.playState===0?a.play({position:d}):b.o._setPosition(a.sID,d,a.paused||!a.playState)}return a};
|
|
this.pause=function(d){if(a.paused||a.playState===0&&a.readyState!==1)return a;a.paused=true;if(a.isHTML5){a._setup_html5().pause();j()}else if(d||d===undefined)b.o._pause(a.sID);a._iO.onpause&&a._iO.onpause.apply(a);return a};this.resume=function(){if(!a.paused)return a;a.paused=false;a.playState=1;if(a.isHTML5){a._setup_html5().play();o()}else{b.o._pause(a.sID);a._iO.isMovieStar&&Ca&&a.setPosition(a.position)}if(!a._onplay_called&&a._iO.onplay){a._iO.onplay.apply(a);a._onplay_called=true}else a._iO.onresume&&
|
|
a._iO.onresume.apply(a);return a};this.togglePause=function(){if(a.playState===0){a.play({position:p===9&&!a.isHTML5?a.position:a.position/1E3});return a}a.paused?a.resume():a.pause();return a};this.setPan=function(d,f){if(typeof d==="undefined")d=0;if(typeof f==="undefined")f=false;a.isHTML5||b.o._setPan(a.sID,d);a._iO.pan=d;if(!f)a.pan=d;return a};this.setVolume=function(d,f){if(typeof d==="undefined")d=100;if(typeof f==="undefined")f=false;if(a.isHTML5){if(i)i.volume=d/100}else b.o._setVolume(a.sID,
|
|
b.muted&&!a.muted||a.muted?0:d);a._iO.volume=d;if(!f)a.volume=d;return a};this.mute=function(){a.muted=true;if(a.isHTML5){if(i)i.muted=true}else b.o._setVolume(a.sID,0);return a};this.unmute=function(){a.muted=false;var d=typeof a._iO.volume!=="undefined";if(a.isHTML5){if(i)i.muted=false}else b.o._setVolume(a.sID,d?a._iO.volume:a.options.volume);return a};this.toggleMute=function(){return a.muted?a.unmute():a.mute()};this.onposition=function(d,f,m){a._onPositionItems.push({position:d,method:f,scope:typeof m!==
|
|
"undefined"?m:a,fired:false});return a};this.processOnPosition=function(){var d,f;d=a._onPositionItems.length;if(!d||!a.playState||a._onPositionFired>=d)return false;for(d=d;d--;){f=a._onPositionItems[d];if(!f.fired&&a.position>=f.position){f.method.apply(f.scope,[f.position]);f.fired=true;b._onPositionFired++}}return true};this.resetOnPosition=function(d){var f,m;f=a._onPositionItems.length;if(!f)return false;for(f=f;f--;){m=a._onPositionItems[f];if(m.fired&&d<=m.position){m.fired=false;b._onPositionFired--}}return true};
|
|
this._onTimer=function(d){var f={};if(a._hasTimer||d)if(i&&(d||(a.playState>0||a.readyState===1)&&!a.paused)){a.duration=l();a.durationEstimate=a.duration;d=i.currentTime?i.currentTime*1E3:0;a._whileplaying(d,f,f,f,f);return true}else return false};l=function(){var d=i?i.duration*1E3:undefined;return d&&!isNaN(d)?d:null};o=function(){a.isHTML5&&xa(a)};j=function(){a.isHTML5&&ya(a)};g=function(){a._onPositionItems=[];a._onPositionFired=0;a._hasTimer=null;a._added_events=null;a._onplay_called=false;
|
|
i=a._audio=null;a.bytesLoaded=null;a.bytesTotal=null;a.position=null;a.duration=a._iO&&a._iO.duration?a._iO.duration:null;a.durationEstimate=null;a.failures=0;a.loaded=false;a.playState=0;a.paused=false;a.readyState=0;a.muted=false;a.didBeforeFinish=false;a.didJustBeforeFinish=false;a.isBuffering=false;a.instanceOptions={};a.instanceCount=0;a.peakData={left:0,right:0};a.waveformData={left:[],right:[]};a.eqData=[];a.eqData.left=[];a.eqData.right=[]};g();this._setup_html5=function(d){d=v(a._iO,d);if(i){if(a.url!==
|
|
d.url)i.src=d.url}else{a._audio=new Audio(d.url);i=a._audio;a.isHTML5=true;h()}i.loop=d.loops>1?"loop":"";return a._audio};e={canplay:function(){a._onbufferchange(0)},load:function(){if(i&&!a.loaded){a._onbufferchange(0);a._whileloading(a.bytesTotal,a.bytesTotal,l());a._onload(true)}},ended:function(){a._onfinish()},error:function(){i&&a._onload(false)},loadstart:function(){a._onbufferchange(1)},play:function(){a._onbufferchange(0)},playing:function(){a._onbufferchange(0)},progress:function(d){if(!i||
|
|
a.loaded)return false;var f,m=0,s=d.target.buffered;f=d.loaded||0;var u=d.total||1;if(s&&s.length){for(f=s.length;f--;)m=s.end(f)-s.start(f);f=m/d.target.duration}a._onbufferchange(0);a._whileloading(f,u,l());f&&u&&f===u&&e.load()},suspend:function(d){e.progress(d)},timeupdate:function(){a._onTimer()},waiting:function(){a._onbufferchange(1)}};h=function(){if(a._added_events)return false;var d;a._added_events=true;for(d in e)e.hasOwnProperty(d)&&i&&i.addEventListener(d,e[d],false);return true};this._whileloading=
|
|
function(d,f,m,s){a.bytesLoaded=d;a.bytesTotal=f;a.duration=Math.floor(m);a.bufferLength=s;if(a._iO.isMovieStar)a.durationEstimate=a.duration;else{a.durationEstimate=a._iO.duration?a.duration>a._iO.duration?a.duration:a._iO.duration:parseInt(a.bytesTotal/a.bytesLoaded*a.duration,10);if(a.durationEstimate===undefined)a.durationEstimate=a.duration}a.readyState!==3&&a._iO.whileloading&&a._iO.whileloading.apply(a)};this._onid3=function(d,f){var m=[],s,u;s=0;for(u=d.length;s<u;s++)m[d[s]]=f[s];a.id3=v(a.id3,
|
|
m);a._iO.onid3&&a._iO.onid3.apply(a)};this._whileplaying=function(d,f,m,s,u){if(isNaN(d)||d===null)return false;if(a.playState===0&&d>0)d=0;a.position=d;a.processOnPosition();if(p>8&&!a.isHTML5){if(a._iO.usePeakData&&typeof f!=="undefined"&&f)a.peakData={left:f.leftPeak,right:f.rightPeak};if(a._iO.useWaveformData&&typeof m!=="undefined"&&m)a.waveformData={left:m.split(","),right:s.split(",")};if(a._iO.useEQData)if(typeof u!=="undefined"&&u&&u.leftEQ){d=u.leftEQ.split(",");a.eqData=d;a.eqData.left=
|
|
d;if(typeof u.rightEQ!=="undefined"&&u.rightEQ)a.eqData.right=u.rightEQ.split(",")}}if(a.playState===1){!a.isHTML5&&b.flashVersion===8&&!a.position&&a.isBuffering&&a._onbufferchange(0);a._iO.whileplaying&&a._iO.whileplaying.apply(a);if((a.loaded||!a.loaded&&a._iO.isMovieStar)&&a._iO.onbeforefinish&&a._iO.onbeforefinishtime&&!a.didBeforeFinish&&a.duration-a.position<=a._iO.onbeforefinishtime)a._onbeforefinish()}return true};this._onconnect=function(d){d=d===1;if(a.connected=d){a.failures=0;a._iO.onconnect&&
|
|
a._iO.onconnect.apply(a,[d]);if(q(a.sID)&&(a.options.autoLoad||a.getAutoPlay()))a.play(undefined,a.getAutoPlay())}};this._onload=function(d){d=d?true:false;a.loaded=d;a.readyState=d?3:2;a._onbufferchange(0);a._iO.onload&&a._iO.onload.apply(a,[d]);return true};this._onfailure=function(d,f,m){a.failures++;a._iO.onfailure&&a.failures===1&&a._iO.onfailure(a,d,f,m)};this._onbeforefinish=function(){if(!a.didBeforeFinish){a.didBeforeFinish=true;a._iO.onbeforefinish&&a._iO.onbeforefinish.apply(a)}};this._onjustbeforefinish=
|
|
function(){if(!a.didJustBeforeFinish){a.didJustBeforeFinish=true;a._iO.onjustbeforefinish&&a._iO.onjustbeforefinish.apply(a)}};this._onstats=function(d){a._iO.onstats&&a._iO.onstats(a,d)};this._onfinish=function(){a._onbufferchange(0);a.resetOnPosition(0);a._iO.onbeforefinishcomplete&&a._iO.onbeforefinishcomplete.apply(a);a.didBeforeFinish=false;a.didJustBeforeFinish=false;if(a.instanceCount){a.instanceCount--;if(!a.instanceCount){a.playState=0;a.paused=false;a.instanceCount=0;a.instanceOptions={};
|
|
j()}if(!a.instanceCount||a._iO.multiShotEvents)a._iO.onfinish&&a._iO.onfinish.apply(a)}};this._onbufferchange=function(d){if(a.playState===0)return false;if(d&&a.isBuffering||!d&&!a.isBuffering)return false;a.isBuffering=d===1;a._iO.onbufferchange&&a._iO.onbufferchange.apply(a);return true};this._ondataerror=function(){a.playState>0&&a._iO.ondataerror&&a._iO.ondataerror.apply(a)}};ha=function(){return k.body?k.body:k._docElement?k.documentElement:k.getElementsByTagName("div")[0]};G=function(c){return k.getElementById(c)};
|
|
v=function(c,a){var g={},h,e;for(h in c)if(c.hasOwnProperty(h))g[h]=c[h];h=typeof a==="undefined"?b.defaultOptions:a;for(e in h)if(h.hasOwnProperty(e)&&typeof g[e]==="undefined")g[e]=h[e];return g};r=function(){function c(e){e=Ha.call(e);var j=e.length;if(g){e[1]="on"+e[1];j>3&&e.pop()}else j===3&&e.push(false);return e}function a(e,j){var o=e.shift(),l=[h[j]];g?o[l](e[0],e[1]):o[l].apply(o,e)}var g=n.attachEvent,h={add:g?"attachEvent":"addEventListener",remove:g?"detachEvent":"removeEventListener"};
|
|
return{add:function(){a(c(arguments),"add")},remove:function(){a(c(arguments),"remove")}}}();aa=function(c){return c.type?R({type:c.type}):R(c.url)||x};R=function(c){if(!b.useHTML5Audio||!b.hasHTML5)return false;var a,g=b.audioFormats;if(!A){A=[];for(a in g)if(g.hasOwnProperty(a)){A.push(a);if(g[a].related)A=A.concat(g[a].related)}A=RegExp("\\.("+A.join("|")+")","i")}a=typeof c.type!=="undefined"?c.type:null;c=typeof c==="string"?c.toLowerCase().match(A):null;if(!c||!c.length){if(!a)return false}else c=
|
|
c[0].substr(1);if(c&&typeof b.html5[c]!=="undefined")return b.html5[c];else{if(!a)if(c&&b.html5[c])return b.html5[c];else a="audio/"+c;a=b.html5.canPlayType(a);return b.html5[c]=a}};Aa=function(){function c(o){var l,i,d=false;if(!a||typeof a.canPlayType!=="function")return false;if(o instanceof Array){l=0;for(i=o.length;l<i&&!d;l++)if(b.html5[o[l]]||a.canPlayType(o[l]).match(b.html5Test)){d=true;b.html5[o[l]]=true}return d}else return(o=a&&typeof a.canPlayType==="function"?a.canPlayType(o):false)&&
|
|
(o.match(b.html5Test)?true:false)}if(!b.useHTML5Audio||typeof Audio==="undefined")return false;var a=typeof Audio!=="undefined"?new Audio:null,g,h={},e,j;e=b.audioFormats;for(g in e)if(e.hasOwnProperty(g)){h[g]=c(e[g].type);if(e[g]&&e[g].related)for(j=0;j<e[g].related.length;j++)b.html5[e[g].related[j]]=h[g]}h.canPlayType=a?c:null;b.html5=v(b.html5,h);return true};E=function(){};Y=function(c){if(p===8&&c.loops>1&&c.stream)c.stream=false;return c};Z=function(c){if(c&&!c.usePolicyFile&&(c.onid3||c.usePeakData||
|
|
c.useWaveformData||c.useEQData))c.usePolicyFile=true;return c};la=function(c){typeof console!=="undefined"&&typeof console.warn!=="undefined"&&console.warn(c)};ca=function(){return false};va=function(c){for(var a in c)if(c.hasOwnProperty(a)&&typeof c[a]==="function")c[a]=ca};X=function(c){if(typeof c==="undefined")c=false;if(B||c)b.disable(c)};wa=function(c){var a=null;if(c)if(c.match(/\.swf(\?.*)?$/i)){if(a=c.substr(c.toLowerCase().lastIndexOf(".swf?")+4))return c}else if(c.lastIndexOf("/")!==c.length-
|
|
1)c+="/";return(c&&c.lastIndexOf("/")!==-1?c.substr(0,c.lastIndexOf("/")+1):"./")+b.movieURL};fa=function(){if(p!==8&&p!==9)b.flashVersion=8;var c=b.debugMode||b.debugFlash?"_debug.swf":".swf";if(b.useHTML5Audio&&!x&&b.audioFormats.mp4.required&&b.flashVersion<9)b.flashVersion=9;p=b.flashVersion;b.version=b.versionNumber+(x?" (HTML5-only mode)":p===9?" (AS3/Flash 9)":" (AS2/Flash 8)");if(p>8){b.defaultOptions=v(b.defaultOptions,b.flash9Options);b.features.buffering=true}if(p>8&&b.useMovieStar){b.defaultOptions=
|
|
v(b.defaultOptions,b.movieStarOptions);b.filePatterns.flash9=RegExp("\\.(mp3|"+b.netStreamTypes.join("|")+")(\\?.*)?$","i");b.mimePattern=b.netStreamMimeTypes;b.features.movieStar=true}else{b.useMovieStar=false;b.features.movieStar=false}b.filePattern=b.filePatterns[p!==8?"flash9":"flash8"];b.movieURL=(p===8?"soundmanager2.swf":"soundmanager2_flash9.swf").replace(".swf",c);b.features.peakData=b.features.waveformData=b.features.eqData=p>8};ua=function(c,a){if(!b.o||!b.allowPolling)return false;b.o._setPolling(c,
|
|
a)};W=function(c,a){var g=a?a:b.url,h=b.altURL?b.altURL:g,e;e=ha();var j,o,l=J(),i,d=null;d=(d=k.getElementsByTagName("html")[0])&&d.dir&&d.dir.match(/rtl/i);c=typeof c==="undefined"?b.id:c;if(M&&N)return false;if(x){fa();b.oMC=G(b.movieID);U();N=M=true;return false}M=true;fa();b.url=wa(b._overHTTP?g:h);a=b.url;b.wmode=!b.wmode&&b.useHighPerformance&&!b.useMovieStar?"transparent":b.wmode;if(b.wmode!==null&&!y&&!b.useHighPerformance&&navigator.platform.match(/win32/i)){b.specialWmodeCase=true;b.wmode=
|
|
null}e={name:c,id:c,src:a,width:"100%",height:"100%",quality:"high",allowScriptAccess:b.allowScriptAccess,bgcolor:b.bgColor,pluginspage:"http://www.macromedia.com/go/getflashplayer",type:"application/x-shockwave-flash",wmode:b.wmode};if(b.debugFlash)e.FlashVars="debug=1";b.wmode||delete e.wmode;if(y){g=k.createElement("div");o='<object id="'+c+'" data="'+a+'" type="'+e.type+'" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+a+'" /><param name="AllowScriptAccess" value="'+b.allowScriptAccess+
|
|
'" /><param name="quality" value="'+e.quality+'" />'+(b.wmode?'<param name="wmode" value="'+b.wmode+'" /> ':"")+'<param name="bgcolor" value="'+b.bgColor+'" />'+(b.debugFlash?'<param name="FlashVars" value="'+e.FlashVars+'" />':"")+"<!-- --\></object>"}else{g=k.createElement("embed");for(j in e)e.hasOwnProperty(j)&&g.setAttribute(j,e[j])}qa();l=J();if(e=ha()){b.oMC=G(b.movieID)?G(b.movieID):k.createElement("div");if(b.oMC.id){i=b.oMC.className;b.oMC.className=(i?i+" ":b.swfCSS.swfDefault)+(l?" "+
|
|
l:"");b.oMC.appendChild(g);if(y){j=b.oMC.appendChild(k.createElement("div"));j.className=b.swfCSS.swfBox;j.innerHTML=o}N=true}else{b.oMC.id=b.movieID;b.oMC.className=b.swfCSS.swfDefault+" "+l;j=l=null;if(!b.useFlashBlock)if(b.useHighPerformance)l={position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",overflow:"hidden",hasPriority:"true"};else{l={position:"absolute",width:"6px",height:"6px",top:"-9999px",left:"-9999px",hasPriority:"true"};if(d)l.left=Math.abs(parseInt(l.left,10))+"px"}if(Ca)b.oMC.style.zIndex=
|
|
1E4;if(!b.debugFlash)for(i in l)if(l.hasOwnProperty(i))b.oMC.style[i]=l[i];try{y||b.oMC.appendChild(g);e.appendChild(b.oMC);if(y){j=b.oMC.appendChild(k.createElement("div"));j.className=b.swfCSS.swfBox;j.innerHTML=o}N=true}catch(f){throw Error(E("appXHTML"));}}}return true};q=this.getSoundById;P=function(){if(x){W();return false}if(b.o)return false;b.o=b.getMovie(b.id);if(!b.o){if(Q){if(y)b.oMC.innerHTML=ja;else b.oMC.appendChild(Q);Q=null;M=true}else W(b.id,b.url);b.o=b.getMovie(b.id)}b.oninitmovie instanceof
|
|
Function&&setTimeout(b.oninitmovie,1);return true};ea=function(c){if(c)b.url=c;P()};V=function(){setTimeout(sa,500)};sa=function(){if($)return false;$=true;r.remove(n,"load",V);if(K&&!oa)return false;var c;t||(c=b.getMoviePercent());setTimeout(function(){c=b.getMoviePercent();if(!t&&Da)if(c===null)if(b.useFlashBlock||b.flashLoadTimeout===0)b.useFlashBlock&&ka();else X(true);else b.flashLoadTimeout!==0&&X(true)},b.flashLoadTimeout)};ea=function(c){if(c)b.url=c;P()};J=function(){var c=[];b.debugMode&&
|
|
c.push(b.swfCSS.sm2Debug);b.debugFlash&&c.push(b.swfCSS.flashDebug);b.useHighPerformance&&c.push(b.swfCSS.highPerf);return c.join(" ")};ka=function(){E("fbHandler");var c=b.getMoviePercent();if(b.ok()){if(b.oMC)b.oMC.className=J()+" "+b.swfCSS.swfDefault+(" "+b.swfCSS.swfUnblocked)}else{if(F)b.oMC.className=J()+" "+b.swfCSS.swfDefault+" "+(c===null?b.swfCSS.swfTimedout:b.swfCSS.swfError);b.didFlashBlock=true;C({type:"ontimeout",ignoreInit:true});b.onerror instanceof Function&&b.onerror.apply(n)}};
|
|
D=function(){function c(){r.remove(n,"focus",D);r.remove(n,"load",D)}if(oa||!K){c();return true}oa=Da=true;S&&K&&r.remove(n,"mousemove",D);$=false;c();return true};O=function(c){if(t)return false;if(x){t=true;C();H();return true}b.useFlashBlock&&b.flashLoadTimeout&&!b.getMoviePercent()||(t=true);if(B||c){if(b.useFlashBlock)b.oMC.className=J()+" "+(b.getMoviePercent()===null?b.swfCSS.swfTimedout:b.swfCSS.swfError);C({type:"ontimeout"});b.onerror instanceof Function&&b.onerror.apply(n);return false}r.add(L,
|
|
"unload",ca);if(b.waitForWindowLoad&&!ra){r.add(n,"load",H);return false}else H();return true};da=function(c,a,g){if(typeof z[c]==="undefined")z[c]=[];z[c].push({method:a,scope:g||null,fired:false})};C=function(c){c||(c={type:"onready"});if(!t&&c&&!c.ignoreInit)return false;var a={success:c&&c.ignoreInit?b.ok():!B},g=c&&c.type?z[c.type]||[]:[];c=[];var h,e=F&&b.useFlashBlock&&!b.ok();for(h=0;h<g.length;h++)g[h].fired!==true&&c.push(g[h]);if(c.length){h=0;for(g=c.length;h<g;h++){c[h].scope?c[h].method.apply(c[h].scope,
|
|
[a]):c[h].method(a);if(!e)c[h].fired=true}}return true};H=function(){n.setTimeout(function(){b.useFlashBlock&&ka();C();b.onload instanceof Function&&b.onload.apply(n);b.waitForWindowLoad&&r.add(n,"load",H)},1)};za=function(){var c,a,g=!T.match(/usehtml5audio/i)&&!T.match(/sm2\-ignorebadua/i)&&S&&w.match(/OS X 10_6_(3|4|5)/i);if(w.match(/iphone os (1|2|3_0|3_1)/i)?true:false){b.hasHTML5=false;x=true;if(b.oMC)b.oMC.style.display="none";return false}if(b.useHTML5Audio){if(!b.html5||!b.html5.canPlayType){b.hasHTML5=
|
|
false;return true}else b.hasHTML5=true;if(g){b.useHTML5Audio=false;b.hasHTML5=false;return true}}else return true;for(a in b.audioFormats)if(b.audioFormats.hasOwnProperty(a)&&b.audioFormats[a].required&&!b.html5.canPlayType(b.audioFormats[a].type))c=true;if(b.ignoreFlash)c=false;x=b.useHTML5Audio&&b.hasHTML5&&!c;return c};U=function(){var c,a=[];if(t)return false;if(b.hasHTML5)for(c in b.audioFormats)b.audioFormats.hasOwnProperty(c)&&a.push(c+": "+b.html5[c]);if(x){if(!t){r.remove(n,"load",b.beginDelayedInit);
|
|
b.enabled=true;O()}return true}P();try{b.o._externalInterfaceTest(false);if(b.allowPolling)ua(true,b.flashPollingInterval?b.flashPollingInterval:b.useFastPolling?10:50);b.debugMode||b.o._disableDebug();b.enabled=true}catch(g){X(true);O();return false}O();r.remove(n,"load",b.beginDelayedInit);return true};ta=function(){if(ma)return false;W();P();return ma=true};I=function(){if(ga)return false;ga=true;qa();Aa();b.html5.usingFlash=za();F=b.html5.usingFlash;ga=true;k.removeEventListener&&k.removeEventListener("DOMContentLoaded",
|
|
I,false);ea();return true};xa=function(c){if(!c._hasTimer)c._hasTimer=true};ya=function(c){if(c._hasTimer)c._hasTimer=false};ia=function(){b.onerror instanceof Function&&b.onerror();b.disable()};this._setSandboxType=function(){};this._externalInterfaceOK=function(){if(b.swfLoaded)return false;(new Date).getTime();b.swfLoaded=true;K=false;y?setTimeout(U,100):U()};na=function(){if(k.readyState==="complete"){I();k.detachEvent("onreadystatechange",na)}return true};if(!b.hasHTML5||F){r.add(n,"focus",D);
|
|
r.add(n,"load",D);r.add(n,"load",V);S&&K&&r.add(n,"mousemove",D)}if(k.addEventListener)k.addEventListener("DOMContentLoaded",I,false);else k.attachEvent?k.attachEvent("onreadystatechange",na):ia();k.readyState==="complete"&&setTimeout(I,100)}var Ea=null;if(typeof SM2_DEFER==="undefined"||!SM2_DEFER)Ea=new pa;L.SoundManager=pa;L.soundManager=Ea})(window);
|