soundmanager-rails 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/soundmanager-rails/version.rb +1 -1
- data/vendor/assets/images/swf/soundmanager2.swf +0 -0
- data/vendor/assets/images/swf/soundmanager2_debug.swf +0 -0
- data/vendor/assets/images/swf/soundmanager2_flash9.swf +0 -0
- data/vendor/assets/images/swf/soundmanager2_flash9_debug.swf +0 -0
- data/vendor/assets/javascripts/soundmanager2-jsmin.js +93 -97
- data/vendor/assets/javascripts/soundmanager2-nodebug-jsmin.js +67 -69
- data/vendor/assets/javascripts/soundmanager2-nodebug.js +1174 -1139
- data/vendor/assets/javascripts/soundmanager2.js +1643 -1484
- metadata +3 -4
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -9,102 +9,98 @@
|
|
9
9
|
Code provided under the BSD License:
|
10
10
|
http://schillmania.com/projects/soundmanager2/license.txt
|
11
11
|
|
12
|
-
V2.97a.
|
12
|
+
V2.97a.20130101
|
13
13
|
*/
|
14
|
-
(function(
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
a
|
29
|
-
|
30
|
-
(c
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
1;
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
b.
|
43
|
-
b.
|
44
|
-
b.
|
45
|
-
|
46
|
-
|
47
|
-
a,(0===b.
|
48
|
-
(
|
49
|
-
|
50
|
-
a;return
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
b.
|
61
|
-
|
62
|
-
|
63
|
-
a.
|
64
|
-
|
65
|
-
|
66
|
-
e
|
67
|
-
"
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
spcWmode:"soundManager::createMovie(): Removing wmode, preventing known SWF loading issue(s)",swf404:"soundManager: Verify that %s is a valid path.",tryDebug:"Try soundManager.debugFlash = true for more security details (output goes to SWF.)",checkSWF:"See SWF output for more debug info.",localFail:"soundManager: Non-HTTP page ("+i.location.protocol+" URL?) Review Flash player security settings for this special case:\nhttp://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html\nMay need to add/allow path, eg. c:/sm2/ or /users/me/sm2/",
|
76
|
-
waitFocus:"soundManager: Special case: Waiting for SWF to load with window focus...",waitImpatient:"soundManager: Getting impatient, still waiting for Flash%s...",waitForever:"soundManager: Waiting indefinitely for Flash (will recover if unblocked)...",waitSWF:"soundManager: Retrying, waiting for 100% SWF load...",needFunction:"soundManager: Function object expected for %s",badID:'Warning: Sound ID "%s" should be a string, starting with a non-numeric character',currentObj:"--- soundManager._debug(): Current sound objects ---",
|
77
|
-
waitEI:"soundManager::initMovie(): Waiting for ExternalInterface call from Flash...",waitOnload:"soundManager: Waiting for window.onload()",docLoaded:"soundManager: Document already loaded",onload:"soundManager::initComplete(): calling soundManager.onload()",onloadOK:"soundManager.onload() complete",init:"soundManager::init()",didInit:"soundManager::init(): Already called?",flashJS:"soundManager: Attempting JS to Flash call...",secNote:"Flash security note: Network/internet URLs will not load due to security restrictions. Access can be configured via Flash Player Global Security Settings Page: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html",
|
78
|
-
badRemove:"Warning: Failed to remove flash movie.",shutdown:"soundManager.disable(): Shutting down",queue:"soundManager: Queueing %s handler",smFail:"soundManager: Failed to initialise.",smError:"SMSound.load(): Exception: JS-Flash communication failed, or JS error.",fbTimeout:"No flash response, applying .swf_timedout CSS...",fbLoaded:"Flash loaded",fbHandler:"soundManager::flashBlockHandler()",manURL:"SMSound.load(): Using manually-assigned URL",onURL:"soundManager.load(): current URL already assigned.",
|
14
|
+
(function(j,g){function aa(aa,pa){function ba(a){return c.preferFlash&&z&&!c.ignoreFlash&&c.flash[a]!==g&&c.flash[a]}function q(a){return function(d){var e=this._s;!e||!e._a?(e&&e.id?c._wD(e.id+": Ignoring "+d.type):c._wD(pb+"Ignoring "+d.type),d=null):d=a.call(this,d);return d}}this.setupOptions={url:aa||null,flashVersion:8,debugMode:!0,debugFlash:!1,useConsole:!0,consoleOnly:!0,waitForWindowLoad:!1,bgColor:"#ffffff",useHighPerformance:!1,flashPollingInterval:null,html5PollingInterval:null,flashLoadTimeout:1E3,
|
15
|
+
wmode:null,allowScriptAccess:"always",useFlashBlock:!1,useHTML5Audio:!0,html5Test:/^(probably|maybe)$/i,preferFlash:!0,noSWFCache:!1};this.defaultOptions={autoLoad:!1,autoPlay:!1,from:null,loops:1,onid3:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onposition:null,onstop:null,onfailure:null,onfinish:null,multiShot:!0,multiShotEvents:!1,position:null,pan:0,stream:!0,to:null,type:null,usePolicyFile:!1,volume:100};this.flash9Options={isMovieStar:null,usePeakData:!1,
|
16
|
+
useWaveformData:!1,useEQData:!1,onbufferchange:null,ondataerror:null};this.movieStarOptions={bufferTime:3,serverURL:null,onconnect:null,duration:null};this.audioFormats={mp3:{type:['audio/mpeg; codecs="mp3"',"audio/mpeg","audio/mp3","audio/MPA","audio/mpa-robust"],required:!0},mp4:{related:["aac","m4a","m4b"],type:['audio/mp4; codecs="mp4a.40.2"',"audio/aac","audio/x-m4a","audio/MP4A-LATM","audio/mpeg4-generic"],required:!1},ogg:{type:["audio/ogg; codecs=vorbis"],required:!1},wav:{type:['audio/wav; codecs="1"',
|
17
|
+
"audio/wav","audio/wave","audio/x-wav"],required:!1}};this.movieID="sm2-container";this.id=pa||"sm2movie";this.debugID="soundmanager-debug";this.debugURLParam=/([#?&])debug=1/i;this.versionNumber="V2.97a.20130101";this.altURL=this.movieURL=this.version=null;this.enabled=this.swfLoaded=!1;this.oMC=null;this.sounds={};this.soundIDs=[];this.didFlashBlock=this.muted=!1;this.filePattern=null;this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};this.features={buffering:!1,peakData:!1,waveformData:!1,
|
18
|
+
eqData:!1,movieStar:!1};this.sandbox={type:null,types:{remote:"remote (domain-based) rules",localWithFile:"local with file access (no internet access)",localWithNetwork:"local with network (internet access only, no local access)",localTrusted:"local, trusted (local+internet access)"},description:null,noRemote:null,noLocal:null};this.html5={usingFlash:null};this.flash={};this.ignoreFlash=this.html5Only=!1;var Pa,c=this,Qa=null,i=null,pb="HTML5::",A,s=navigator.userAgent,R=j.location.href.toString(),
|
19
|
+
h=document,qa,Ra,ra,l,C=[],sa=!0,x,S=!1,T=!1,n=!1,r=!1,ca=!1,k,qb=0,U,v,ta,K,ua,I,L,M,Sa,va,da,F,ea,wa,N,xa,V,fa,ga,O,Ta,ya,Ua=["log","info","warn","error"],Va,za,Wa,W=null,Aa=null,p,Ba,P,Xa,ha,ia,Q,t,X=!1,Ca=!1,Ya,Za,$a,ja=0,Y=null,ka,J=[],B=null,ab,la,Z,G,Da,Ea,bb,u,cb=Array.prototype.slice,D=!1,Fa,z,Ga,db,E,eb,Ha,ma=s.match(/(ipad|iphone|ipod)/i),fb=s.match(/android/i),H=s.match(/msie/i),rb=s.match(/webkit/i),Ia=s.match(/safari/i)&&!s.match(/chrome/i),Ja=s.match(/opera/i),Ka=s.match(/(mobile|pre\/|xoom)/i)||
|
20
|
+
ma||fb,La=!R.match(/usehtml5audio/i)&&!R.match(/sm2\-ignorebadua/i)&&Ia&&!s.match(/silk/i)&&s.match(/OS X 10_6_([3-7])/i),gb=j.console!==g&&console.log!==g,Ma=h.hasFocus!==g?h.hasFocus():null,na=Ia&&(h.hasFocus===g||!h.hasFocus()),hb=!na,ib=/(mp3|mp4|mpa|m4a|m4b)/i,$=h.location?h.location.protocol.match(/http/i):null,jb=!$?"http://":"",kb=/^\s*audio\/(?:x-)?(?:mpeg4|aac|flv|mov|mp4||m4v|m4a|m4b|mp4v|3gp|3g2)\s*(?:$|;)/i,lb="mpeg4 aac flv mov mp4 m4v f4v m4a m4b mp4v 3gp 3g2".split(" "),sb=RegExp("\\.("+
|
21
|
+
lb.join("|")+")(\\?.*)?$","i");this.mimePattern=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;this.useAltURL=!$;var Na;try{Na=Audio!==g&&(Ja&&opera!==g&&10>opera.version()?new Audio(null):new Audio).canPlayType!==g}catch(ub){Na=!1}this.hasHTML5=Na;this.setup=function(a){var d=!c.url;a!==g&&(n&&B&&c.ok()&&(a.flashVersion!==g||a.url!==g||a.html5Test!==g))&&Q(p("setupLate"));ta(a);d&&(V&&a.url!==g)&&c.beginDelayedInit();!V&&(a.url!==g&&"complete"===h.readyState)&&setTimeout(N,1);return c};this.supported=
|
22
|
+
this.ok=function(){return B?n&&!r:c.useHTML5Audio&&c.hasHTML5};this.getMovie=function(c){return A(c)||h[c]||j[c]};this.createSound=function(a,d){function e(){f=ha(f);c.sounds[f.id]=new Pa(f);c.soundIDs.push(f.id);return c.sounds[f.id]}var b,f;b=null;b="soundManager.createSound(): "+p(!n?"notReady":"notOK");if(!n||!c.ok())return Q(b),!1;d!==g&&(a={id:a,url:d});f=v(a);f.url=ka(f.url);f.id.toString().charAt(0).match(/^[0-9]$/)&&c._wD("soundManager.createSound(): "+p("badID",f.id),2);c._wD("soundManager.createSound(): "+
|
23
|
+
f.id+" ("+f.url+")",1);if(t(f.id,!0))return c._wD("soundManager.createSound(): "+f.id+" exists",1),c.sounds[f.id];la(f)?(b=e(),c._wD(f.id+": Using HTML5"),b._setup_html5(f)):(8<l&&(null===f.isMovieStar&&(f.isMovieStar=!(!f.serverURL&&!(f.type&&f.type.match(kb)||f.url.match(sb)))),f.isMovieStar&&(c._wD("soundManager.createSound(): using MovieStar handling"),1<f.loops&&k("noNSLoop"))),f=ia(f,"soundManager.createSound(): "),b=e(),8===l?i._createSound(f.id,f.loops||1,f.usePolicyFile):(i._createSound(f.id,
|
24
|
+
f.url,f.usePeakData,f.useWaveformData,f.useEQData,f.isMovieStar,f.isMovieStar?f.bufferTime:!1,f.loops||1,f.serverURL,f.duration||null,f.autoPlay,!0,f.autoLoad,f.usePolicyFile),f.serverURL||(b.connected=!0,f.onconnect&&f.onconnect.apply(b))),!f.serverURL&&(f.autoLoad||f.autoPlay)&&b.load(f));!f.serverURL&&f.autoPlay&&b.play();return b};this.destroySound=function(a,d){if(!t(a))return!1;var e=c.sounds[a],b;e._iO={};e.stop();e.unload();for(b=0;b<c.soundIDs.length;b++)if(c.soundIDs[b]===a){c.soundIDs.splice(b,
|
25
|
+
1);break}d||e.destruct(!0);delete c.sounds[a];return!0};this.load=function(a,d){return!t(a)?!1:c.sounds[a].load(d)};this.unload=function(a){return!t(a)?!1:c.sounds[a].unload()};this.onposition=this.onPosition=function(a,d,e,b){return!t(a)?!1:c.sounds[a].onposition(d,e,b)};this.clearOnPosition=function(a,d,e){return!t(a)?!1:c.sounds[a].clearOnPosition(d,e)};this.start=this.play=function(a,d){var e=!1;return!n||!c.ok()?(Q("soundManager.play(): "+p(!n?"notReady":"notOK")),e):!t(a)?(d instanceof Object||
|
26
|
+
(d={url:d}),d&&d.url&&(c._wD('soundManager.play(): attempting to create "'+a+'"',1),d.id=a,e=c.createSound(d).play()),e):c.sounds[a].play(d)};this.setPosition=function(a,d){return!t(a)?!1:c.sounds[a].setPosition(d)};this.stop=function(a){if(!t(a))return!1;c._wD("soundManager.stop("+a+")",1);return c.sounds[a].stop()};this.stopAll=function(){var a;c._wD("soundManager.stopAll()",1);for(a in c.sounds)c.sounds.hasOwnProperty(a)&&c.sounds[a].stop()};this.pause=function(a){return!t(a)?!1:c.sounds[a].pause()};
|
27
|
+
this.pauseAll=function(){var a;for(a=c.soundIDs.length-1;0<=a;a--)c.sounds[c.soundIDs[a]].pause()};this.resume=function(a){return!t(a)?!1:c.sounds[a].resume()};this.resumeAll=function(){var a;for(a=c.soundIDs.length-1;0<=a;a--)c.sounds[c.soundIDs[a]].resume()};this.togglePause=function(a){return!t(a)?!1:c.sounds[a].togglePause()};this.setPan=function(a,d){return!t(a)?!1:c.sounds[a].setPan(d)};this.setVolume=function(a,d){return!t(a)?!1:c.sounds[a].setVolume(d)};this.mute=function(a){var d=0;a instanceof
|
28
|
+
String&&(a=null);if(a){if(!t(a))return!1;c._wD('soundManager.mute(): Muting "'+a+'"');return c.sounds[a].mute()}c._wD("soundManager.mute(): Muting all sounds");for(d=c.soundIDs.length-1;0<=d;d--)c.sounds[c.soundIDs[d]].mute();return c.muted=!0};this.muteAll=function(){c.mute()};this.unmute=function(a){a instanceof String&&(a=null);if(a){if(!t(a))return!1;c._wD('soundManager.unmute(): Unmuting "'+a+'"');return c.sounds[a].unmute()}c._wD("soundManager.unmute(): Unmuting all sounds");for(a=c.soundIDs.length-
|
29
|
+
1;0<=a;a--)c.sounds[c.soundIDs[a]].unmute();c.muted=!1;return!0};this.unmuteAll=function(){c.unmute()};this.toggleMute=function(a){return!t(a)?!1:c.sounds[a].toggleMute()};this.getMemoryUse=function(){var c=0;i&&8!==l&&(c=parseInt(i._getMemoryUse(),10));return c};this.disable=function(a){var d;a===g&&(a=!1);if(r)return!1;r=!0;k("shutdown",1);for(d=c.soundIDs.length-1;0<=d;d--)Va(c.sounds[c.soundIDs[d]]);U(a);u.remove(j,"load",L);return!0};this.canPlayMIME=function(a){var d;c.hasHTML5&&(d=Z({type:a}));
|
30
|
+
!d&&B&&(d=a&&c.ok()?!!(8<l&&a.match(kb)||a.match(c.mimePattern)):null);return d};this.canPlayURL=function(a){var d;c.hasHTML5&&(d=Z({url:a}));!d&&B&&(d=a&&c.ok()?!!a.match(c.filePattern):null);return d};this.canPlayLink=function(a){return a.type!==g&&a.type&&c.canPlayMIME(a.type)?!0:c.canPlayURL(a.href)};this.getSoundById=function(a,d){if(!a)throw Error("soundManager.getSoundById(): sID is null/_undefined");var e=c.sounds[a];!e&&!d&&c._wD('"'+a+'" is an invalid sound ID.',2);return e};this.onready=
|
31
|
+
function(a,d){if("function"===typeof a)n&&c._wD(p("queue","onready")),d||(d=j),ua("onready",a,d),I();else throw p("needFunction","onready");return!0};this.ontimeout=function(a,d){if("function"===typeof a)n&&c._wD(p("queue","ontimeout")),d||(d=j),ua("ontimeout",a,d),I({type:"ontimeout"});else throw p("needFunction","ontimeout");return!0};this._writeDebug=function(a,d){var e,b;if(!c.debugMode)return!1;if(gb&&c.useConsole){if(d&&"object"===typeof d)console.log(a,d);else if(Ua[d]!==g)console[Ua[d]](a);
|
32
|
+
else console.log(a);if(c.consoleOnly)return!0}e=A("soundmanager-debug");if(!e)return!1;b=h.createElement("div");0===++qb%2&&(b.className="sm2-alt");d=d===g?0:parseInt(d,10);b.appendChild(h.createTextNode(a));d&&(2<=d&&(b.style.fontWeight="bold"),3===d&&(b.style.color="#ff3333"));e.insertBefore(b,e.firstChild);return!0};-1!==R.indexOf("sm2-debug=alert")&&(this._writeDebug=function(c){j.alert(c)});this._wD=this._writeDebug;this._debug=function(){var a,d;k("currentObj",1);a=0;for(d=c.soundIDs.length;a<
|
33
|
+
d;a++)c.sounds[c.soundIDs[a]]._debug()};this.reboot=function(a,d){c.soundIDs.length&&c._wD("Destroying "+c.soundIDs.length+" SMSound objects...");var e,b,f;for(e=c.soundIDs.length-1;0<=e;e--)c.sounds[c.soundIDs[e]].destruct();if(i)try{H&&(Aa=i.innerHTML),W=i.parentNode.removeChild(i),k("flRemoved")}catch(g){k("badRemove",2)}Aa=W=B=i=null;c.enabled=V=n=X=Ca=S=T=r=D=c.swfLoaded=!1;c.soundIDs=[];c.sounds={};if(a)C=[];else for(e in C)if(C.hasOwnProperty(e)){b=0;for(f=C[e].length;b<f;b++)C[e][b].fired=
|
34
|
+
!1}d||c._wD("soundManager: Rebooting...");c.html5={usingFlash:null};c.flash={};c.html5Only=!1;c.ignoreFlash=!1;j.setTimeout(function(){wa();d||c.beginDelayedInit()},20);return c};this.reset=function(){k("reset");return c.reboot(!0,!0)};this.getMoviePercent=function(){return i&&"PercentLoaded"in i?i.PercentLoaded():null};this.beginDelayedInit=function(){ca=!0;N();setTimeout(function(){if(Ca)return!1;ga();ea();return Ca=!0},20);M()};this.destruct=function(){c._wD("soundManager.destruct()");c.disable(!0)};
|
35
|
+
Pa=function(a){var d,e,b=this,f,j,mb,m,h,n,q=!1,y=[],s=0,Oa,u,r=null;e=d=null;this.sID=this.id=a.id;this.url=a.url;this._iO=this.instanceOptions=this.options=v(a);this.pan=this.options.pan;this.volume=this.options.volume;this.isHTML5=!1;this._a=null;this.id3={};this._debug=function(){c._wD(b.id+": Merged options:",b.options)};this.load=function(a){var d=null;a!==g?b._iO=v(a,b.options):(a=b.options,b._iO=a,r&&r!==b.url&&(k("manURL"),b._iO.url=b.url,b.url=null));b._iO.url||(b._iO.url=b.url);b._iO.url=
|
36
|
+
ka(b._iO.url);a=b.instanceOptions=b._iO;c._wD(b.id+": load ("+a.url+")");if(a.url===b.url&&0!==b.readyState&&2!==b.readyState)return k("onURL",1),3===b.readyState&&a.onload&&a.onload.apply(b,[!!b.duration]),b;b.loaded=!1;b.readyState=1;b.playState=0;b.id3={};if(la(a))d=b._setup_html5(a),d._called_load?c._wD(b.id+": Ignoring request to load again"):(b._html5_canplay=!1,b.url!==a.url&&(c._wD(k("manURL")+": "+a.url),b._a.src=a.url,b.setPosition(0)),b._a.autobuffer="auto",b._a.preload="auto",b._a._called_load=
|
37
|
+
!0,a.autoPlay&&b.play());else try{b.isHTML5=!1,b._iO=ia(ha(a)),a=b._iO,8===l?i._load(b.id,a.url,a.stream,a.autoPlay,a.usePolicyFile):i._load(b.id,a.url,!!a.stream,!!a.autoPlay,a.loops||1,!!a.autoLoad,a.usePolicyFile)}catch(e){k("smError",2),x("onload",!1),O({type:"SMSOUND_LOAD_JS_EXCEPTION",fatal:!0})}b.url=a.url;return b};this.unload=function(){0!==b.readyState&&(c._wD(b.id+": unload()"),b.isHTML5?(m(),b._a&&(b._a.pause(),Da(b._a,"about:blank"),r="about:blank")):8===l?i._unload(b.id,"about:blank"):
|
38
|
+
i._unload(b.id),f());return b};this.destruct=function(a){c._wD(b.id+": Destruct");b.isHTML5?(m(),b._a&&(b._a.pause(),Da(b._a),D||mb(),b._a._s=null,b._a=null)):(b._iO.onfailure=null,i._destroySound(b.id));a||c.destroySound(b.id,!0)};this.start=this.play=function(a,d){var e,f,w=!0,w=null;e=b.id+": play(): ";d=d===g?!0:d;a||(a={});b.url&&(b._iO.url=b.url);b._iO=v(b._iO,b.options);b._iO=v(a,b._iO);b._iO.url=ka(b._iO.url);b.instanceOptions=b._iO;if(b._iO.serverURL&&!b.connected)return b.getAutoPlay()||
|
39
|
+
(c._wD(e+" Netstream not connected yet - setting autoPlay"),b.setAutoPlay(!0)),b;la(b._iO)&&(b._setup_html5(b._iO),h());1===b.playState&&!b.paused&&((f=b._iO.multiShot)?c._wD(e+"Already playing (multi-shot)",1):(c._wD(e+"Already playing (one-shot)",1),w=b));if(null!==w)return w;a.url&&a.url!==b.url&&b.load(b._iO);b.loaded?c._wD(e):0===b.readyState?(c._wD(e+"Attempting to load"),b.isHTML5||(b._iO.autoPlay=!0),b.load(b._iO),b.instanceOptions=b._iO):2===b.readyState?(c._wD(e+"Could not load - exiting",
|
40
|
+
2),w=b):c._wD(e+"Loading - attempting to play...");if(null!==w)return w;!b.isHTML5&&(9===l&&0<b.position&&b.position===b.duration)&&(c._wD(e+"Sound at end, resetting to position:0"),a.position=0);if(b.paused&&0<=b.position&&(!b._iO.serverURL||0<b.position))c._wD(e+"Resuming from paused state",1),b.resume();else{b._iO=v(a,b._iO);if(null!==b._iO.from&&null!==b._iO.to&&0===b.instanceCount&&0===b.playState&&!b._iO.serverURL){f=function(){b._iO=v(a,b._iO);b.play(b._iO)};if(b.isHTML5&&!b._html5_canplay)c._wD(e+
|
41
|
+
"Beginning load for from/to case"),b.load({oncanplay:f}),w=!1;else if(!b.isHTML5&&!b.loaded&&(!b.readyState||2!==b.readyState))c._wD(e+"Preloading for from/to case"),b.load({onload:f}),w=!1;if(null!==w)return w;b._iO=u()}c._wD(e+"Starting to play");(!b.instanceCount||b._iO.multiShotEvents||!b.isHTML5&&8<l&&!b.getAutoPlay())&&b.instanceCount++;b._iO.onposition&&0===b.playState&&n(b);b.playState=1;b.paused=!1;b.position=b._iO.position!==g&&!isNaN(b._iO.position)?b._iO.position:0;b.isHTML5||(b._iO=ia(ha(b._iO)));
|
42
|
+
b._iO.onplay&&d&&(b._iO.onplay.apply(b),q=!0);b.setVolume(b._iO.volume,!0);b.setPan(b._iO.pan,!0);b.isHTML5?(h(),e=b._setup_html5(),b.setPosition(b._iO.position),e.play()):(w=i._start(b.id,b._iO.loops||1,9===l?b._iO.position:b._iO.position/1E3,b._iO.multiShot),9===l&&!w&&(c._wD(e+"No sound hardware, or 32-sound ceiling hit"),b._iO.onplayerror&&b._iO.onplayerror.apply(b)))}return b};this.stop=function(a){var d=b._iO;1===b.playState&&(c._wD(b.id+": stop()"),b._onbufferchange(0),b._resetOnPosition(0),
|
43
|
+
b.paused=!1,b.isHTML5||(b.playState=0),Oa(),d.to&&b.clearOnPosition(d.to),b.isHTML5?b._a&&(a=b.position,b.setPosition(0),b.position=a,b._a.pause(),b.playState=0,b._onTimer(),m()):(i._stop(b.id,a),d.serverURL&&b.unload()),b.instanceCount=0,b._iO={},d.onstop&&d.onstop.apply(b));return b};this.setAutoPlay=function(a){c._wD(b.id+": Autoplay turned "+(a?"on":"off"));b._iO.autoPlay=a;b.isHTML5||(i._setAutoPlay(b.id,a),a&&(!b.instanceCount&&1===b.readyState)&&(b.instanceCount++,c._wD(b.id+": Incremented instance count to "+
|
44
|
+
b.instanceCount)))};this.getAutoPlay=function(){return b._iO.autoPlay};this.setPosition=function(a){a===g&&(a=0);var d=b.isHTML5?Math.max(a,0):Math.min(b.duration||b._iO.duration,Math.max(a,0));b.position=d;a=b.position/1E3;b._resetOnPosition(b.position);b._iO.position=d;if(b.isHTML5){if(b._a)if(b._html5_canplay){if(b._a.currentTime!==a){c._wD(b.id+": setPosition("+a+")");try{b._a.currentTime=a,(0===b.playState||b.paused)&&b._a.pause()}catch(e){c._wD(b.id+": setPosition("+a+") failed: "+e.message,
|
45
|
+
2)}}}else c._wD(b.id+": setPosition("+a+"): Cannot seek yet, sound not ready")}else a=9===l?b.position:a,b.readyState&&2!==b.readyState&&i._setPosition(b.id,a,b.paused||!b.playState,b._iO.multiShot);b.isHTML5&&b.paused&&b._onTimer(!0);return b};this.pause=function(a){if(b.paused||0===b.playState&&1!==b.readyState)return b;c._wD(b.id+": pause()");b.paused=!0;b.isHTML5?(b._setup_html5().pause(),m()):(a||a===g)&&i._pause(b.id,b._iO.multiShot);b._iO.onpause&&b._iO.onpause.apply(b);return b};this.resume=
|
46
|
+
function(){var a=b._iO;if(!b.paused)return b;c._wD(b.id+": resume()");b.paused=!1;b.playState=1;b.isHTML5?(b._setup_html5().play(),h()):(a.isMovieStar&&!a.serverURL&&b.setPosition(b.position),i._pause(b.id,a.multiShot));!q&&a.onplay?(a.onplay.apply(b),q=!0):a.onresume&&a.onresume.apply(b);return b};this.togglePause=function(){c._wD(b.id+": togglePause()");if(0===b.playState)return b.play({position:9===l&&!b.isHTML5?b.position:b.position/1E3}),b;b.paused?b.resume():b.pause();return b};this.setPan=
|
47
|
+
function(a,c){a===g&&(a=0);c===g&&(c=!1);b.isHTML5||i._setPan(b.id,a);b._iO.pan=a;c||(b.pan=a,b.options.pan=a);return b};this.setVolume=function(a,d){a===g&&(a=100);d===g&&(d=!1);b.isHTML5?b._a&&(b._a.volume=Math.max(0,Math.min(1,a/100))):i._setVolume(b.id,c.muted&&!b.muted||b.muted?0:a);b._iO.volume=a;d||(b.volume=a,b.options.volume=a);return b};this.mute=function(){b.muted=!0;b.isHTML5?b._a&&(b._a.muted=!0):i._setVolume(b.id,0);return b};this.unmute=function(){b.muted=!1;var a=b._iO.volume!==g;
|
48
|
+
b.isHTML5?b._a&&(b._a.muted=!1):i._setVolume(b.id,a?b._iO.volume:b.options.volume);return b};this.toggleMute=function(){return b.muted?b.unmute():b.mute()};this.onposition=this.onPosition=function(a,c,d){y.push({position:parseInt(a,10),method:c,scope:d!==g?d:b,fired:!1});return b};this.clearOnPosition=function(b,a){var c,b=parseInt(b,10);if(isNaN(b))return!1;for(c=0;c<y.length;c++)if(b===y[c].position&&(!a||a===y[c].method))y[c].fired&&s--,y.splice(c,1)};this._processOnPosition=function(){var a,c;
|
49
|
+
a=y.length;if(!a||!b.playState||s>=a)return!1;for(a-=1;0<=a;a--)c=y[a],!c.fired&&b.position>=c.position&&(c.fired=!0,s++,c.method.apply(c.scope,[c.position]));return!0};this._resetOnPosition=function(b){var a,c;a=y.length;if(!a)return!1;for(a-=1;0<=a;a--)c=y[a],c.fired&&b<=c.position&&(c.fired=!1,s--);return!0};u=function(){var a=b._iO,d=a.from,e=a.to,f,g;g=function(){c._wD(b.id+': "To" time of '+e+" reached.");b.clearOnPosition(e,g);b.stop()};f=function(){c._wD(b.id+': Playing "from" '+d);if(null!==
|
50
|
+
e&&!isNaN(e))b.onPosition(e,g)};null!==d&&!isNaN(d)&&(a.position=d,a.multiShot=!1,f());return a};n=function(){var a,c=b._iO.onposition;if(c)for(a in c)if(c.hasOwnProperty(a))b.onPosition(parseInt(a,10),c[a])};Oa=function(){var a,c=b._iO.onposition;if(c)for(a in c)c.hasOwnProperty(a)&&b.clearOnPosition(parseInt(a,10))};h=function(){b.isHTML5&&Ya(b)};m=function(){b.isHTML5&&Za(b)};f=function(a){a||(y=[],s=0);q=!1;b._hasTimer=null;b._a=null;b._html5_canplay=!1;b.bytesLoaded=null;b.bytesTotal=null;b.duration=
|
51
|
+
b._iO&&b._iO.duration?b._iO.duration:null;b.durationEstimate=null;b.buffered=[];b.eqData=[];b.eqData.left=[];b.eqData.right=[];b.failures=0;b.isBuffering=!1;b.instanceOptions={};b.instanceCount=0;b.loaded=!1;b.metadata={};b.readyState=0;b.muted=!1;b.paused=!1;b.peakData={left:0,right:0};b.waveformData={left:[],right:[]};b.playState=0;b.position=null;b.id3={}};f();this._onTimer=function(a){var c,f=!1,g={};if(b._hasTimer||a){if(b._a&&(a||(0<b.playState||1===b.readyState)&&!b.paused))c=b._get_html5_duration(),
|
52
|
+
c!==d&&(d=c,b.duration=c,f=!0),b.durationEstimate=b.duration,c=1E3*b._a.currentTime||0,c!==e&&(e=c,f=!0),(f||a)&&b._whileplaying(c,g,g,g,g);return f}};this._get_html5_duration=function(){var a=b._iO;return(a=b._a&&b._a.duration?1E3*b._a.duration:a&&a.duration?a.duration:null)&&!isNaN(a)&&Infinity!==a?a:null};this._apply_loop=function(b,a){!b.loop&&1<a&&c._wD("Note: Native HTML5 looping is infinite.",1);b.loop=1<a?"loop":""};this._setup_html5=function(a){var a=v(b._iO,a),c=decodeURI,d=D?Qa:b._a,e=
|
53
|
+
c(a.url),g;D?e===Fa&&(g=!0):e===r&&(g=!0);if(d){if(d._s)if(D)d._s&&(d._s.playState&&!g)&&d._s.stop();else if(!D&&e===c(r))return b._apply_loop(d,a.loops),d;g||(f(!1),d.src=a.url,Fa=r=b.url=a.url,d._called_load=!1)}else b._a=a.autoLoad||a.autoPlay?new Audio(a.url):Ja&&10>opera.version()?new Audio(null):new Audio,d=b._a,d._called_load=!1,D&&(Qa=d);b.isHTML5=!0;b._a=d;d._s=b;j();b._apply_loop(d,a.loops);a.autoLoad||a.autoPlay?b.load():(d.autobuffer=!1,d.preload="auto");return d};j=function(){if(b._a._added_events)return!1;
|
54
|
+
var a;b._a._added_events=!0;for(a in E)E.hasOwnProperty(a)&&b._a&&b._a.addEventListener(a,E[a],!1);return!0};mb=function(){var a;c._wD(b.id+": Removing event listeners");b._a._added_events=!1;for(a in E)E.hasOwnProperty(a)&&b._a&&b._a.removeEventListener(a,E[a],!1)};this._onload=function(a){var d=!!a||!b.isHTML5&&8===l&&b.duration,a=b.id+": ";c._wD(a+(d?"onload()":"Failed to load? - "+b.url),d?1:2);!d&&!b.isHTML5&&(!0===c.sandbox.noRemote&&c._wD(a+p("noNet"),1),!0===c.sandbox.noLocal&&c._wD(a+p("noLocal"),
|
55
|
+
1));b.loaded=d;b.readyState=d?3:2;b._onbufferchange(0);b._iO.onload&&b._iO.onload.apply(b,[d]);return!0};this._onbufferchange=function(a){if(0===b.playState||a&&b.isBuffering||!a&&!b.isBuffering)return!1;b.isBuffering=1===a;b._iO.onbufferchange&&(c._wD(b.id+": Buffer state change: "+a),b._iO.onbufferchange.apply(b));return!0};this._onsuspend=function(){b._iO.onsuspend&&(c._wD(b.id+": Playback suspended"),b._iO.onsuspend.apply(b));return!0};this._onfailure=function(a,d,e){b.failures++;c._wD(b.id+": Failures = "+
|
56
|
+
b.failures);if(b._iO.onfailure&&1===b.failures)b._iO.onfailure(b,a,d,e);else c._wD(b.id+": Ignoring failure")};this._onfinish=function(){var a=b._iO.onfinish;b._onbufferchange(0);b._resetOnPosition(0);if(b.instanceCount&&(b.instanceCount--,b.instanceCount||(Oa(),b.playState=0,b.paused=!1,b.instanceCount=0,b.instanceOptions={},b._iO={},m(),b.isHTML5&&(b.position=0)),(!b.instanceCount||b._iO.multiShotEvents)&&a))c._wD(b.id+": onfinish()"),a.apply(b)};this._whileloading=function(a,c,d,e){var f=b._iO;
|
57
|
+
b.bytesLoaded=a;b.bytesTotal=c;b.duration=Math.floor(d);b.bufferLength=e;b.durationEstimate=!b.isHTML5&&!f.isMovieStar?f.duration?b.duration>f.duration?b.duration:f.duration:parseInt(b.bytesTotal/b.bytesLoaded*b.duration,10):b.duration;b.isHTML5||(b.buffered=[{start:0,end:b.duration}]);(3!==b.readyState||b.isHTML5)&&f.whileloading&&f.whileloading.apply(b)};this._whileplaying=function(a,c,d,e,f){var m=b._iO;if(isNaN(a)||null===a)return!1;b.position=Math.max(0,a);b._processOnPosition();!b.isHTML5&&
|
58
|
+
8<l&&(m.usePeakData&&(c!==g&&c)&&(b.peakData={left:c.leftPeak,right:c.rightPeak}),m.useWaveformData&&(d!==g&&d)&&(b.waveformData={left:d.split(","),right:e.split(",")}),m.useEQData&&(f!==g&&f&&f.leftEQ)&&(a=f.leftEQ.split(","),b.eqData=a,b.eqData.left=a,f.rightEQ!==g&&f.rightEQ&&(b.eqData.right=f.rightEQ.split(","))));1===b.playState&&(!b.isHTML5&&(8===l&&!b.position&&b.isBuffering)&&b._onbufferchange(0),m.whileplaying&&m.whileplaying.apply(b));return!0};this._oncaptiondata=function(a){c._wD(b.id+
|
59
|
+
": Caption data received.");b.captiondata=a;b._iO.oncaptiondata&&b._iO.oncaptiondata.apply(b,[a])};this._onmetadata=function(a,d){c._wD(b.id+": Metadata received.");var e={},f,g;f=0;for(g=a.length;f<g;f++)e[a[f]]=d[f];b.metadata=e;b._iO.onmetadata&&b._iO.onmetadata.apply(b)};this._onid3=function(a,d){c._wD(b.id+": ID3 data received.");var e=[],f,g;f=0;for(g=a.length;f<g;f++)e[a[f]]=d[f];b.id3=v(b.id3,e);b._iO.onid3&&b._iO.onid3.apply(b)};this._onconnect=function(a){a=1===a;c._wD(b.id+": "+(a?"Connected.":
|
60
|
+
"Failed to connect? - "+b.url),a?1:2);if(b.connected=a)b.failures=0,t(b.id)&&(b.getAutoPlay()?b.play(g,b.getAutoPlay()):b._iO.autoLoad&&b.load()),b._iO.onconnect&&b._iO.onconnect.apply(b,[a])};this._ondataerror=function(a){0<b.playState&&(c._wD(b.id+": Data error: "+a),b._iO.ondataerror&&b._iO.ondataerror.apply(b))};this._debug()};fa=function(){return h.body||h._docElement||h.getElementsByTagName("div")[0]};A=function(a){return h.getElementById(a)};v=function(a,d){var e=a||{},b,f;b=d===g?c.defaultOptions:
|
61
|
+
d;for(f in b)b.hasOwnProperty(f)&&e[f]===g&&(e[f]="object"!==typeof b[f]||null===b[f]?b[f]:v(e[f],b[f]));return e};K={onready:1,ontimeout:1,defaultOptions:1,flash9Options:1,movieStarOptions:1};ta=function(a,d){var e,b=!0,f=d!==g,h=c.setupOptions;if(a===g){b=[];for(e in h)h.hasOwnProperty(e)&&b.push(e);for(e in K)K.hasOwnProperty(e)&&("object"===typeof c[e]?b.push(e+": {...}"):c[e]instanceof Function?b.push(e+": function() {...}"):b.push(e));c._wD(p("setup",b.join(", ")));return!1}for(e in a)if(a.hasOwnProperty(e))if("object"!==
|
62
|
+
typeof a[e]||null===a[e]||a[e]instanceof Array||a[e]instanceof RegExp)f&&K[d]!==g?c[d][e]=a[e]:h[e]!==g?(c.setupOptions[e]=a[e],c[e]=a[e]):K[e]===g?(Q(p(c[e]===g?"setupUndef":"setupError",e),2),b=!1):c[e]instanceof Function?c[e].apply(c,a[e]instanceof Array?a[e]:[a[e]]):c[e]=a[e];else if(K[e]===g)Q(p(c[e]===g?"setupUndef":"setupError",e),2),b=!1;else return ta(a[e],e);return b};var nb=function(a){var a=cb.call(a),c=a.length;oa?(a[1]="on"+a[1],3<c&&a.pop()):3===c&&a.push(!1);return a},ob=function(a,
|
63
|
+
c){var e=a.shift(),b=[tb[c]];if(oa)e[b](a[0],a[1]);else e[b].apply(e,a)},oa=j.attachEvent,tb={add:oa?"attachEvent":"addEventListener",remove:oa?"detachEvent":"removeEventListener"};u={add:function(){ob(nb(arguments),"add")},remove:function(){ob(nb(arguments),"remove")}};E={abort:q(function(){c._wD(this._s.id+": abort")}),canplay:q(function(){var a=this._s,d;if(a._html5_canplay)return!0;a._html5_canplay=!0;c._wD(a.id+": canplay");a._onbufferchange(0);d=a._iO.position!==g&&!isNaN(a._iO.position)?a._iO.position/
|
64
|
+
1E3:null;if(a.position&&this.currentTime!==d){c._wD(a.id+": canplay: Setting position to "+d);try{this.currentTime=d}catch(e){c._wD(a.id+": canplay: Setting position of "+d+" failed: "+e.message,2)}}a._iO._oncanplay&&a._iO._oncanplay()}),canplaythrough:q(function(){var a=this._s;a.loaded||(a._onbufferchange(0),a._whileloading(a.bytesLoaded,a.bytesTotal,a._get_html5_duration()),a._onload(!0))}),ended:q(function(){var a=this._s;c._wD(a.id+": ended");a._onfinish()}),error:q(function(){c._wD(this._s.id+
|
65
|
+
": HTML5 error, code "+this.error.code);this._s._onload(!1)}),loadeddata:q(function(){var a=this._s;c._wD(a.id+": loadeddata");!a._loaded&&!Ia&&(a.duration=a._get_html5_duration())}),loadedmetadata:q(function(){c._wD(this._s.id+": loadedmetadata")}),loadstart:q(function(){c._wD(this._s.id+": loadstart");this._s._onbufferchange(1)}),play:q(function(){c._wD(this._s.id+": play()");this._s._onbufferchange(0)}),playing:q(function(){c._wD(this._s.id+": playing");this._s._onbufferchange(0)}),progress:q(function(a){var d=
|
66
|
+
this._s,e,b,f;e=0;var g="progress"===a.type,h=a.target.buffered,m=a.loaded||0,j=a.total||1;d.buffered=[];if(h&&h.length){e=0;for(b=h.length;e<b;e++)d.buffered.push({start:1E3*h.start(e),end:1E3*h.end(e)});e=1E3*(h.end(0)-h.start(0));m=e/(1E3*a.target.duration);if(g&&1<h.length){f=[];b=h.length;for(e=0;e<b;e++)f.push(1E3*a.target.buffered.start(e)+"-"+1E3*a.target.buffered.end(e));c._wD(this._s.id+": progress, timeRanges: "+f.join(", "))}g&&!isNaN(m)&&c._wD(this._s.id+": progress, "+Math.floor(100*
|
67
|
+
m)+"% loaded")}isNaN(m)||(d._onbufferchange(0),d._whileloading(m,j,d._get_html5_duration()),m&&(j&&m===j)&&E.canplaythrough.call(this,a))}),ratechange:q(function(){c._wD(this._s.id+": ratechange")}),suspend:q(function(a){var d=this._s;c._wD(this._s.id+": suspend");E.progress.call(this,a);d._onsuspend()}),stalled:q(function(){c._wD(this._s.id+": stalled")}),timeupdate:q(function(){this._s._onTimer()}),waiting:q(function(){var a=this._s;c._wD(this._s.id+": waiting");a._onbufferchange(1)})};la=function(a){return a.serverURL||
|
68
|
+
a.type&&ba(a.type)?!1:a.type?Z({type:a.type}):Z({url:a.url})||c.html5Only};Da=function(a,c){a&&(a.src=c,a._called_load=!1);D&&(Fa=null)};Z=function(a){if(!c.useHTML5Audio||!c.hasHTML5)return!1;var d=a.url||null,a=a.type||null,e=c.audioFormats,b;if(a&&c.html5[a]!==g)return c.html5[a]&&!ba(a);if(!G){G=[];for(b in e)e.hasOwnProperty(b)&&(G.push(b),e[b].related&&(G=G.concat(e[b].related)));G=RegExp("\\.("+G.join("|")+")(\\?.*)?$","i")}b=d?d.toLowerCase().match(G):null;!b||!b.length?a&&(d=a.indexOf(";"),
|
69
|
+
b=(-1!==d?a.substr(0,d):a).substr(6)):b=b[1];b&&c.html5[b]!==g?d=c.html5[b]&&!ba(b):(a="audio/"+b,d=c.html5.canPlayType({type:a}),d=(c.html5[b]=d)&&c.html5[a]&&!ba(a));return d};bb=function(){function a(a){var b,e,f=b=!1;if(!d||"function"!==typeof d.canPlayType)return b;if(a instanceof Array){b=0;for(e=a.length;b<e;b++)if(c.html5[a[b]]||d.canPlayType(a[b]).match(c.html5Test))f=!0,c.html5[a[b]]=!0,c.flash[a[b]]=!!a[b].match(ib);b=f}else a=d&&"function"===typeof d.canPlayType?d.canPlayType(a):!1,b=
|
70
|
+
!(!a||!a.match(c.html5Test));return b}if(!c.useHTML5Audio||!c.hasHTML5)return!1;var d=Audio!==g?Ja&&10>opera.version()?new Audio(null):new Audio:null,e,b,f={},h;h=c.audioFormats;for(e in h)if(h.hasOwnProperty(e)&&(b="audio/"+e,f[e]=a(h[e].type),f[b]=f[e],e.match(ib)?(c.flash[e]=!0,c.flash[b]=!0):(c.flash[e]=!1,c.flash[b]=!1),h[e]&&h[e].related))for(b=h[e].related.length-1;0<=b;b--)f["audio/"+h[e].related[b]]=f[e],c.html5[h[e].related[b]]=f[e],c.flash[h[e].related[b]]=f[e];f.canPlayType=d?a:null;c.html5=
|
71
|
+
v(c.html5,f);return!0};F={notReady:"Unavailable - wait until onready() has fired.",notOK:"Audio support is not available.",domError:"soundManagerexception caught while appending SWF to DOM.",spcWmode:"Removing wmode, preventing known SWF loading issue(s)",swf404:"soundManager: Verify that %s is a valid path.",tryDebug:"Try soundManager.debugFlash = true for more security details (output goes to SWF.)",checkSWF:"See SWF output for more debug info.",localFail:"soundManager: Non-HTTP page ("+h.location.protocol+
|
72
|
+
" URL?) Review Flash player security settings for this special case:\nhttp://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html\nMay need to add/allow path, eg. c:/sm2/ or /users/me/sm2/",waitFocus:"soundManager: Special case: Waiting for SWF to load with window focus...",waitForever:"soundManager: Waiting indefinitely for Flash (will recover if unblocked)...",waitSWF:"soundManager: Waiting for 100% SWF load...",needFunction:"soundManager: Function object expected for %s",
|
73
|
+
badID:'Warning: Sound ID "%s" should be a string, starting with a non-numeric character',currentObj:"soundManager: _debug(): Current sound objects",waitOnload:"soundManager: Waiting for window.onload()",docLoaded:"soundManager: Document already loaded",onload:"soundManager: initComplete(): calling soundManager.onload()",onloadOK:"soundManager.onload() complete",didInit:"soundManager: init(): Already called?",secNote:"Flash security note: Network/internet URLs will not load due to security restrictions. Access can be configured via Flash Player Global Security Settings Page: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html",
|
74
|
+
badRemove:"soundManager: Failed to remove Flash node.",shutdown:"soundManager.disable(): Shutting down",queue:"soundManager: Queueing %s handler",smError:"SMSound.load(): Exception: JS-Flash communication failed, or JS error.",fbTimeout:"No flash response, applying .swf_timedout CSS...",fbLoaded:"Flash loaded",flRemoved:"soundManager: Flash movie removed.",fbHandler:"soundManager: flashBlockHandler()",manURL:"SMSound.load(): Using manually-assigned URL",onURL:"soundManager.load(): current URL already assigned.",
|
79
75
|
badFV:'soundManager.flashVersion must be 8 or 9. "%s" is invalid. Reverting to %s.',as2loop:"Note: Setting stream:false so looping can work (flash 8 limitation)",noNSLoop:"Note: Looping not implemented for MovieStar formats",needfl9:"Note: Switching to flash 9, required for MP4 formats.",mfTimeout:"Setting flashLoadTimeout = 0 (infinite) for off-screen, mobile flash case",needFlash:"soundManager: Fatal error: Flash is needed to play some required formats, but is not available.",gotFocus:"soundManager: Got window focus.",
|
80
|
-
|
81
|
-
p=function(){var a=
|
82
|
-
|
83
|
-
10);
|
84
|
-
")(\\?.*)?$","i"),c.features.movieStar=!0):c.features.movieStar=!1;c.filePattern=c.filePatterns[8!==
|
85
|
-
a.id=c.debugID+"-toggle";d={position:"fixed",bottom:"0px",right:"0px",width:"1.2em",height:"1.2em",lineHeight:"1.2em",margin:"2px",textAlign:"center",border:"1px solid #999",cursor:"pointer",background:"#fff",color:"#333",zIndex:10001};a.appendChild(
|
86
|
-
"block":"none";if(c.debugMode&&!A(a.id)){try{e=fa(),e.appendChild(a)}catch(
|
87
|
-
c,e)}catch(b){}return!0};
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
c.
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
c.
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
(
|
110
|
-
|
76
|
+
policy:"Enabling usePolicyFile for data access",setup:"soundManager.setup(): allowed parameters: %s",setupError:'soundManager.setup(): "%s" cannot be assigned with this method.',setupUndef:'soundManager.setup(): Could not find option "%s"',setupLate:"soundManager.setup(): url, flashVersion and html5Test property changes will not take effect until reboot().",noURL:"soundManager: Flash URL required. Call soundManager.setup({url:...}) to get started.",sm2Loaded:"SoundManager 2: Ready.",reset:"soundManager.reset(): Removing event callbacks",
|
77
|
+
mobileUA:"Mobile UA detected, preferring HTML5 by default.",globalHTML5:"Using singleton HTML5 Audio() pattern for this device."};p=function(){var a=cb.call(arguments),c=a.shift(),c=F&&F[c]?F[c]:"",e,b;if(c&&a&&a.length){e=0;for(b=a.length;e<b;e++)c=c.replace("%s",a[e])}return c};ha=function(a){8===l&&(1<a.loops&&a.stream)&&(k("as2loop"),a.stream=!1);return a};ia=function(a,d){if(a&&!a.usePolicyFile&&(a.onid3||a.usePeakData||a.useWaveformData||a.useEQData))c._wD((d||"")+p("policy")),a.usePolicyFile=
|
78
|
+
!0;return a};Q=function(a){console!==g&&console.warn!==g?console.warn(a):c._wD(a)};qa=function(){return!1};Va=function(a){for(var c in a)a.hasOwnProperty(c)&&"function"===typeof a[c]&&(a[c]=qa)};za=function(a){a===g&&(a=!1);(r||a)&&c.disable(a)};Wa=function(a){var d=null;if(a)if(a.match(/\.swf(\?.*)?$/i)){if(d=a.substr(a.toLowerCase().lastIndexOf(".swf?")+4))return a}else a.lastIndexOf("/")!==a.length-1&&(a+="/");a=(a&&-1!==a.lastIndexOf("/")?a.substr(0,a.lastIndexOf("/")+1):"./")+c.movieURL;c.noSWFCache&&
|
79
|
+
(a+="?ts="+(new Date).getTime());return a};va=function(){l=parseInt(c.flashVersion,10);8!==l&&9!==l&&(c._wD(p("badFV",l,8)),c.flashVersion=l=8);var a=c.debugMode||c.debugFlash?"_debug.swf":".swf";c.useHTML5Audio&&(!c.html5Only&&c.audioFormats.mp4.required&&9>l)&&(c._wD(p("needfl9")),c.flashVersion=l=9);c.version=c.versionNumber+(c.html5Only?" (HTML5-only mode)":9===l?" (AS3/Flash 9)":" (AS2/Flash 8)");8<l?(c.defaultOptions=v(c.defaultOptions,c.flash9Options),c.features.buffering=!0,c.defaultOptions=
|
80
|
+
v(c.defaultOptions,c.movieStarOptions),c.filePatterns.flash9=RegExp("\\.(mp3|"+lb.join("|")+")(\\?.*)?$","i"),c.features.movieStar=!0):c.features.movieStar=!1;c.filePattern=c.filePatterns[8!==l?"flash9":"flash8"];c.movieURL=(8===l?"soundmanager2.swf":"soundmanager2_flash9.swf").replace(".swf",a);c.features.peakData=c.features.waveformData=c.features.eqData=8<l};Ta=function(a,c){if(!i)return!1;i._setPolling(a,c)};ya=function(){c.debugURLParam.test(R)&&(c.debugMode=!0);if(A(c.debugID))return!1;var a,
|
81
|
+
d,e,b;if(c.debugMode&&!A(c.debugID)&&(!gb||!c.useConsole||!c.consoleOnly)){a=h.createElement("div");a.id=c.debugID+"-toggle";d={position:"fixed",bottom:"0px",right:"0px",width:"1.2em",height:"1.2em",lineHeight:"1.2em",margin:"2px",textAlign:"center",border:"1px solid #999",cursor:"pointer",background:"#fff",color:"#333",zIndex:10001};a.appendChild(h.createTextNode("-"));a.onclick=Xa;a.title="Toggle SM2 debug console";s.match(/msie 6/i)&&(a.style.position="absolute",a.style.cursor="hand");for(b in d)d.hasOwnProperty(b)&&
|
82
|
+
(a.style[b]=d[b]);d=h.createElement("div");d.id=c.debugID;d.style.display=c.debugMode?"block":"none";if(c.debugMode&&!A(a.id)){try{e=fa(),e.appendChild(a)}catch(f){throw Error(p("domError")+" \n"+f.toString());}e.appendChild(d)}}};t=this.getSoundById;k=function(a,d){return!a?"":c._wD(p(a),d)};Xa=function(){var a=A(c.debugID),d=A(c.debugID+"-toggle");if(!a)return!1;sa?(d.innerHTML="+",a.style.display="none"):(d.innerHTML="-",a.style.display="block");sa=!sa};x=function(a,c,e){if(j.sm2Debugger!==g)try{sm2Debugger.handleEvent(a,
|
83
|
+
c,e)}catch(b){}return!0};P=function(){var a=[];c.debugMode&&a.push("sm2_debug");c.debugFlash&&a.push("flash_debug");c.useHighPerformance&&a.push("high_performance");return a.join(" ")};Ba=function(){var a=p("fbHandler"),d=c.getMoviePercent(),e={type:"FLASHBLOCK"};if(c.html5Only)return!1;c.ok()?(c.didFlashBlock&&c._wD(a+": Unblocked"),c.oMC&&(c.oMC.className=[P(),"movieContainer","swf_loaded"+(c.didFlashBlock?" swf_unblocked":"")].join(" "))):(B&&(c.oMC.className=P()+" movieContainer "+(null===d?"swf_timedout":
|
84
|
+
"swf_error"),c._wD(a+": "+p("fbTimeout")+(d?" ("+p("fbLoaded")+")":""))),c.didFlashBlock=!0,I({type:"ontimeout",ignoreInit:!0,error:e}),O(e))};ua=function(a,c,e){C[a]===g&&(C[a]=[]);C[a].push({method:c,scope:e||null,fired:!1})};I=function(a){a||(a={type:c.ok()?"onready":"ontimeout"});if(!n&&a&&!a.ignoreInit||"ontimeout"===a.type&&(c.ok()||r&&!a.ignoreInit))return!1;var d={success:a&&a.ignoreInit?c.ok():!r},e=a&&a.type?C[a.type]||[]:[],b=[],f,d=[d],g=B&&!c.ok();a.error&&(d[0].error=a.error);a=0;for(f=
|
85
|
+
e.length;a<f;a++)!0!==e[a].fired&&b.push(e[a]);if(b.length){a=0;for(f=b.length;a<f;a++)b[a].scope?b[a].method.apply(b[a].scope,d):b[a].method.apply(this,d),g||(b[a].fired=!0)}return!0};L=function(){j.setTimeout(function(){c.useFlashBlock&&Ba();I();"function"===typeof c.onload&&(k("onload",1),c.onload.apply(j),k("onloadOK",1));c.waitForWindowLoad&&u.add(j,"load",L)},1)};Ga=function(){if(z!==g)return z;var a=!1,c=navigator,e=c.plugins,b,f=j.ActiveXObject;if(e&&e.length)(c=c.mimeTypes)&&(c["application/x-shockwave-flash"]&&
|
86
|
+
c["application/x-shockwave-flash"].enabledPlugin&&c["application/x-shockwave-flash"].enabledPlugin.description)&&(a=!0);else if(f!==g&&!s.match(/MSAppHost/i)){try{b=new f("ShockwaveFlash.ShockwaveFlash")}catch(h){}a=!!b}return z=a};ab=function(){var a,d,e=c.audioFormats;if(ma&&s.match(/os (1|2|3_0|3_1)/i))c.hasHTML5=!1,c.html5Only=!0,c.oMC&&(c.oMC.style.display="none");else if(c.useHTML5Audio){if(!c.html5||!c.html5.canPlayType)c._wD("SoundManager: No HTML5 Audio() support detected."),c.hasHTML5=!1;
|
87
|
+
La&&c._wD("soundManager: Note: Buggy HTML5 Audio in Safari on this OS X release, see https://bugs.webkit.org/show_bug.cgi?id=32159 - "+(!z?" would use flash fallback for MP3/MP4, but none detected.":"will use flash fallback for MP3/MP4, if available"),1)}if(c.useHTML5Audio&&c.hasHTML5)for(d in e)if(e.hasOwnProperty(d)&&(e[d].required&&!c.html5.canPlayType(e[d].type)||c.preferFlash&&(c.flash[d]||c.flash[e[d].type])))a=!0;c.ignoreFlash&&(a=!1);c.html5Only=c.hasHTML5&&c.useHTML5Audio&&!a;return!c.html5Only};
|
88
|
+
ka=function(a){var d,e,b=0;if(a instanceof Array){d=0;for(e=a.length;d<e;d++)if(a[d]instanceof Object){if(c.canPlayMIME(a[d].type)){b=d;break}}else if(c.canPlayURL(a[d])){b=d;break}a[b].url&&(a[b]=a[b].url);a=a[b]}return a};Ya=function(a){a._hasTimer||(a._hasTimer=!0,!Ka&&c.html5PollingInterval&&(null===Y&&0===ja&&(Y=j.setInterval($a,c.html5PollingInterval)),ja++))};Za=function(a){a._hasTimer&&(a._hasTimer=!1,!Ka&&c.html5PollingInterval&&ja--)};$a=function(){var a;if(null!==Y&&!ja)return j.clearInterval(Y),
|
89
|
+
Y=null,!1;for(a=c.soundIDs.length-1;0<=a;a--)c.sounds[c.soundIDs[a]].isHTML5&&c.sounds[c.soundIDs[a]]._hasTimer&&c.sounds[c.soundIDs[a]]._onTimer()};O=function(a){a=a!==g?a:{};"function"===typeof c.onerror&&c.onerror.apply(j,[{type:a.type!==g?a.type:null}]);a.fatal!==g&&a.fatal&&c.disable()};db=function(){if(!La||!Ga())return!1;var a=c.audioFormats,d,e;for(e in a)if(a.hasOwnProperty(e)&&("mp3"===e||"mp4"===e))if(c._wD("soundManager: Using flash fallback for "+e+" format"),c.html5[e]=!1,a[e]&&a[e].related)for(d=
|
90
|
+
a[e].related.length-1;0<=d;d--)c.html5[a[e].related[d]]=!1};this._setSandboxType=function(a){var d=c.sandbox;d.type=a;d.description=d.types[d.types[a]!==g?a:"unknown"];"localWithFile"===d.type?(d.noRemote=!0,d.noLocal=!1,k("secNote",2)):"localWithNetwork"===d.type?(d.noRemote=!1,d.noLocal=!0):"localTrusted"===d.type&&(d.noRemote=!1,d.noLocal=!1)};this._externalInterfaceOK=function(a,d){if(c.swfLoaded)return!1;var e;x("swf",!0);x("flashtojs",!0);c.swfLoaded=!0;na=!1;La&&db();if(!d||d.replace(/\+dev/i,
|
91
|
+
"")!==c.versionNumber.replace(/\+dev/i,""))return e='soundManager: Fatal: JavaScript file build "'+c.versionNumber+'" does not match Flash SWF build "'+d+'" at '+c.url+". Ensure both are up-to-date.",setTimeout(function(){throw Error(e);},0),!1;setTimeout(ra,H?100:1)};ga=function(a,d){function e(){var a=[],b,d=[];b="SoundManager "+c.version+(!c.html5Only&&c.useHTML5Audio?c.hasHTML5?" + HTML5 audio":", no HTML5 audio support":"");c.html5Only?c.html5PollingInterval&&a.push("html5PollingInterval ("+
|
92
|
+
c.html5PollingInterval+"ms)"):(c.preferFlash&&a.push("preferFlash"),c.useHighPerformance&&a.push("useHighPerformance"),c.flashPollingInterval&&a.push("flashPollingInterval ("+c.flashPollingInterval+"ms)"),c.html5PollingInterval&&a.push("html5PollingInterval ("+c.html5PollingInterval+"ms)"),c.wmode&&a.push("wmode ("+c.wmode+")"),c.debugFlash&&a.push("debugFlash"),c.useFlashBlock&&a.push("flashBlock"));a.length&&(d=d.concat([a.join(" + ")]));c._wD(b+(d.length?" + "+d.join(", "):""),1);eb()}function b(a,
|
93
|
+
b){return'<param name="'+a+'" value="'+b+'" />'}if(S&&T)return!1;if(c.html5Only)return va(),e(),c.oMC=A(c.movieID),ra(),T=S=!0,!1;var f=d||c.url,j=c.altURL||f,i=fa(),m=P(),l=null,l=h.getElementsByTagName("html")[0],k,q,n,l=l&&l.dir&&l.dir.match(/rtl/i),a=a===g?c.id:a;va();c.url=Wa($?f:j);d=c.url;c.wmode=!c.wmode&&c.useHighPerformance?"transparent":c.wmode;if(null!==c.wmode&&(s.match(/msie 8/i)||!H&&!c.useHighPerformance)&&navigator.platform.match(/win32|win64/i))J.push(F.spcWmode),c.wmode=null;i=
|
94
|
+
{name:a,id:a,src:d,quality:"high",allowScriptAccess:c.allowScriptAccess,bgcolor:c.bgColor,pluginspage:jb+"www.macromedia.com/go/getflashplayer",title:"JS/Flash audio component (SoundManager 2)",type:"application/x-shockwave-flash",wmode:c.wmode,hasPriority:"true"};c.debugFlash&&(i.FlashVars="debug=1");c.wmode||delete i.wmode;if(H)f=h.createElement("div"),q=['<object id="'+a+'" data="'+d+'" type="'+i.type+'" title="'+i.title+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="'+jb+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">',
|
95
|
+
b("movie",d),b("AllowScriptAccess",c.allowScriptAccess),b("quality",i.quality),c.wmode?b("wmode",c.wmode):"",b("bgcolor",c.bgColor),b("hasPriority","true"),c.debugFlash?b("FlashVars",i.FlashVars):"","</object>"].join("");else for(k in f=h.createElement("embed"),i)i.hasOwnProperty(k)&&f.setAttribute(k,i[k]);ya();m=P();if(i=fa())if(c.oMC=A(c.movieID)||h.createElement("div"),c.oMC.id)n=c.oMC.className,c.oMC.className=(n?n+" ":"movieContainer")+(m?" "+m:""),c.oMC.appendChild(f),H&&(k=c.oMC.appendChild(h.createElement("div")),
|
96
|
+
k.className="sm2-object-box",k.innerHTML=q),T=!0;else{c.oMC.id=c.movieID;c.oMC.className="movieContainer "+m;k=m=null;c.useFlashBlock||(c.useHighPerformance?m={position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",overflow:"hidden"}:(m={position:"absolute",width:"6px",height:"6px",top:"-9999px",left:"-9999px"},l&&(m.left=Math.abs(parseInt(m.left,10))+"px")));rb&&(c.oMC.style.zIndex=1E4);if(!c.debugFlash)for(n in m)m.hasOwnProperty(n)&&(c.oMC.style[n]=m[n]);try{H||c.oMC.appendChild(f),
|
97
|
+
i.appendChild(c.oMC),H&&(k=c.oMC.appendChild(h.createElement("div")),k.className="sm2-object-box",k.innerHTML=q),T=!0}catch(r){throw Error(p("domError")+" \n"+r.toString());}}S=!0;e();return!0};ea=function(){if(c.html5Only)return ga(),!1;if(i)return!1;if(!c.url)return k("noURL"),!1;i=c.getMovie(c.id);i||(W?(H?c.oMC.innerHTML=Aa:c.oMC.appendChild(W),W=null,S=!0):ga(c.id,c.url),i=c.getMovie(c.id));"function"===typeof c.oninitmovie&&setTimeout(c.oninitmovie,1);Ha();return!0};M=function(){setTimeout(Sa,
|
98
|
+
1E3)};Sa=function(){var a,d=!1;if(!c.url||X)return!1;X=!0;u.remove(j,"load",M);if(na&&!Ma)return k("waitFocus"),!1;n||(a=c.getMoviePercent(),0<a&&100>a&&(d=!0));setTimeout(function(){a=c.getMoviePercent();if(d)return X=!1,c._wD(p("waitSWF")),j.setTimeout(M,1),!1;n||(c._wD("soundManager: No Flash response within expected time. Likely causes: "+(0===a?"SWF load failed, ":"")+"Flash blocked or JS-Flash security error."+(c.debugFlash?" "+p("checkSWF"):""),2),!$&&a&&(k("localFail",2),c.debugFlash||k("tryDebug",
|
99
|
+
2)),0===a&&c._wD(p("swf404",c.url),1),x("flashtojs",!1,": Timed out"+$?" (Check flash security or flash blockers)":" (No plugin/missing SWF?)"));!n&&hb&&(null===a?c.useFlashBlock||0===c.flashLoadTimeout?(c.useFlashBlock&&Ba(),k("waitForever")):(k("waitForever"),I({type:"ontimeout",ignoreInit:!0})):0===c.flashLoadTimeout?k("waitForever"):za(!0))},c.flashLoadTimeout)};da=function(){if(Ma||!na)return u.remove(j,"focus",da),!0;Ma=hb=!0;k("gotFocus");X=!1;M();u.remove(j,"focus",da);return!0};Ha=function(){J.length&&
|
100
|
+
(c._wD("SoundManager 2: "+J.join(" "),1),J=[])};eb=function(){Ha();var a,d=[];if(c.useHTML5Audio&&c.hasHTML5){for(a in c.audioFormats)c.audioFormats.hasOwnProperty(a)&&d.push(a+" = "+c.html5[a]+(!c.html5[a]&&z&&c.flash[a]?" (using flash)":c.preferFlash&&c.flash[a]&&z?" (preferring flash)":!c.html5[a]?" ("+(c.audioFormats[a].required?"required, ":"")+"and no flash support)":""));c._wD("SoundManager 2 HTML5 support: "+d.join(", "),1)}};U=function(a){if(n)return!1;if(c.html5Only)return k("sm2Loaded"),
|
101
|
+
n=!0,L(),x("onload",!0),!0;var d=!0,e;if(!c.useFlashBlock||!c.flashLoadTimeout||c.getMoviePercent())n=!0,r&&(e={type:!z&&B?"NO_FLASH":"INIT_TIMEOUT"});c._wD("SoundManager 2 "+(r?"failed to load":"loaded")+" ("+(r?"Flash security/load error":"OK")+")",r?2:1);r||a?(c.useFlashBlock&&c.oMC&&(c.oMC.className=P()+" "+(null===c.getMoviePercent()?"swf_timedout":"swf_error")),I({type:"ontimeout",error:e,ignoreInit:!0}),x("onload",!1),O(e),d=!1):x("onload",!0);r||(c.waitForWindowLoad&&!ca?(k("waitOnload"),
|
102
|
+
u.add(j,"load",L)):(c.waitForWindowLoad&&ca&&k("docLoaded"),L()));return d};Ra=function(){var a,d=c.setupOptions;for(a in d)d.hasOwnProperty(a)&&(c[a]===g?c[a]=d[a]:c[a]!==d[a]&&(c.setupOptions[a]=c[a]))};ra=function(){if(n)return k("didInit"),!1;if(c.html5Only)return n||(u.remove(j,"load",c.beginDelayedInit),c.enabled=!0,U()),!0;ea();try{i._externalInterfaceTest(!1),Ta(!0,c.flashPollingInterval||(c.useHighPerformance?10:50)),c.debugMode||i._disableDebug(),c.enabled=!0,x("jstoflash",!0),c.html5Only||
|
103
|
+
u.add(j,"unload",qa)}catch(a){return c._wD("js/flash exception: "+a.toString()),x("jstoflash",!1),O({type:"JS_TO_FLASH_EXCEPTION",fatal:!0}),za(!0),U(),!1}U();u.remove(j,"load",c.beginDelayedInit);return!0};N=function(){if(V)return!1;V=!0;Ra();ya();var a=null,a=null,d=j.console!==g&&"function"===typeof console.log,e=R.toLowerCase();-1!==e.indexOf("sm2-usehtml5audio=")&&(a="1"===e.charAt(e.indexOf("sm2-usehtml5audio=")+18),d&&console.log((a?"Enabling ":"Disabling ")+"useHTML5Audio via URL parameter"),
|
104
|
+
c.setup({useHTML5Audio:a}));-1!==e.indexOf("sm2-preferflash=")&&(a="1"===e.charAt(e.indexOf("sm2-preferflash=")+16),d&&console.log((a?"Enabling ":"Disabling ")+"preferFlash via URL parameter"),c.setup({preferFlash:a}));!z&&c.hasHTML5&&(c._wD("SoundManager: No Flash detected"+(!c.useHTML5Audio?", enabling HTML5.":". Trying HTML5-only mode."),1),c.setup({useHTML5Audio:!0,preferFlash:!1}));bb();c.html5.usingFlash=ab();B=c.html5.usingFlash;!z&&B&&(J.push(F.needFlash),c.setup({flashLoadTimeout:1}));h.removeEventListener&&
|
105
|
+
h.removeEventListener("DOMContentLoaded",N,!1);ea();return!0};Ea=function(){"complete"===h.readyState&&(N(),h.detachEvent("onreadystatechange",Ea));return!0};xa=function(){ca=!0;u.remove(j,"load",xa)};wa=function(){if(Ka&&((!c.setupOptions.useHTML5Audio||c.setupOptions.preferFlash)&&J.push(F.mobileUA),c.setupOptions.useHTML5Audio=!0,c.setupOptions.preferFlash=!1,ma||fb&&!s.match(/android\s2\.3/i)))J.push(F.globalHTML5),ma&&(c.ignoreFlash=!0),D=!0};wa();Ga();u.add(j,"focus",da);u.add(j,"load",M);u.add(j,
|
106
|
+
"load",xa);h.addEventListener?h.addEventListener("DOMContentLoaded",N,!1):h.attachEvent?h.attachEvent("onreadystatechange",Ea):(x("onload",!1),O({type:"NO_DOM2_EVENTS",fatal:!0}))}var pa=null;if(void 0===j.SM2_DEFER||!SM2_DEFER)pa=new aa;j.SoundManager=aa;j.soundManager=pa})(window);
|
@@ -8,73 +8,71 @@
|
|
8
8
|
* Code provided under the BSD License:
|
9
9
|
* http://schillmania.com/projects/soundmanager2/license.txt
|
10
10
|
*
|
11
|
-
* V2.97a.
|
11
|
+
* V2.97a.20130101
|
12
12
|
*/
|
13
|
-
(function(
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
for(
|
27
|
-
c.
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
b.url&&
|
32
|
-
a.
|
33
|
-
|
34
|
-
a.
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
function(
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
!
|
46
|
-
|
47
|
-
|
48
|
-
function(
|
49
|
-
|
50
|
-
b.
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
c.
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
a=a
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
(
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
return!0};E=function(){if(M)return!1;M=!0;Ea();ra();!y&&c.hasHTML5&&c.setup({useHTML5Audio:!0,preferFlash:!1});Na();c.html5.usingFlash=Ma();n=c.html5.usingFlash;Pa();!y&&n&&c.setup({flashLoadTimeout:1});m.removeEventListener&&m.removeEventListener("DOMContentLoaded",E,!1);W();return!0};wa=function(){"complete"===m.readyState&&(E(),m.detachEvent("onreadystatechange",wa));return!0};pa=function(){la=!0;o.remove(h,"load",pa)};xa();o.add(h,"focus",V);o.add(h,"load",D);o.add(h,"load",pa);m.addEventListener?
|
80
|
-
m.addEventListener("DOMContentLoaded",E,!1):m.attachEvent?m.attachEvent("onreadystatechange",wa):F({type:"NO_DOM2_EVENTS",fatal:!0})}var ea=null;if("undefined"===typeof SM2_DEFER||!SM2_DEFER)ea=new R;fa.SoundManager=R;fa.soundManager=ea})(window);
|
13
|
+
(function(i,g){function R(R,fa){function S(b){return c.preferFlash&&A&&!c.ignoreFlash&&c.flash[b]!==g&&c.flash[b]}function m(b){return function(c){var d=this._s;return!d||!d._a?null:b.call(this,c)}}this.setupOptions={url:R||null,flashVersion:8,debugMode:!0,debugFlash:!1,useConsole:!0,consoleOnly:!0,waitForWindowLoad:!1,bgColor:"#ffffff",useHighPerformance:!1,flashPollingInterval:null,html5PollingInterval:null,flashLoadTimeout:1E3,wmode:null,allowScriptAccess:"always",useFlashBlock:!1,useHTML5Audio:!0,
|
14
|
+
html5Test:/^(probably|maybe)$/i,preferFlash:!0,noSWFCache:!1};this.defaultOptions={autoLoad:!1,autoPlay:!1,from:null,loops:1,onid3:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onposition:null,onstop:null,onfailure:null,onfinish:null,multiShot:!0,multiShotEvents:!1,position:null,pan:0,stream:!0,to:null,type:null,usePolicyFile:!1,volume:100};this.flash9Options={isMovieStar:null,usePeakData:!1,useWaveformData:!1,useEQData:!1,onbufferchange:null,ondataerror:null};
|
15
|
+
this.movieStarOptions={bufferTime:3,serverURL:null,onconnect:null,duration:null};this.audioFormats={mp3:{type:['audio/mpeg; codecs="mp3"',"audio/mpeg","audio/mp3","audio/MPA","audio/mpa-robust"],required:!0},mp4:{related:["aac","m4a","m4b"],type:['audio/mp4; codecs="mp4a.40.2"',"audio/aac","audio/x-m4a","audio/MP4A-LATM","audio/mpeg4-generic"],required:!1},ogg:{type:["audio/ogg; codecs=vorbis"],required:!1},wav:{type:['audio/wav; codecs="1"',"audio/wav","audio/wave","audio/x-wav"],required:!1}};this.movieID=
|
16
|
+
"sm2-container";this.id=fa||"sm2movie";this.debugID="soundmanager-debug";this.debugURLParam=/([#?&])debug=1/i;this.versionNumber="V2.97a.20130101";this.altURL=this.movieURL=this.version=null;this.enabled=this.swfLoaded=!1;this.oMC=null;this.sounds={};this.soundIDs=[];this.didFlashBlock=this.muted=!1;this.filePattern=null;this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};this.features={buffering:!1,peakData:!1,waveformData:!1,eqData:!1,movieStar:!1};this.sandbox={};this.html5={usingFlash:null};
|
17
|
+
this.flash={};this.ignoreFlash=this.html5Only=!1;var Ga,c=this,Ha=null,h=null,T,q=navigator.userAgent,ga=i.location.href.toString(),l=document,ha,Ia,ia,k,r=[],J=!1,K=!1,j=!1,s=!1,ja=!1,L,t,ka,U,la,B,C,D,Ja,ma,V,na,W,oa,E,pa,M,qa,X,F,Ka,ra,La,sa,Ma,N=null,ta=null,v,ua,G,Y,Z,H,p,O=!1,va=!1,Na,Oa,Pa,$=0,P=null,aa,Qa=[],u=null,Ra,ba,Q,y,wa,xa,Sa,n,db=Array.prototype.slice,w=!1,ya,A,za,Ta,x,ca=q.match(/(ipad|iphone|ipod)/i),Ua=q.match(/android/i),z=q.match(/msie/i),eb=q.match(/webkit/i),Aa=q.match(/safari/i)&&
|
18
|
+
!q.match(/chrome/i),Ba=q.match(/opera/i),Ca=q.match(/(mobile|pre\/|xoom)/i)||ca||Ua,Va=!ga.match(/usehtml5audio/i)&&!ga.match(/sm2\-ignorebadua/i)&&Aa&&!q.match(/silk/i)&&q.match(/OS X 10_6_([3-7])/i),Da=l.hasFocus!==g?l.hasFocus():null,da=Aa&&(l.hasFocus===g||!l.hasFocus()),Wa=!da,Xa=/(mp3|mp4|mpa|m4a|m4b)/i,Ea=l.location?l.location.protocol.match(/http/i):null,Ya=!Ea?"http://":"",Za=/^\s*audio\/(?:x-)?(?:mpeg4|aac|flv|mov|mp4||m4v|m4a|m4b|mp4v|3gp|3g2)\s*(?:$|;)/i,$a="mpeg4 aac flv mov mp4 m4v f4v m4a m4b mp4v 3gp 3g2".split(" "),
|
19
|
+
fb=RegExp("\\.("+$a.join("|")+")(\\?.*)?$","i");this.mimePattern=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;this.useAltURL=!Ea;var Fa;try{Fa=Audio!==g&&(Ba&&opera!==g&&10>opera.version()?new Audio(null):new Audio).canPlayType!==g}catch(hb){Fa=!1}this.hasHTML5=Fa;this.setup=function(b){var e=!c.url;b!==g&&(j&&u&&c.ok()&&(b.flashVersion!==g||b.url!==g||b.html5Test!==g))&&H(v("setupLate"));ka(b);e&&(M&&b.url!==g)&&c.beginDelayedInit();!M&&(b.url!==g&&"complete"===l.readyState)&&setTimeout(E,1);return c};
|
20
|
+
this.supported=this.ok=function(){return u?j&&!s:c.useHTML5Audio&&c.hasHTML5};this.getMovie=function(b){return T(b)||l[b]||i[b]};this.createSound=function(b,e){function d(){a=Y(a);c.sounds[a.id]=new Ga(a);c.soundIDs.push(a.id);return c.sounds[a.id]}var a,f=null;if(!j||!c.ok())return H(void 0),!1;e!==g&&(b={id:b,url:e});a=t(b);a.url=aa(a.url);if(p(a.id,!0))return c.sounds[a.id];ba(a)?(f=d(),f._setup_html5(a)):(8<k&&null===a.isMovieStar&&(a.isMovieStar=!(!a.serverURL&&!(a.type&&a.type.match(Za)||a.url.match(fb)))),
|
21
|
+
a=Z(a,void 0),f=d(),8===k?h._createSound(a.id,a.loops||1,a.usePolicyFile):(h._createSound(a.id,a.url,a.usePeakData,a.useWaveformData,a.useEQData,a.isMovieStar,a.isMovieStar?a.bufferTime:!1,a.loops||1,a.serverURL,a.duration||null,a.autoPlay,!0,a.autoLoad,a.usePolicyFile),a.serverURL||(f.connected=!0,a.onconnect&&a.onconnect.apply(f))),!a.serverURL&&(a.autoLoad||a.autoPlay)&&f.load(a));!a.serverURL&&a.autoPlay&&f.play();return f};this.destroySound=function(b,e){if(!p(b))return!1;var d=c.sounds[b],a;
|
22
|
+
d._iO={};d.stop();d.unload();for(a=0;a<c.soundIDs.length;a++)if(c.soundIDs[a]===b){c.soundIDs.splice(a,1);break}e||d.destruct(!0);delete c.sounds[b];return!0};this.load=function(b,e){return!p(b)?!1:c.sounds[b].load(e)};this.unload=function(b){return!p(b)?!1:c.sounds[b].unload()};this.onposition=this.onPosition=function(b,e,d,a){return!p(b)?!1:c.sounds[b].onposition(e,d,a)};this.clearOnPosition=function(b,e,d){return!p(b)?!1:c.sounds[b].clearOnPosition(e,d)};this.start=this.play=function(b,e){var d=
|
23
|
+
!1;return!j||!c.ok()?(H("soundManager.play(): "+v(!j?"notReady":"notOK")),d):!p(b)?(e instanceof Object||(e={url:e}),e&&e.url&&(e.id=b,d=c.createSound(e).play()),d):c.sounds[b].play(e)};this.setPosition=function(b,e){return!p(b)?!1:c.sounds[b].setPosition(e)};this.stop=function(b){return!p(b)?!1:c.sounds[b].stop()};this.stopAll=function(){for(var b in c.sounds)c.sounds.hasOwnProperty(b)&&c.sounds[b].stop()};this.pause=function(b){return!p(b)?!1:c.sounds[b].pause()};this.pauseAll=function(){var b;
|
24
|
+
for(b=c.soundIDs.length-1;0<=b;b--)c.sounds[c.soundIDs[b]].pause()};this.resume=function(b){return!p(b)?!1:c.sounds[b].resume()};this.resumeAll=function(){var b;for(b=c.soundIDs.length-1;0<=b;b--)c.sounds[c.soundIDs[b]].resume()};this.togglePause=function(b){return!p(b)?!1:c.sounds[b].togglePause()};this.setPan=function(b,e){return!p(b)?!1:c.sounds[b].setPan(e)};this.setVolume=function(b,e){return!p(b)?!1:c.sounds[b].setVolume(e)};this.mute=function(b){var e=0;b instanceof String&&(b=null);if(b)return!p(b)?
|
25
|
+
!1:c.sounds[b].mute();for(e=c.soundIDs.length-1;0<=e;e--)c.sounds[c.soundIDs[e]].mute();return c.muted=!0};this.muteAll=function(){c.mute()};this.unmute=function(b){b instanceof String&&(b=null);if(b)return!p(b)?!1:c.sounds[b].unmute();for(b=c.soundIDs.length-1;0<=b;b--)c.sounds[c.soundIDs[b]].unmute();c.muted=!1;return!0};this.unmuteAll=function(){c.unmute()};this.toggleMute=function(b){return!p(b)?!1:c.sounds[b].toggleMute()};this.getMemoryUse=function(){var b=0;h&&8!==k&&(b=parseInt(h._getMemoryUse(),
|
26
|
+
10));return b};this.disable=function(b){var e;b===g&&(b=!1);if(s)return!1;s=!0;for(e=c.soundIDs.length-1;0<=e;e--)La(c.sounds[c.soundIDs[e]]);L(b);n.remove(i,"load",C);return!0};this.canPlayMIME=function(b){var e;c.hasHTML5&&(e=Q({type:b}));!e&&u&&(e=b&&c.ok()?!!(8<k&&b.match(Za)||b.match(c.mimePattern)):null);return e};this.canPlayURL=function(b){var e;c.hasHTML5&&(e=Q({url:b}));!e&&u&&(e=b&&c.ok()?!!b.match(c.filePattern):null);return e};this.canPlayLink=function(b){return b.type!==g&&b.type&&c.canPlayMIME(b.type)?
|
27
|
+
!0:c.canPlayURL(b.href)};this.getSoundById=function(b){if(!b)throw Error("soundManager.getSoundById(): sID is null/_undefined");return c.sounds[b]};this.onready=function(b,c){if("function"===typeof b)c||(c=i),la("onready",b,c),B();else throw v("needFunction","onready");return!0};this.ontimeout=function(b,c){if("function"===typeof b)c||(c=i),la("ontimeout",b,c),B({type:"ontimeout"});else throw v("needFunction","ontimeout");return!0};this._wD=this._writeDebug=function(){return!0};this._debug=function(){};
|
28
|
+
this.reboot=function(b,e){var d,a,f;for(d=c.soundIDs.length-1;0<=d;d--)c.sounds[c.soundIDs[d]].destruct();if(h)try{z&&(ta=h.innerHTML),N=h.parentNode.removeChild(h)}catch(g){}ta=N=u=h=null;c.enabled=M=j=O=va=J=K=s=w=c.swfLoaded=!1;c.soundIDs=[];c.sounds={};if(b)r=[];else for(d in r)if(r.hasOwnProperty(d)){a=0;for(f=r[d].length;a<f;a++)r[d][a].fired=!1}c.html5={usingFlash:null};c.flash={};c.html5Only=!1;c.ignoreFlash=!1;i.setTimeout(function(){oa();e||c.beginDelayedInit()},20);return c};this.reset=
|
29
|
+
function(){return c.reboot(!0,!0)};this.getMoviePercent=function(){return h&&"PercentLoaded"in h?h.PercentLoaded():null};this.beginDelayedInit=function(){ja=!0;E();setTimeout(function(){if(va)return!1;X();W();return va=!0},20);D()};this.destruct=function(){c.disable(!0)};Ga=function(b){var e,d,a=this,f,ab,i,I,l,m,q=!1,j=[],n=0,s,u,r=null;d=e=null;this.sID=this.id=b.id;this.url=b.url;this._iO=this.instanceOptions=this.options=t(b);this.pan=this.options.pan;this.volume=this.options.volume;this.isHTML5=
|
30
|
+
!1;this._a=null;this.id3={};this._debug=function(){};this.load=function(b){var c=null;b!==g?a._iO=t(b,a.options):(b=a.options,a._iO=b,r&&r!==a.url&&(a._iO.url=a.url,a.url=null));a._iO.url||(a._iO.url=a.url);a._iO.url=aa(a._iO.url);b=a.instanceOptions=a._iO;if(b.url===a.url&&0!==a.readyState&&2!==a.readyState)return 3===a.readyState&&b.onload&&b.onload.apply(a,[!!a.duration]),a;a.loaded=!1;a.readyState=1;a.playState=0;a.id3={};if(ba(b))c=a._setup_html5(b),c._called_load||(a._html5_canplay=!1,a.url!==
|
31
|
+
b.url&&(a._a.src=b.url,a.setPosition(0)),a._a.autobuffer="auto",a._a.preload="auto",a._a._called_load=!0,b.autoPlay&&a.play());else try{a.isHTML5=!1,a._iO=Z(Y(b)),b=a._iO,8===k?h._load(a.id,b.url,b.stream,b.autoPlay,b.usePolicyFile):h._load(a.id,b.url,!!b.stream,!!b.autoPlay,b.loops||1,!!b.autoLoad,b.usePolicyFile)}catch(e){F({type:"SMSOUND_LOAD_JS_EXCEPTION",fatal:!0})}a.url=b.url;return a};this.unload=function(){0!==a.readyState&&(a.isHTML5?(I(),a._a&&(a._a.pause(),wa(a._a,"about:blank"),r="about:blank")):
|
32
|
+
8===k?h._unload(a.id,"about:blank"):h._unload(a.id),f());return a};this.destruct=function(b){a.isHTML5?(I(),a._a&&(a._a.pause(),wa(a._a),w||i(),a._a._s=null,a._a=null)):(a._iO.onfailure=null,h._destroySound(a.id));b||c.destroySound(a.id,!0)};this.start=this.play=function(b,c){var e,d;d=!0;d=null;c=c===g?!0:c;b||(b={});a.url&&(a._iO.url=a.url);a._iO=t(a._iO,a.options);a._iO=t(b,a._iO);a._iO.url=aa(a._iO.url);a.instanceOptions=a._iO;if(a._iO.serverURL&&!a.connected)return a.getAutoPlay()||a.setAutoPlay(!0),
|
33
|
+
a;ba(a._iO)&&(a._setup_html5(a._iO),l());1===a.playState&&!a.paused&&((e=a._iO.multiShot)||(d=a));if(null!==d)return d;b.url&&b.url!==a.url&&a.load(a._iO);a.loaded||(0===a.readyState?(a.isHTML5||(a._iO.autoPlay=!0),a.load(a._iO),a.instanceOptions=a._iO):2===a.readyState&&(d=a));if(null!==d)return d;!a.isHTML5&&(9===k&&0<a.position&&a.position===a.duration)&&(b.position=0);if(a.paused&&0<=a.position&&(!a._iO.serverURL||0<a.position))a.resume();else{a._iO=t(b,a._iO);if(null!==a._iO.from&&null!==a._iO.to&&
|
34
|
+
0===a.instanceCount&&0===a.playState&&!a._iO.serverURL){e=function(){a._iO=t(b,a._iO);a.play(a._iO)};if(a.isHTML5&&!a._html5_canplay)a.load({oncanplay:e}),d=!1;else if(!a.isHTML5&&!a.loaded&&(!a.readyState||2!==a.readyState))a.load({onload:e}),d=!1;if(null!==d)return d;a._iO=u()}(!a.instanceCount||a._iO.multiShotEvents||!a.isHTML5&&8<k&&!a.getAutoPlay())&&a.instanceCount++;a._iO.onposition&&0===a.playState&&m(a);a.playState=1;a.paused=!1;a.position=a._iO.position!==g&&!isNaN(a._iO.position)?a._iO.position:
|
35
|
+
0;a.isHTML5||(a._iO=Z(Y(a._iO)));a._iO.onplay&&c&&(a._iO.onplay.apply(a),q=!0);a.setVolume(a._iO.volume,!0);a.setPan(a._iO.pan,!0);a.isHTML5?(l(),d=a._setup_html5(),a.setPosition(a._iO.position),d.play()):(d=h._start(a.id,a._iO.loops||1,9===k?a._iO.position:a._iO.position/1E3,a._iO.multiShot),9===k&&!d&&a._iO.onplayerror&&a._iO.onplayerror.apply(a))}return a};this.stop=function(b){var c=a._iO;1===a.playState&&(a._onbufferchange(0),a._resetOnPosition(0),a.paused=!1,a.isHTML5||(a.playState=0),s(),c.to&&
|
36
|
+
a.clearOnPosition(c.to),a.isHTML5?a._a&&(b=a.position,a.setPosition(0),a.position=b,a._a.pause(),a.playState=0,a._onTimer(),I()):(h._stop(a.id,b),c.serverURL&&a.unload()),a.instanceCount=0,a._iO={},c.onstop&&c.onstop.apply(a));return a};this.setAutoPlay=function(b){a._iO.autoPlay=b;a.isHTML5||(h._setAutoPlay(a.id,b),b&&!a.instanceCount&&1===a.readyState&&a.instanceCount++)};this.getAutoPlay=function(){return a._iO.autoPlay};this.setPosition=function(b){b===g&&(b=0);var c=a.isHTML5?Math.max(b,0):Math.min(a.duration||
|
37
|
+
a._iO.duration,Math.max(b,0));a.position=c;b=a.position/1E3;a._resetOnPosition(a.position);a._iO.position=c;if(a.isHTML5){if(a._a&&a._html5_canplay&&a._a.currentTime!==b)try{a._a.currentTime=b,(0===a.playState||a.paused)&&a._a.pause()}catch(e){}}else b=9===k?a.position:b,a.readyState&&2!==a.readyState&&h._setPosition(a.id,b,a.paused||!a.playState,a._iO.multiShot);a.isHTML5&&a.paused&&a._onTimer(!0);return a};this.pause=function(b){if(a.paused||0===a.playState&&1!==a.readyState)return a;a.paused=!0;
|
38
|
+
a.isHTML5?(a._setup_html5().pause(),I()):(b||b===g)&&h._pause(a.id,a._iO.multiShot);a._iO.onpause&&a._iO.onpause.apply(a);return a};this.resume=function(){var b=a._iO;if(!a.paused)return a;a.paused=!1;a.playState=1;a.isHTML5?(a._setup_html5().play(),l()):(b.isMovieStar&&!b.serverURL&&a.setPosition(a.position),h._pause(a.id,b.multiShot));!q&&b.onplay?(b.onplay.apply(a),q=!0):b.onresume&&b.onresume.apply(a);return a};this.togglePause=function(){if(0===a.playState)return a.play({position:9===k&&!a.isHTML5?
|
39
|
+
a.position:a.position/1E3}),a;a.paused?a.resume():a.pause();return a};this.setPan=function(b,c){b===g&&(b=0);c===g&&(c=!1);a.isHTML5||h._setPan(a.id,b);a._iO.pan=b;c||(a.pan=b,a.options.pan=b);return a};this.setVolume=function(b,e){b===g&&(b=100);e===g&&(e=!1);a.isHTML5?a._a&&(a._a.volume=Math.max(0,Math.min(1,b/100))):h._setVolume(a.id,c.muted&&!a.muted||a.muted?0:b);a._iO.volume=b;e||(a.volume=b,a.options.volume=b);return a};this.mute=function(){a.muted=!0;a.isHTML5?a._a&&(a._a.muted=!0):h._setVolume(a.id,
|
40
|
+
0);return a};this.unmute=function(){a.muted=!1;var b=a._iO.volume!==g;a.isHTML5?a._a&&(a._a.muted=!1):h._setVolume(a.id,b?a._iO.volume:a.options.volume);return a};this.toggleMute=function(){return a.muted?a.unmute():a.mute()};this.onposition=this.onPosition=function(b,c,e){j.push({position:parseInt(b,10),method:c,scope:e!==g?e:a,fired:!1});return a};this.clearOnPosition=function(a,b){var c,a=parseInt(a,10);if(isNaN(a))return!1;for(c=0;c<j.length;c++)if(a===j[c].position&&(!b||b===j[c].method))j[c].fired&&
|
41
|
+
n--,j.splice(c,1)};this._processOnPosition=function(){var b,c;b=j.length;if(!b||!a.playState||n>=b)return!1;for(b-=1;0<=b;b--)c=j[b],!c.fired&&a.position>=c.position&&(c.fired=!0,n++,c.method.apply(c.scope,[c.position]));return!0};this._resetOnPosition=function(a){var b,c;b=j.length;if(!b)return!1;for(b-=1;0<=b;b--)c=j[b],c.fired&&a<=c.position&&(c.fired=!1,n--);return!0};u=function(){var b=a._iO,c=b.from,e=b.to,d,f;f=function(){a.clearOnPosition(e,f);a.stop()};d=function(){if(null!==e&&!isNaN(e))a.onPosition(e,
|
42
|
+
f)};null!==c&&!isNaN(c)&&(b.position=c,b.multiShot=!1,d());return b};m=function(){var b,c=a._iO.onposition;if(c)for(b in c)if(c.hasOwnProperty(b))a.onPosition(parseInt(b,10),c[b])};s=function(){var b,c=a._iO.onposition;if(c)for(b in c)c.hasOwnProperty(b)&&a.clearOnPosition(parseInt(b,10))};l=function(){a.isHTML5&&Na(a)};I=function(){a.isHTML5&&Oa(a)};f=function(b){b||(j=[],n=0);q=!1;a._hasTimer=null;a._a=null;a._html5_canplay=!1;a.bytesLoaded=null;a.bytesTotal=null;a.duration=a._iO&&a._iO.duration?
|
43
|
+
a._iO.duration:null;a.durationEstimate=null;a.buffered=[];a.eqData=[];a.eqData.left=[];a.eqData.right=[];a.failures=0;a.isBuffering=!1;a.instanceOptions={};a.instanceCount=0;a.loaded=!1;a.metadata={};a.readyState=0;a.muted=!1;a.paused=!1;a.peakData={left:0,right:0};a.waveformData={left:[],right:[]};a.playState=0;a.position=null;a.id3={}};f();this._onTimer=function(b){var c,f=!1,g={};if(a._hasTimer||b){if(a._a&&(b||(0<a.playState||1===a.readyState)&&!a.paused))c=a._get_html5_duration(),c!==e&&(e=c,
|
44
|
+
a.duration=c,f=!0),a.durationEstimate=a.duration,c=1E3*a._a.currentTime||0,c!==d&&(d=c,f=!0),(f||b)&&a._whileplaying(c,g,g,g,g);return f}};this._get_html5_duration=function(){var b=a._iO;return(b=a._a&&a._a.duration?1E3*a._a.duration:b&&b.duration?b.duration:null)&&!isNaN(b)&&Infinity!==b?b:null};this._apply_loop=function(a,b){a.loop=1<b?"loop":""};this._setup_html5=function(b){var b=t(a._iO,b),c=decodeURI,e=w?Ha:a._a,d=c(b.url),g;w?d===ya&&(g=!0):d===r&&(g=!0);if(e){if(e._s)if(w)e._s&&(e._s.playState&&
|
45
|
+
!g)&&e._s.stop();else if(!w&&d===c(r))return a._apply_loop(e,b.loops),e;g||(f(!1),e.src=b.url,ya=r=a.url=b.url,e._called_load=!1)}else a._a=b.autoLoad||b.autoPlay?new Audio(b.url):Ba&&10>opera.version()?new Audio(null):new Audio,e=a._a,e._called_load=!1,w&&(Ha=e);a.isHTML5=!0;a._a=e;e._s=a;ab();a._apply_loop(e,b.loops);b.autoLoad||b.autoPlay?a.load():(e.autobuffer=!1,e.preload="auto");return e};ab=function(){if(a._a._added_events)return!1;var b;a._a._added_events=!0;for(b in x)x.hasOwnProperty(b)&&
|
46
|
+
a._a&&a._a.addEventListener(b,x[b],!1);return!0};i=function(){var b;a._a._added_events=!1;for(b in x)x.hasOwnProperty(b)&&a._a&&a._a.removeEventListener(b,x[b],!1)};this._onload=function(b){b=!!b||!a.isHTML5&&8===k&&a.duration;a.loaded=b;a.readyState=b?3:2;a._onbufferchange(0);a._iO.onload&&a._iO.onload.apply(a,[b]);return!0};this._onbufferchange=function(b){if(0===a.playState||b&&a.isBuffering||!b&&!a.isBuffering)return!1;a.isBuffering=1===b;a._iO.onbufferchange&&a._iO.onbufferchange.apply(a);return!0};
|
47
|
+
this._onsuspend=function(){a._iO.onsuspend&&a._iO.onsuspend.apply(a);return!0};this._onfailure=function(b,c,e){a.failures++;if(a._iO.onfailure&&1===a.failures)a._iO.onfailure(a,b,c,e)};this._onfinish=function(){var b=a._iO.onfinish;a._onbufferchange(0);a._resetOnPosition(0);a.instanceCount&&(a.instanceCount--,a.instanceCount||(s(),a.playState=0,a.paused=!1,a.instanceCount=0,a.instanceOptions={},a._iO={},I(),a.isHTML5&&(a.position=0)),(!a.instanceCount||a._iO.multiShotEvents)&&b&&b.apply(a))};this._whileloading=
|
48
|
+
function(b,c,e,d){var f=a._iO;a.bytesLoaded=b;a.bytesTotal=c;a.duration=Math.floor(e);a.bufferLength=d;a.durationEstimate=!a.isHTML5&&!f.isMovieStar?f.duration?a.duration>f.duration?a.duration:f.duration:parseInt(a.bytesTotal/a.bytesLoaded*a.duration,10):a.duration;a.isHTML5||(a.buffered=[{start:0,end:a.duration}]);(3!==a.readyState||a.isHTML5)&&f.whileloading&&f.whileloading.apply(a)};this._whileplaying=function(b,c,e,d,f){var h=a._iO;if(isNaN(b)||null===b)return!1;a.position=Math.max(0,b);a._processOnPosition();
|
49
|
+
!a.isHTML5&&8<k&&(h.usePeakData&&(c!==g&&c)&&(a.peakData={left:c.leftPeak,right:c.rightPeak}),h.useWaveformData&&(e!==g&&e)&&(a.waveformData={left:e.split(","),right:d.split(",")}),h.useEQData&&(f!==g&&f&&f.leftEQ)&&(b=f.leftEQ.split(","),a.eqData=b,a.eqData.left=b,f.rightEQ!==g&&f.rightEQ&&(a.eqData.right=f.rightEQ.split(","))));1===a.playState&&(!a.isHTML5&&(8===k&&!a.position&&a.isBuffering)&&a._onbufferchange(0),h.whileplaying&&h.whileplaying.apply(a));return!0};this._oncaptiondata=function(b){a.captiondata=
|
50
|
+
b;a._iO.oncaptiondata&&a._iO.oncaptiondata.apply(a,[b])};this._onmetadata=function(b,c){var e={},d,f;d=0;for(f=b.length;d<f;d++)e[b[d]]=c[d];a.metadata=e;a._iO.onmetadata&&a._iO.onmetadata.apply(a)};this._onid3=function(b,c){var e=[],d,f;d=0;for(f=b.length;d<f;d++)e[b[d]]=c[d];a.id3=t(a.id3,e);a._iO.onid3&&a._iO.onid3.apply(a)};this._onconnect=function(b){b=1===b;if(a.connected=b)a.failures=0,p(a.id)&&(a.getAutoPlay()?a.play(g,a.getAutoPlay()):a._iO.autoLoad&&a.load()),a._iO.onconnect&&a._iO.onconnect.apply(a,
|
51
|
+
[b])};this._ondataerror=function(){0<a.playState&&a._iO.ondataerror&&a._iO.ondataerror.apply(a)}};qa=function(){return l.body||l._docElement||l.getElementsByTagName("div")[0]};T=function(b){return l.getElementById(b)};t=function(b,e){var d=b||{},a,f;a=e===g?c.defaultOptions:e;for(f in a)a.hasOwnProperty(f)&&d[f]===g&&(d[f]="object"!==typeof a[f]||null===a[f]?a[f]:t(d[f],a[f]));return d};U={onready:1,ontimeout:1,defaultOptions:1,flash9Options:1,movieStarOptions:1};ka=function(b,e){var d,a=!0,f=e!==
|
52
|
+
g,h=c.setupOptions;for(d in b)if(b.hasOwnProperty(d))if("object"!==typeof b[d]||null===b[d]||b[d]instanceof Array||b[d]instanceof RegExp)f&&U[e]!==g?c[e][d]=b[d]:h[d]!==g?(c.setupOptions[d]=b[d],c[d]=b[d]):U[d]===g?(H(v(c[d]===g?"setupUndef":"setupError",d),2),a=!1):c[d]instanceof Function?c[d].apply(c,b[d]instanceof Array?b[d]:[b[d]]):c[d]=b[d];else if(U[d]===g)H(v(c[d]===g?"setupUndef":"setupError",d),2),a=!1;else return ka(b[d],d);return a};var bb=function(b){var b=db.call(b),c=b.length;ea?(b[1]=
|
53
|
+
"on"+b[1],3<c&&b.pop()):3===c&&b.push(!1);return b},cb=function(b,c){var d=b.shift(),a=[gb[c]];if(ea)d[a](b[0],b[1]);else d[a].apply(d,b)},ea=i.attachEvent,gb={add:ea?"attachEvent":"addEventListener",remove:ea?"detachEvent":"removeEventListener"};n={add:function(){cb(bb(arguments),"add")},remove:function(){cb(bb(arguments),"remove")}};x={abort:m(function(){}),canplay:m(function(){var b=this._s,c;if(b._html5_canplay)return!0;b._html5_canplay=!0;b._onbufferchange(0);c=b._iO.position!==g&&!isNaN(b._iO.position)?
|
54
|
+
b._iO.position/1E3:null;if(b.position&&this.currentTime!==c)try{this.currentTime=c}catch(d){}b._iO._oncanplay&&b._iO._oncanplay()}),canplaythrough:m(function(){var b=this._s;b.loaded||(b._onbufferchange(0),b._whileloading(b.bytesLoaded,b.bytesTotal,b._get_html5_duration()),b._onload(!0))}),ended:m(function(){this._s._onfinish()}),error:m(function(){this._s._onload(!1)}),loadeddata:m(function(){var b=this._s;!b._loaded&&!Aa&&(b.duration=b._get_html5_duration())}),loadedmetadata:m(function(){}),loadstart:m(function(){this._s._onbufferchange(1)}),
|
55
|
+
play:m(function(){this._s._onbufferchange(0)}),playing:m(function(){this._s._onbufferchange(0)}),progress:m(function(b){var c=this._s,d,a,f=0,f=b.target.buffered;d=b.loaded||0;var g=b.total||1;c.buffered=[];if(f&&f.length){d=0;for(a=f.length;d<a;d++)c.buffered.push({start:1E3*f.start(d),end:1E3*f.end(d)});f=1E3*(f.end(0)-f.start(0));d=f/(1E3*b.target.duration)}isNaN(d)||(c._onbufferchange(0),c._whileloading(d,g,c._get_html5_duration()),d&&(g&&d===g)&&x.canplaythrough.call(this,b))}),ratechange:m(function(){}),
|
56
|
+
suspend:m(function(b){var c=this._s;x.progress.call(this,b);c._onsuspend()}),stalled:m(function(){}),timeupdate:m(function(){this._s._onTimer()}),waiting:m(function(){this._s._onbufferchange(1)})};ba=function(b){return b.serverURL||b.type&&S(b.type)?!1:b.type?Q({type:b.type}):Q({url:b.url})||c.html5Only};wa=function(b,c){b&&(b.src=c,b._called_load=!1);w&&(ya=null)};Q=function(b){if(!c.useHTML5Audio||!c.hasHTML5)return!1;var e=b.url||null,b=b.type||null,d=c.audioFormats,a;if(b&&c.html5[b]!==g)return c.html5[b]&&
|
57
|
+
!S(b);if(!y){y=[];for(a in d)d.hasOwnProperty(a)&&(y.push(a),d[a].related&&(y=y.concat(d[a].related)));y=RegExp("\\.("+y.join("|")+")(\\?.*)?$","i")}a=e?e.toLowerCase().match(y):null;!a||!a.length?b&&(e=b.indexOf(";"),a=(-1!==e?b.substr(0,e):b).substr(6)):a=a[1];a&&c.html5[a]!==g?e=c.html5[a]&&!S(a):(b="audio/"+a,e=c.html5.canPlayType({type:b}),e=(c.html5[a]=e)&&c.html5[b]&&!S(b));return e};Sa=function(){function b(a){var b,d,f=b=!1;if(!e||"function"!==typeof e.canPlayType)return b;if(a instanceof
|
58
|
+
Array){b=0;for(d=a.length;b<d;b++)if(c.html5[a[b]]||e.canPlayType(a[b]).match(c.html5Test))f=!0,c.html5[a[b]]=!0,c.flash[a[b]]=!!a[b].match(Xa);b=f}else a=e&&"function"===typeof e.canPlayType?e.canPlayType(a):!1,b=!(!a||!a.match(c.html5Test));return b}if(!c.useHTML5Audio||!c.hasHTML5)return!1;var e=Audio!==g?Ba&&10>opera.version()?new Audio(null):new Audio:null,d,a,f={},h;h=c.audioFormats;for(d in h)if(h.hasOwnProperty(d)&&(a="audio/"+d,f[d]=b(h[d].type),f[a]=f[d],d.match(Xa)?(c.flash[d]=!0,c.flash[a]=
|
59
|
+
!0):(c.flash[d]=!1,c.flash[a]=!1),h[d]&&h[d].related))for(a=h[d].related.length-1;0<=a;a--)f["audio/"+h[d].related[a]]=f[d],c.html5[h[d].related[a]]=f[d],c.flash[h[d].related[a]]=f[d];f.canPlayType=e?b:null;c.html5=t(c.html5,f);return!0};na={};v=function(){};Y=function(b){8===k&&(1<b.loops&&b.stream)&&(b.stream=!1);return b};Z=function(b){if(b&&!b.usePolicyFile&&(b.onid3||b.usePeakData||b.useWaveformData||b.useEQData))b.usePolicyFile=!0;return b};H=function(){};ha=function(){return!1};La=function(b){for(var c in b)b.hasOwnProperty(c)&&
|
60
|
+
"function"===typeof b[c]&&(b[c]=ha)};sa=function(b){b===g&&(b=!1);(s||b)&&c.disable(b)};Ma=function(b){var e=null;if(b)if(b.match(/\.swf(\?.*)?$/i)){if(e=b.substr(b.toLowerCase().lastIndexOf(".swf?")+4))return b}else b.lastIndexOf("/")!==b.length-1&&(b+="/");b=(b&&-1!==b.lastIndexOf("/")?b.substr(0,b.lastIndexOf("/")+1):"./")+c.movieURL;c.noSWFCache&&(b+="?ts="+(new Date).getTime());return b};ma=function(){k=parseInt(c.flashVersion,10);8!==k&&9!==k&&(c.flashVersion=k=8);var b=c.debugMode||c.debugFlash?
|
61
|
+
"_debug.swf":".swf";c.useHTML5Audio&&(!c.html5Only&&c.audioFormats.mp4.required&&9>k)&&(c.flashVersion=k=9);c.version=c.versionNumber+(c.html5Only?" (HTML5-only mode)":9===k?" (AS3/Flash 9)":" (AS2/Flash 8)");8<k?(c.defaultOptions=t(c.defaultOptions,c.flash9Options),c.features.buffering=!0,c.defaultOptions=t(c.defaultOptions,c.movieStarOptions),c.filePatterns.flash9=RegExp("\\.(mp3|"+$a.join("|")+")(\\?.*)?$","i"),c.features.movieStar=!0):c.features.movieStar=!1;c.filePattern=c.filePatterns[8!==k?
|
62
|
+
"flash9":"flash8"];c.movieURL=(8===k?"soundmanager2.swf":"soundmanager2_flash9.swf").replace(".swf",b);c.features.peakData=c.features.waveformData=c.features.eqData=8<k};Ka=function(b,c){if(!h)return!1;h._setPolling(b,c)};ra=function(){c.debugURLParam.test(ga)&&(c.debugMode=!0)};p=this.getSoundById;G=function(){var b=[];c.debugMode&&b.push("sm2_debug");c.debugFlash&&b.push("flash_debug");c.useHighPerformance&&b.push("high_performance");return b.join(" ")};ua=function(){v("fbHandler");var b=c.getMoviePercent(),
|
63
|
+
e={type:"FLASHBLOCK"};if(c.html5Only)return!1;c.ok()?c.oMC&&(c.oMC.className=[G(),"movieContainer","swf_loaded"+(c.didFlashBlock?" swf_unblocked":"")].join(" ")):(u&&(c.oMC.className=G()+" movieContainer "+(null===b?"swf_timedout":"swf_error")),c.didFlashBlock=!0,B({type:"ontimeout",ignoreInit:!0,error:e}),F(e))};la=function(b,c,d){r[b]===g&&(r[b]=[]);r[b].push({method:c,scope:d||null,fired:!1})};B=function(b){b||(b={type:c.ok()?"onready":"ontimeout"});if(!j&&b&&!b.ignoreInit||"ontimeout"===b.type&&
|
64
|
+
(c.ok()||s&&!b.ignoreInit))return!1;var e={success:b&&b.ignoreInit?c.ok():!s},d=b&&b.type?r[b.type]||[]:[],a=[],f,e=[e],g=u&&!c.ok();b.error&&(e[0].error=b.error);b=0;for(f=d.length;b<f;b++)!0!==d[b].fired&&a.push(d[b]);if(a.length){b=0;for(f=a.length;b<f;b++)a[b].scope?a[b].method.apply(a[b].scope,e):a[b].method.apply(this,e),g||(a[b].fired=!0)}return!0};C=function(){i.setTimeout(function(){c.useFlashBlock&&ua();B();"function"===typeof c.onload&&c.onload.apply(i);c.waitForWindowLoad&&n.add(i,"load",
|
65
|
+
C)},1)};za=function(){if(A!==g)return A;var b=!1,c=navigator,d=c.plugins,a,f=i.ActiveXObject;if(d&&d.length)(c=c.mimeTypes)&&(c["application/x-shockwave-flash"]&&c["application/x-shockwave-flash"].enabledPlugin&&c["application/x-shockwave-flash"].enabledPlugin.description)&&(b=!0);else if(f!==g&&!q.match(/MSAppHost/i)){try{a=new f("ShockwaveFlash.ShockwaveFlash")}catch(h){}b=!!a}return A=b};Ra=function(){var b,e,d=c.audioFormats;if(ca&&q.match(/os (1|2|3_0|3_1)/i))c.hasHTML5=!1,c.html5Only=!0,c.oMC&&
|
66
|
+
(c.oMC.style.display="none");else if(c.useHTML5Audio&&(!c.html5||!c.html5.canPlayType))c.hasHTML5=!1;if(c.useHTML5Audio&&c.hasHTML5)for(e in d)if(d.hasOwnProperty(e)&&(d[e].required&&!c.html5.canPlayType(d[e].type)||c.preferFlash&&(c.flash[e]||c.flash[d[e].type])))b=!0;c.ignoreFlash&&(b=!1);c.html5Only=c.hasHTML5&&c.useHTML5Audio&&!b;return!c.html5Only};aa=function(b){var e,d,a=0;if(b instanceof Array){e=0;for(d=b.length;e<d;e++)if(b[e]instanceof Object){if(c.canPlayMIME(b[e].type)){a=e;break}}else if(c.canPlayURL(b[e])){a=
|
67
|
+
e;break}b[a].url&&(b[a]=b[a].url);b=b[a]}return b};Na=function(b){b._hasTimer||(b._hasTimer=!0,!Ca&&c.html5PollingInterval&&(null===P&&0===$&&(P=i.setInterval(Pa,c.html5PollingInterval)),$++))};Oa=function(b){b._hasTimer&&(b._hasTimer=!1,!Ca&&c.html5PollingInterval&&$--)};Pa=function(){var b;if(null!==P&&!$)return i.clearInterval(P),P=null,!1;for(b=c.soundIDs.length-1;0<=b;b--)c.sounds[c.soundIDs[b]].isHTML5&&c.sounds[c.soundIDs[b]]._hasTimer&&c.sounds[c.soundIDs[b]]._onTimer()};F=function(b){b=b!==
|
68
|
+
g?b:{};"function"===typeof c.onerror&&c.onerror.apply(i,[{type:b.type!==g?b.type:null}]);b.fatal!==g&&b.fatal&&c.disable()};Ta=function(){if(!Va||!za())return!1;var b=c.audioFormats,e,d;for(d in b)if(b.hasOwnProperty(d)&&("mp3"===d||"mp4"===d))if(c.html5[d]=!1,b[d]&&b[d].related)for(e=b[d].related.length-1;0<=e;e--)c.html5[b[d].related[e]]=!1};this._setSandboxType=function(){};this._externalInterfaceOK=function(){if(c.swfLoaded)return!1;c.swfLoaded=!0;da=!1;Va&&Ta();setTimeout(ia,z?100:1)};X=function(b,
|
69
|
+
e){function d(a,b){return'<param name="'+a+'" value="'+b+'" />'}if(J&&K)return!1;if(c.html5Only)return ma(),c.oMC=T(c.movieID),ia(),K=J=!0,!1;var a=e||c.url,f=c.altURL||a,h=qa(),i=G(),k=null,k=l.getElementsByTagName("html")[0],j,n,m,k=k&&k.dir&&k.dir.match(/rtl/i),b=b===g?c.id:b;ma();c.url=Ma(Ea?a:f);e=c.url;c.wmode=!c.wmode&&c.useHighPerformance?"transparent":c.wmode;if(null!==c.wmode&&(q.match(/msie 8/i)||!z&&!c.useHighPerformance)&&navigator.platform.match(/win32|win64/i))Qa.push(na.spcWmode),
|
70
|
+
c.wmode=null;h={name:b,id:b,src:e,quality:"high",allowScriptAccess:c.allowScriptAccess,bgcolor:c.bgColor,pluginspage:Ya+"www.macromedia.com/go/getflashplayer",title:"JS/Flash audio component (SoundManager 2)",type:"application/x-shockwave-flash",wmode:c.wmode,hasPriority:"true"};c.debugFlash&&(h.FlashVars="debug=1");c.wmode||delete h.wmode;if(z)a=l.createElement("div"),n=['<object id="'+b+'" data="'+e+'" type="'+h.type+'" title="'+h.title+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="'+
|
71
|
+
Ya+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">',d("movie",e),d("AllowScriptAccess",c.allowScriptAccess),d("quality",h.quality),c.wmode?d("wmode",c.wmode):"",d("bgcolor",c.bgColor),d("hasPriority","true"),c.debugFlash?d("FlashVars",h.FlashVars):"","</object>"].join("");else for(j in a=l.createElement("embed"),h)h.hasOwnProperty(j)&&a.setAttribute(j,h[j]);ra();i=G();if(h=qa())if(c.oMC=T(c.movieID)||l.createElement("div"),c.oMC.id)m=c.oMC.className,c.oMC.className=
|
72
|
+
(m?m+" ":"movieContainer")+(i?" "+i:""),c.oMC.appendChild(a),z&&(j=c.oMC.appendChild(l.createElement("div")),j.className="sm2-object-box",j.innerHTML=n),K=!0;else{c.oMC.id=c.movieID;c.oMC.className="movieContainer "+i;j=i=null;c.useFlashBlock||(c.useHighPerformance?i={position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",overflow:"hidden"}:(i={position:"absolute",width:"6px",height:"6px",top:"-9999px",left:"-9999px"},k&&(i.left=Math.abs(parseInt(i.left,10))+"px")));eb&&(c.oMC.style.zIndex=
|
73
|
+
1E4);if(!c.debugFlash)for(m in i)i.hasOwnProperty(m)&&(c.oMC.style[m]=i[m]);try{z||c.oMC.appendChild(a),h.appendChild(c.oMC),z&&(j=c.oMC.appendChild(l.createElement("div")),j.className="sm2-object-box",j.innerHTML=n),K=!0}catch(p){throw Error(v("domError")+" \n"+p.toString());}}return J=!0};W=function(){if(c.html5Only)return X(),!1;if(h||!c.url)return!1;h=c.getMovie(c.id);h||(N?(z?c.oMC.innerHTML=ta:c.oMC.appendChild(N),N=null,J=!0):X(c.id,c.url),h=c.getMovie(c.id));"function"===typeof c.oninitmovie&&
|
74
|
+
setTimeout(c.oninitmovie,1);return!0};D=function(){setTimeout(Ja,1E3)};Ja=function(){var b,e=!1;if(!c.url||O)return!1;O=!0;n.remove(i,"load",D);if(da&&!Da)return!1;j||(b=c.getMoviePercent(),0<b&&100>b&&(e=!0));setTimeout(function(){b=c.getMoviePercent();if(e)return O=!1,i.setTimeout(D,1),!1;!j&&Wa&&(null===b?c.useFlashBlock||0===c.flashLoadTimeout?c.useFlashBlock&&ua():B({type:"ontimeout",ignoreInit:!0}):0!==c.flashLoadTimeout&&sa(!0))},c.flashLoadTimeout)};V=function(){if(Da||!da)return n.remove(i,
|
75
|
+
"focus",V),!0;Da=Wa=!0;O=!1;D();n.remove(i,"focus",V);return!0};L=function(b){if(j)return!1;if(c.html5Only)return j=!0,C(),!0;var e=!0,d;if(!c.useFlashBlock||!c.flashLoadTimeout||c.getMoviePercent())j=!0,s&&(d={type:!A&&u?"NO_FLASH":"INIT_TIMEOUT"});if(s||b)c.useFlashBlock&&c.oMC&&(c.oMC.className=G()+" "+(null===c.getMoviePercent()?"swf_timedout":"swf_error")),B({type:"ontimeout",error:d,ignoreInit:!0}),F(d),e=!1;s||(c.waitForWindowLoad&&!ja?n.add(i,"load",C):C());return e};Ia=function(){var b,e=
|
76
|
+
c.setupOptions;for(b in e)e.hasOwnProperty(b)&&(c[b]===g?c[b]=e[b]:c[b]!==e[b]&&(c.setupOptions[b]=c[b]))};ia=function(){if(j)return!1;if(c.html5Only)return j||(n.remove(i,"load",c.beginDelayedInit),c.enabled=!0,L()),!0;W();try{h._externalInterfaceTest(!1),Ka(!0,c.flashPollingInterval||(c.useHighPerformance?10:50)),c.debugMode||h._disableDebug(),c.enabled=!0,c.html5Only||n.add(i,"unload",ha)}catch(b){return F({type:"JS_TO_FLASH_EXCEPTION",fatal:!0}),sa(!0),L(),!1}L();n.remove(i,"load",c.beginDelayedInit);
|
77
|
+
return!0};E=function(){if(M)return!1;M=!0;Ia();ra();!A&&c.hasHTML5&&c.setup({useHTML5Audio:!0,preferFlash:!1});Sa();c.html5.usingFlash=Ra();u=c.html5.usingFlash;!A&&u&&(Qa.push(na.needFlash),c.setup({flashLoadTimeout:1}));l.removeEventListener&&l.removeEventListener("DOMContentLoaded",E,!1);W();return!0};xa=function(){"complete"===l.readyState&&(E(),l.detachEvent("onreadystatechange",xa));return!0};pa=function(){ja=!0;n.remove(i,"load",pa)};oa=function(){if(Ca&&(c.setupOptions.useHTML5Audio=!0,c.setupOptions.preferFlash=
|
78
|
+
!1,ca||Ua&&!q.match(/android\s2\.3/i)))ca&&(c.ignoreFlash=!0),w=!0};oa();za();n.add(i,"focus",V);n.add(i,"load",D);n.add(i,"load",pa);l.addEventListener?l.addEventListener("DOMContentLoaded",E,!1):l.attachEvent?l.attachEvent("onreadystatechange",xa):F({type:"NO_DOM2_EVENTS",fatal:!0})}var fa=null;if(void 0===i.SM2_DEFER||!SM2_DEFER)fa=new R;i.SoundManager=R;i.soundManager=fa})(window);
|
@@ -8,13 +8,14 @@
|
|
8
8
|
* Code provided under the BSD License:
|
9
9
|
* http://schillmania.com/projects/soundmanager2/license.txt
|
10
10
|
*
|
11
|
-
* V2.97a.
|
11
|
+
* V2.97a.20130101
|
12
12
|
*/
|
13
13
|
|
14
|
-
/*global window, SM2_DEFER, sm2Debugger, console, document, navigator, setTimeout, setInterval, clearInterval, Audio */
|
14
|
+
/*global window, SM2_DEFER, sm2Debugger, console, document, navigator, setTimeout, setInterval, clearInterval, Audio, opera */
|
15
15
|
/*jslint regexp: true, sloppy: true, white: true, nomen: true, plusplus: true */
|
16
16
|
|
17
|
-
(function(window) {
|
17
|
+
(function(window, _undefined) {
|
18
|
+
"use strict";
|
18
19
|
var soundManager = null;
|
19
20
|
function SoundManager(smURL, smID) {
|
20
21
|
this.setupOptions = {
|
@@ -101,7 +102,7 @@ function SoundManager(smURL, smID) {
|
|
101
102
|
this.id = (smID || 'sm2movie');
|
102
103
|
this.debugID = 'soundmanager-debug';
|
103
104
|
this.debugURLParam = /([#?&])debug=1/i;
|
104
|
-
this.versionNumber = 'V2.97a.
|
105
|
+
this.versionNumber = 'V2.97a.20130101';
|
105
106
|
this.version = null;
|
106
107
|
this.movieURL = null;
|
107
108
|
this.altURL = null;
|
@@ -126,13 +127,6 @@ function SoundManager(smURL, smID) {
|
|
126
127
|
};
|
127
128
|
this.sandbox = {
|
128
129
|
};
|
129
|
-
this.hasHTML5 = (function() {
|
130
|
-
try {
|
131
|
-
return (typeof Audio !== 'undefined' && typeof (_isOpera && opera.version() < 10 ? new Audio(null) : new Audio()).canPlayType !== 'undefined');
|
132
|
-
} catch(e) {
|
133
|
-
return false;
|
134
|
-
}
|
135
|
-
}());
|
136
130
|
this.html5 = {
|
137
131
|
'usingFlash': null
|
138
132
|
};
|
@@ -140,22 +134,21 @@ function SoundManager(smURL, smID) {
|
|
140
134
|
this.html5Only = false;
|
141
135
|
this.ignoreFlash = false;
|
142
136
|
var SMSound,
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
137
|
+
sm2 = this, globalHTML5Audio = null, flash = null, sm = 'soundManager', smc = sm + ': ', h5 = 'HTML5::', id, ua = navigator.userAgent, wl = window.location.href.toString(), doc = document, doNothing, setProperties, init, fV, on_queue = [], debugOpen = true, debugTS, didAppend = false, appendSuccess = false, didInit = false, disabled = false, windowLoaded = false, _wDS, wdCount = 0, initComplete, mixin, assign, extraOptions, addOnEvent, processOnEvents, initUserOnload, delayWaitForEI, waitForEI, setVersionInfo, handleFocus, strings, initMovie, preInit, domContentLoaded, winOnLoad, didDCLoaded, getDocument, createMovie, catchError, setPolling, initDebug, debugLevels = ['log', 'info', 'warn', 'error'], defaultFlashVersion = 8, disableObject, failSafely, normalizeMovieURL, oRemoved = null, oRemovedHTML = null, str, flashBlockHandler, getSWFCSS, swfCSS, toggleDebug, loopFix, policyFix, complain, idCheck, waitingForEI = false, initPending = false, startTimer, stopTimer, timerExecute, h5TimerCount = 0, h5IntervalTimer = null, parseURL, messages = [],
|
138
|
+
needsFlash = null, featureCheck, html5OK, html5CanPlay, html5Ext, html5Unload, domContentLoadedIE, testHTML5, event, slice = Array.prototype.slice, useGlobalHTML5Audio = false, lastGlobalHTML5URL, hasFlash, detectFlash, badSafariFix, html5_events, showSupport, flushMessages,
|
139
|
+
is_iDevice = ua.match(/(ipad|iphone|ipod)/i), isAndroid = ua.match(/android/i), isIE = ua.match(/msie/i), isWebkit = ua.match(/webkit/i), isSafari = (ua.match(/safari/i) && !ua.match(/chrome/i)), isOpera = (ua.match(/opera/i)),
|
140
|
+
mobileHTML5 = (ua.match(/(mobile|pre\/|xoom)/i) || is_iDevice || isAndroid),
|
141
|
+
isBadSafari = (!wl.match(/usehtml5audio/i) && !wl.match(/sm2\-ignorebadua/i) && isSafari && !ua.match(/silk/i) && ua.match(/OS X 10_6_([3-7])/i)),
|
142
|
+
hasConsole = (window.console !== _undefined && console.log !== _undefined), isFocused = (doc.hasFocus !== _undefined?doc.hasFocus():null), tryInitOnFocus = (isSafari && (doc.hasFocus === _undefined || !doc.hasFocus())), okToDisable = !tryInitOnFocus, flashMIME = /(mp3|mp4|mpa|m4a|m4b)/i,
|
143
|
+
emptyURL = 'about:blank',
|
144
|
+
overHTTP = (doc.location?doc.location.protocol.match(/http/i):null),
|
145
|
+
http = (!overHTTP ? 'http:/'+'/' : ''),
|
146
|
+
netStreamMimeTypes = /^\s*audio\/(?:x-)?(?:mpeg4|aac|flv|mov|mp4||m4v|m4a|m4b|mp4v|3gp|3g2)\s*(?:$|;)/i,
|
147
|
+
netStreamTypes = ['mpeg4', 'aac', 'flv', 'mov', 'mp4', 'm4v', 'f4v', 'm4a', 'm4b', 'mp4v', '3gp', '3g2'],
|
148
|
+
netStreamPattern = new RegExp('\\.(' + netStreamTypes.join('|') + ')(\\?.*)?$', 'i');
|
155
149
|
this.mimePattern = /^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;
|
156
|
-
this.useAltURL = !
|
157
|
-
|
158
|
-
_swfCSS = {
|
150
|
+
this.useAltURL = !overHTTP;
|
151
|
+
swfCSS = {
|
159
152
|
'swfBox': 'sm2-object-box',
|
160
153
|
'swfDefault': 'movieContainer',
|
161
154
|
'swfError': 'swf_error',
|
@@ -166,101 +159,99 @@ function SoundManager(smURL, smID) {
|
|
166
159
|
'highPerf': 'high_performance',
|
167
160
|
'flashDebug': 'flash_debug'
|
168
161
|
};
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
_useGlobalHTML5Audio = true;
|
162
|
+
this.hasHTML5 = (function() {
|
163
|
+
try {
|
164
|
+
return (Audio !== _undefined && (isOpera && opera !== _undefined && opera.version() < 10 ? new Audio(null) : new Audio()).canPlayType !== _undefined);
|
165
|
+
} catch(e) {
|
166
|
+
return false;
|
175
167
|
}
|
176
|
-
}
|
168
|
+
}());
|
177
169
|
this.setup = function(options) {
|
178
|
-
var noURL = (!
|
179
|
-
if (
|
180
|
-
|
170
|
+
var noURL = (!sm2.url);
|
171
|
+
if (options !== _undefined && didInit && needsFlash && sm2.ok() && (options.flashVersion !== _undefined || options.url !== _undefined || options.html5Test !== _undefined)) {
|
172
|
+
complain(str('setupLate'));
|
181
173
|
}
|
182
|
-
|
183
|
-
if (noURL &&
|
184
|
-
|
174
|
+
assign(options);
|
175
|
+
if (noURL && didDCLoaded && options.url !== _undefined) {
|
176
|
+
sm2.beginDelayedInit();
|
185
177
|
}
|
186
|
-
if (!
|
187
|
-
setTimeout(
|
178
|
+
if (!didDCLoaded && options.url !== _undefined && doc.readyState === 'complete') {
|
179
|
+
setTimeout(domContentLoaded, 1);
|
188
180
|
}
|
189
|
-
return
|
181
|
+
return sm2;
|
190
182
|
};
|
191
183
|
this.ok = function() {
|
192
|
-
return (
|
184
|
+
return (needsFlash?(didInit && !disabled):(sm2.useHTML5Audio && sm2.hasHTML5));
|
193
185
|
};
|
194
186
|
this.supported = this.ok;
|
195
187
|
this.getMovie = function(smID) {
|
196
|
-
return
|
188
|
+
return id(smID) || doc[smID] || window[smID];
|
197
189
|
};
|
198
190
|
this.createSound = function(oOptions, _url) {
|
199
|
-
var
|
200
|
-
if (!
|
201
|
-
|
191
|
+
var cs, cs_string, options, oSound = null;
|
192
|
+
if (!didInit || !sm2.ok()) {
|
193
|
+
complain(cs_string);
|
202
194
|
return false;
|
203
195
|
}
|
204
|
-
if (
|
196
|
+
if (_url !== _undefined) {
|
205
197
|
oOptions = {
|
206
198
|
'id': oOptions,
|
207
199
|
'url': _url
|
208
200
|
};
|
209
201
|
}
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
return _s.sounds[_tO.id];
|
202
|
+
options = mixin(oOptions);
|
203
|
+
options.url = parseURL(options.url);
|
204
|
+
if (idCheck(options.id, true)) {
|
205
|
+
return sm2.sounds[options.id];
|
215
206
|
}
|
216
207
|
function make() {
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
return
|
208
|
+
options = loopFix(options);
|
209
|
+
sm2.sounds[options.id] = new SMSound(options);
|
210
|
+
sm2.soundIDs.push(options.id);
|
211
|
+
return sm2.sounds[options.id];
|
221
212
|
}
|
222
|
-
if (
|
213
|
+
if (html5OK(options)) {
|
223
214
|
oSound = make();
|
224
|
-
oSound._setup_html5(
|
215
|
+
oSound._setup_html5(options);
|
225
216
|
} else {
|
226
|
-
if (
|
227
|
-
if (
|
228
|
-
|
217
|
+
if (fV > 8) {
|
218
|
+
if (options.isMovieStar === null) {
|
219
|
+
options.isMovieStar = !!(options.serverURL || (options.type ? options.type.match(netStreamMimeTypes) : false) || options.url.match(netStreamPattern));
|
229
220
|
}
|
230
221
|
}
|
231
|
-
|
222
|
+
options = policyFix(options, cs);
|
232
223
|
oSound = make();
|
233
|
-
if (
|
234
|
-
|
224
|
+
if (fV === 8) {
|
225
|
+
flash._createSound(options.id, options.loops||1, options.usePolicyFile);
|
235
226
|
} else {
|
236
|
-
|
237
|
-
if (!
|
227
|
+
flash._createSound(options.id, options.url, options.usePeakData, options.useWaveformData, options.useEQData, options.isMovieStar, (options.isMovieStar?options.bufferTime:false), options.loops||1, options.serverURL, options.duration||null, options.autoPlay, true, options.autoLoad, options.usePolicyFile);
|
228
|
+
if (!options.serverURL) {
|
238
229
|
oSound.connected = true;
|
239
|
-
if (
|
240
|
-
|
230
|
+
if (options.onconnect) {
|
231
|
+
options.onconnect.apply(oSound);
|
241
232
|
}
|
242
233
|
}
|
243
234
|
}
|
244
|
-
if (!
|
245
|
-
oSound.load(
|
235
|
+
if (!options.serverURL && (options.autoLoad || options.autoPlay)) {
|
236
|
+
oSound.load(options);
|
246
237
|
}
|
247
238
|
}
|
248
|
-
if (!
|
239
|
+
if (!options.serverURL && options.autoPlay) {
|
249
240
|
oSound.play();
|
250
241
|
}
|
251
242
|
return oSound;
|
252
243
|
};
|
253
244
|
this.destroySound = function(sID, _bFromSound) {
|
254
|
-
if (!
|
245
|
+
if (!idCheck(sID)) {
|
255
246
|
return false;
|
256
247
|
}
|
257
|
-
var oS =
|
248
|
+
var oS = sm2.sounds[sID], i;
|
258
249
|
oS._iO = {};
|
259
250
|
oS.stop();
|
260
251
|
oS.unload();
|
261
|
-
for (i = 0; i <
|
262
|
-
if (
|
263
|
-
|
252
|
+
for (i = 0; i < sm2.soundIDs.length; i++) {
|
253
|
+
if (sm2.soundIDs[i] === sID) {
|
254
|
+
sm2.soundIDs.splice(i, 1);
|
264
255
|
break;
|
265
256
|
}
|
266
257
|
}
|
@@ -268,41 +259,41 @@ function SoundManager(smURL, smID) {
|
|
268
259
|
oS.destruct(true);
|
269
260
|
}
|
270
261
|
oS = null;
|
271
|
-
delete
|
262
|
+
delete sm2.sounds[sID];
|
272
263
|
return true;
|
273
264
|
};
|
274
265
|
this.load = function(sID, oOptions) {
|
275
|
-
if (!
|
266
|
+
if (!idCheck(sID)) {
|
276
267
|
return false;
|
277
268
|
}
|
278
|
-
return
|
269
|
+
return sm2.sounds[sID].load(oOptions);
|
279
270
|
};
|
280
271
|
this.unload = function(sID) {
|
281
|
-
if (!
|
272
|
+
if (!idCheck(sID)) {
|
282
273
|
return false;
|
283
274
|
}
|
284
|
-
return
|
275
|
+
return sm2.sounds[sID].unload();
|
285
276
|
};
|
286
277
|
this.onPosition = function(sID, nPosition, oMethod, oScope) {
|
287
|
-
if (!
|
278
|
+
if (!idCheck(sID)) {
|
288
279
|
return false;
|
289
280
|
}
|
290
|
-
return
|
281
|
+
return sm2.sounds[sID].onposition(nPosition, oMethod, oScope);
|
291
282
|
};
|
292
283
|
this.onposition = this.onPosition;
|
293
284
|
this.clearOnPosition = function(sID, nPosition, oMethod) {
|
294
|
-
if (!
|
285
|
+
if (!idCheck(sID)) {
|
295
286
|
return false;
|
296
287
|
}
|
297
|
-
return
|
288
|
+
return sm2.sounds[sID].clearOnPosition(nPosition, oMethod);
|
298
289
|
};
|
299
290
|
this.play = function(sID, oOptions) {
|
300
291
|
var result = false;
|
301
|
-
if (!
|
302
|
-
|
292
|
+
if (!didInit || !sm2.ok()) {
|
293
|
+
complain(sm + '.play(): ' + str(!didInit?'notReady':'notOK'));
|
303
294
|
return result;
|
304
295
|
}
|
305
|
-
if (!
|
296
|
+
if (!idCheck(sID)) {
|
306
297
|
if (!(oOptions instanceof Object)) {
|
307
298
|
oOptions = {
|
308
299
|
url: oOptions
|
@@ -310,179 +301,179 @@ function SoundManager(smURL, smID) {
|
|
310
301
|
}
|
311
302
|
if (oOptions && oOptions.url) {
|
312
303
|
oOptions.id = sID;
|
313
|
-
result =
|
304
|
+
result = sm2.createSound(oOptions).play();
|
314
305
|
}
|
315
306
|
return result;
|
316
307
|
}
|
317
|
-
return
|
308
|
+
return sm2.sounds[sID].play(oOptions);
|
318
309
|
};
|
319
310
|
this.start = this.play;
|
320
311
|
this.setPosition = function(sID, nMsecOffset) {
|
321
|
-
if (!
|
312
|
+
if (!idCheck(sID)) {
|
322
313
|
return false;
|
323
314
|
}
|
324
|
-
return
|
315
|
+
return sm2.sounds[sID].setPosition(nMsecOffset);
|
325
316
|
};
|
326
317
|
this.stop = function(sID) {
|
327
|
-
if (!
|
318
|
+
if (!idCheck(sID)) {
|
328
319
|
return false;
|
329
320
|
}
|
330
|
-
return
|
321
|
+
return sm2.sounds[sID].stop();
|
331
322
|
};
|
332
323
|
this.stopAll = function() {
|
333
324
|
var oSound;
|
334
|
-
for (oSound in
|
335
|
-
if (
|
336
|
-
|
325
|
+
for (oSound in sm2.sounds) {
|
326
|
+
if (sm2.sounds.hasOwnProperty(oSound)) {
|
327
|
+
sm2.sounds[oSound].stop();
|
337
328
|
}
|
338
329
|
}
|
339
330
|
};
|
340
331
|
this.pause = function(sID) {
|
341
|
-
if (!
|
332
|
+
if (!idCheck(sID)) {
|
342
333
|
return false;
|
343
334
|
}
|
344
|
-
return
|
335
|
+
return sm2.sounds[sID].pause();
|
345
336
|
};
|
346
337
|
this.pauseAll = function() {
|
347
338
|
var i;
|
348
|
-
for (i =
|
349
|
-
|
339
|
+
for (i = sm2.soundIDs.length-1; i >= 0; i--) {
|
340
|
+
sm2.sounds[sm2.soundIDs[i]].pause();
|
350
341
|
}
|
351
342
|
};
|
352
343
|
this.resume = function(sID) {
|
353
|
-
if (!
|
344
|
+
if (!idCheck(sID)) {
|
354
345
|
return false;
|
355
346
|
}
|
356
|
-
return
|
347
|
+
return sm2.sounds[sID].resume();
|
357
348
|
};
|
358
349
|
this.resumeAll = function() {
|
359
350
|
var i;
|
360
|
-
for (i =
|
361
|
-
|
351
|
+
for (i = sm2.soundIDs.length-1; i >= 0; i--) {
|
352
|
+
sm2.sounds[sm2.soundIDs[i]].resume();
|
362
353
|
}
|
363
354
|
};
|
364
355
|
this.togglePause = function(sID) {
|
365
|
-
if (!
|
356
|
+
if (!idCheck(sID)) {
|
366
357
|
return false;
|
367
358
|
}
|
368
|
-
return
|
359
|
+
return sm2.sounds[sID].togglePause();
|
369
360
|
};
|
370
361
|
this.setPan = function(sID, nPan) {
|
371
|
-
if (!
|
362
|
+
if (!idCheck(sID)) {
|
372
363
|
return false;
|
373
364
|
}
|
374
|
-
return
|
365
|
+
return sm2.sounds[sID].setPan(nPan);
|
375
366
|
};
|
376
367
|
this.setVolume = function(sID, nVol) {
|
377
|
-
if (!
|
368
|
+
if (!idCheck(sID)) {
|
378
369
|
return false;
|
379
370
|
}
|
380
|
-
return
|
371
|
+
return sm2.sounds[sID].setVolume(nVol);
|
381
372
|
};
|
382
373
|
this.mute = function(sID) {
|
383
374
|
var i = 0;
|
384
|
-
if (
|
375
|
+
if (sID instanceof String) {
|
385
376
|
sID = null;
|
386
377
|
}
|
387
378
|
if (!sID) {
|
388
|
-
for (i =
|
389
|
-
|
379
|
+
for (i = sm2.soundIDs.length-1; i >= 0; i--) {
|
380
|
+
sm2.sounds[sm2.soundIDs[i]].mute();
|
390
381
|
}
|
391
|
-
|
382
|
+
sm2.muted = true;
|
392
383
|
} else {
|
393
|
-
if (!
|
384
|
+
if (!idCheck(sID)) {
|
394
385
|
return false;
|
395
386
|
}
|
396
|
-
return
|
387
|
+
return sm2.sounds[sID].mute();
|
397
388
|
}
|
398
389
|
return true;
|
399
390
|
};
|
400
391
|
this.muteAll = function() {
|
401
|
-
|
392
|
+
sm2.mute();
|
402
393
|
};
|
403
394
|
this.unmute = function(sID) {
|
404
395
|
var i;
|
405
|
-
if (
|
396
|
+
if (sID instanceof String) {
|
406
397
|
sID = null;
|
407
398
|
}
|
408
399
|
if (!sID) {
|
409
|
-
for (i =
|
410
|
-
|
400
|
+
for (i = sm2.soundIDs.length-1; i >= 0; i--) {
|
401
|
+
sm2.sounds[sm2.soundIDs[i]].unmute();
|
411
402
|
}
|
412
|
-
|
403
|
+
sm2.muted = false;
|
413
404
|
} else {
|
414
|
-
if (!
|
405
|
+
if (!idCheck(sID)) {
|
415
406
|
return false;
|
416
407
|
}
|
417
|
-
return
|
408
|
+
return sm2.sounds[sID].unmute();
|
418
409
|
}
|
419
410
|
return true;
|
420
411
|
};
|
421
412
|
this.unmuteAll = function() {
|
422
|
-
|
413
|
+
sm2.unmute();
|
423
414
|
};
|
424
415
|
this.toggleMute = function(sID) {
|
425
|
-
if (!
|
416
|
+
if (!idCheck(sID)) {
|
426
417
|
return false;
|
427
418
|
}
|
428
|
-
return
|
419
|
+
return sm2.sounds[sID].toggleMute();
|
429
420
|
};
|
430
421
|
this.getMemoryUse = function() {
|
431
422
|
var ram = 0;
|
432
|
-
if (
|
433
|
-
ram = parseInt(
|
423
|
+
if (flash && fV !== 8) {
|
424
|
+
ram = parseInt(flash._getMemoryUse(), 10);
|
434
425
|
}
|
435
426
|
return ram;
|
436
427
|
};
|
437
428
|
this.disable = function(bNoDisable) {
|
438
429
|
var i;
|
439
|
-
if (
|
430
|
+
if (bNoDisable === _undefined) {
|
440
431
|
bNoDisable = false;
|
441
432
|
}
|
442
|
-
if (
|
433
|
+
if (disabled) {
|
443
434
|
return false;
|
444
435
|
}
|
445
|
-
|
446
|
-
for (i =
|
447
|
-
|
436
|
+
disabled = true;
|
437
|
+
for (i = sm2.soundIDs.length-1; i >= 0; i--) {
|
438
|
+
disableObject(sm2.sounds[sm2.soundIDs[i]]);
|
448
439
|
}
|
449
|
-
|
450
|
-
|
440
|
+
initComplete(bNoDisable);
|
441
|
+
event.remove(window, 'load', initUserOnload);
|
451
442
|
return true;
|
452
443
|
};
|
453
444
|
this.canPlayMIME = function(sMIME) {
|
454
445
|
var result;
|
455
|
-
if (
|
456
|
-
result =
|
446
|
+
if (sm2.hasHTML5) {
|
447
|
+
result = html5CanPlay({type:sMIME});
|
457
448
|
}
|
458
|
-
if (!result &&
|
459
|
-
result = (sMIME &&
|
449
|
+
if (!result && needsFlash) {
|
450
|
+
result = (sMIME && sm2.ok() ? !!((fV > 8 ? sMIME.match(netStreamMimeTypes) : null) || sMIME.match(sm2.mimePattern)) : null);
|
460
451
|
}
|
461
452
|
return result;
|
462
453
|
};
|
463
454
|
this.canPlayURL = function(sURL) {
|
464
455
|
var result;
|
465
|
-
if (
|
466
|
-
result =
|
456
|
+
if (sm2.hasHTML5) {
|
457
|
+
result = html5CanPlay({url: sURL});
|
467
458
|
}
|
468
|
-
if (!result &&
|
469
|
-
result = (sURL &&
|
459
|
+
if (!result && needsFlash) {
|
460
|
+
result = (sURL && sm2.ok() ? !!(sURL.match(sm2.filePattern)) : null);
|
470
461
|
}
|
471
462
|
return result;
|
472
463
|
};
|
473
464
|
this.canPlayLink = function(oLink) {
|
474
|
-
if (
|
475
|
-
if (
|
465
|
+
if (oLink.type !== _undefined && oLink.type) {
|
466
|
+
if (sm2.canPlayMIME(oLink.type)) {
|
476
467
|
return true;
|
477
468
|
}
|
478
469
|
}
|
479
|
-
return
|
470
|
+
return sm2.canPlayURL(oLink.href);
|
480
471
|
};
|
481
472
|
this.getSoundById = function(sID, _suppressDebug) {
|
482
473
|
if (!sID) {
|
483
|
-
throw new Error(
|
474
|
+
throw new Error(sm + '.getSoundById(): sID is null/_undefined');
|
484
475
|
}
|
485
|
-
var result =
|
476
|
+
var result = sm2.sounds[sID];
|
486
477
|
return result;
|
487
478
|
};
|
488
479
|
this.onready = function(oMethod, oScope) {
|
@@ -490,13 +481,13 @@ function SoundManager(smURL, smID) {
|
|
490
481
|
result = false;
|
491
482
|
if (typeof oMethod === 'function') {
|
492
483
|
if (!oScope) {
|
493
|
-
oScope =
|
484
|
+
oScope = window;
|
494
485
|
}
|
495
|
-
|
496
|
-
|
486
|
+
addOnEvent(sType, oMethod, oScope);
|
487
|
+
processOnEvents();
|
497
488
|
result = true;
|
498
489
|
} else {
|
499
|
-
throw
|
490
|
+
throw str('needFunction', sType);
|
500
491
|
}
|
501
492
|
return result;
|
502
493
|
};
|
@@ -505,80 +496,98 @@ function SoundManager(smURL, smID) {
|
|
505
496
|
result = false;
|
506
497
|
if (typeof oMethod === 'function') {
|
507
498
|
if (!oScope) {
|
508
|
-
oScope =
|
499
|
+
oScope = window;
|
509
500
|
}
|
510
|
-
|
511
|
-
|
501
|
+
addOnEvent(sType, oMethod, oScope);
|
502
|
+
processOnEvents({type:sType});
|
512
503
|
result = true;
|
513
504
|
} else {
|
514
|
-
throw
|
505
|
+
throw str('needFunction', sType);
|
515
506
|
}
|
516
507
|
return result;
|
517
508
|
};
|
518
|
-
this._writeDebug = function(sText, sType
|
509
|
+
this._writeDebug = function(sText, sType) {
|
519
510
|
return true;
|
520
511
|
};
|
521
512
|
this._wD = this._writeDebug;
|
522
513
|
this._debug = function() {
|
523
514
|
};
|
524
|
-
this.reboot = function() {
|
525
|
-
var i, j;
|
526
|
-
for (i =
|
527
|
-
|
515
|
+
this.reboot = function(resetEvents, excludeInit) {
|
516
|
+
var i, j, k;
|
517
|
+
for (i = sm2.soundIDs.length-1; i >= 0; i--) {
|
518
|
+
sm2.sounds[sm2.soundIDs[i]].destruct();
|
528
519
|
}
|
529
|
-
if (
|
520
|
+
if (flash) {
|
530
521
|
try {
|
531
|
-
if (
|
532
|
-
|
522
|
+
if (isIE) {
|
523
|
+
oRemovedHTML = flash.innerHTML;
|
533
524
|
}
|
534
|
-
|
525
|
+
oRemoved = flash.parentNode.removeChild(flash);
|
535
526
|
} catch(e) {
|
536
527
|
}
|
537
528
|
}
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
529
|
+
oRemovedHTML = oRemoved = needsFlash = flash = null;
|
530
|
+
sm2.enabled = didDCLoaded = didInit = waitingForEI = initPending = didAppend = appendSuccess = disabled = useGlobalHTML5Audio = sm2.swfLoaded = false;
|
531
|
+
sm2.soundIDs = [];
|
532
|
+
sm2.sounds = {};
|
533
|
+
if (!resetEvents) {
|
534
|
+
for (i in on_queue) {
|
535
|
+
if (on_queue.hasOwnProperty(i)) {
|
536
|
+
for (j = 0, k = on_queue[i].length; j < k; j++) {
|
537
|
+
on_queue[i][j].fired = false;
|
538
|
+
}
|
547
539
|
}
|
548
540
|
}
|
541
|
+
} else {
|
542
|
+
on_queue = [];
|
549
543
|
}
|
550
|
-
|
544
|
+
sm2.html5 = {
|
545
|
+
'usingFlash': null
|
546
|
+
};
|
547
|
+
sm2.flash = {};
|
548
|
+
sm2.html5Only = false;
|
549
|
+
sm2.ignoreFlash = false;
|
550
|
+
window.setTimeout(function() {
|
551
|
+
preInit();
|
552
|
+
if (!excludeInit) {
|
553
|
+
sm2.beginDelayedInit();
|
554
|
+
}
|
555
|
+
}, 20);
|
556
|
+
return sm2;
|
557
|
+
};
|
558
|
+
this.reset = function() {
|
559
|
+
return sm2.reboot(true, true);
|
551
560
|
};
|
552
561
|
this.getMoviePercent = function() {
|
553
|
-
return (
|
562
|
+
return (flash && 'PercentLoaded' in flash ? flash.PercentLoaded() : null);
|
554
563
|
};
|
555
564
|
this.beginDelayedInit = function() {
|
556
|
-
|
557
|
-
|
565
|
+
windowLoaded = true;
|
566
|
+
domContentLoaded();
|
558
567
|
setTimeout(function() {
|
559
|
-
if (
|
568
|
+
if (initPending) {
|
560
569
|
return false;
|
561
570
|
}
|
562
|
-
|
563
|
-
|
564
|
-
|
571
|
+
createMovie();
|
572
|
+
initMovie();
|
573
|
+
initPending = true;
|
565
574
|
return true;
|
566
575
|
}, 20);
|
567
|
-
|
576
|
+
delayWaitForEI();
|
568
577
|
};
|
569
578
|
this.destruct = function() {
|
570
|
-
|
579
|
+
sm2.disable(true);
|
571
580
|
};
|
572
581
|
SMSound = function(oOptions) {
|
573
|
-
var
|
574
|
-
|
582
|
+
var s = this, resetProperties, add_html5_events, remove_html5_events, stop_html5_timer, start_html5_timer, attachOnPosition, onplay_called = false, onPositionItems = [], onPositionFired = 0, detachOnPosition, applyFromTo, lastURL = null, lastHTML5State;
|
583
|
+
lastHTML5State = {
|
575
584
|
duration: null,
|
576
585
|
time: null
|
577
586
|
};
|
578
587
|
this.id = oOptions.id;
|
579
588
|
this.sID = this.id;
|
580
589
|
this.url = oOptions.url;
|
581
|
-
this.options =
|
590
|
+
this.options = mixin(oOptions);
|
582
591
|
this.instanceOptions = this.options;
|
583
592
|
this._iO = this.instanceOptions;
|
584
593
|
this.pan = this.options.pan;
|
@@ -589,155 +598,154 @@ function SoundManager(smURL, smID) {
|
|
589
598
|
this._debug = function() {
|
590
599
|
};
|
591
600
|
this.load = function(oOptions) {
|
592
|
-
var
|
593
|
-
if (
|
594
|
-
|
595
|
-
_t.instanceOptions = _t._iO;
|
601
|
+
var oSound = null, instanceOptions;
|
602
|
+
if (oOptions !== _undefined) {
|
603
|
+
s._iO = mixin(oOptions, s.options);
|
596
604
|
} else {
|
597
|
-
oOptions =
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
_t.setPosition(0);
|
605
|
+
oOptions = s.options;
|
606
|
+
s._iO = oOptions;
|
607
|
+
if (lastURL && lastURL !== s.url) {
|
608
|
+
s._iO.url = s.url;
|
609
|
+
s.url = null;
|
610
|
+
}
|
611
|
+
}
|
612
|
+
if (!s._iO.url) {
|
613
|
+
s._iO.url = s.url;
|
614
|
+
}
|
615
|
+
s._iO.url = parseURL(s._iO.url);
|
616
|
+
s.instanceOptions = s._iO;
|
617
|
+
instanceOptions = s._iO;
|
618
|
+
if (instanceOptions.url === s.url && s.readyState !== 0 && s.readyState !== 2) {
|
619
|
+
if (s.readyState === 3 && instanceOptions.onload) {
|
620
|
+
instanceOptions.onload.apply(s, [(!!s.duration)]);
|
621
|
+
}
|
622
|
+
return s;
|
623
|
+
}
|
624
|
+
s.loaded = false;
|
625
|
+
s.readyState = 1;
|
626
|
+
s.playState = 0;
|
627
|
+
s.id3 = {};
|
628
|
+
if (html5OK(instanceOptions)) {
|
629
|
+
oSound = s._setup_html5(instanceOptions);
|
630
|
+
if (!oSound._called_load) {
|
631
|
+
s._html5_canplay = false;
|
632
|
+
if (s.url !== instanceOptions.url) {
|
633
|
+
s._a.src = instanceOptions.url;
|
634
|
+
s.setPosition(0);
|
628
635
|
}
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
if (
|
633
|
-
|
636
|
+
s._a.autobuffer = 'auto';
|
637
|
+
s._a.preload = 'auto';
|
638
|
+
s._a._called_load = true;
|
639
|
+
if (instanceOptions.autoPlay) {
|
640
|
+
s.play();
|
634
641
|
}
|
635
642
|
} else {
|
636
643
|
}
|
637
644
|
} else {
|
638
645
|
try {
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
if (
|
643
|
-
|
646
|
+
s.isHTML5 = false;
|
647
|
+
s._iO = policyFix(loopFix(instanceOptions));
|
648
|
+
instanceOptions = s._iO;
|
649
|
+
if (fV === 8) {
|
650
|
+
flash._load(s.id, instanceOptions.url, instanceOptions.stream, instanceOptions.autoPlay, instanceOptions.usePolicyFile);
|
644
651
|
} else {
|
645
|
-
|
652
|
+
flash._load(s.id, instanceOptions.url, !!(instanceOptions.stream), !!(instanceOptions.autoPlay), instanceOptions.loops||1, !!(instanceOptions.autoLoad), instanceOptions.usePolicyFile);
|
646
653
|
}
|
647
654
|
} catch(e) {
|
648
|
-
|
655
|
+
catchError({type:'SMSOUND_LOAD_JS_EXCEPTION', fatal:true});
|
649
656
|
}
|
650
657
|
}
|
651
|
-
|
652
|
-
return
|
658
|
+
s.url = instanceOptions.url;
|
659
|
+
return s;
|
653
660
|
};
|
654
661
|
this.unload = function() {
|
655
|
-
if (
|
656
|
-
if (!
|
657
|
-
if (
|
658
|
-
|
662
|
+
if (s.readyState !== 0) {
|
663
|
+
if (!s.isHTML5) {
|
664
|
+
if (fV === 8) {
|
665
|
+
flash._unload(s.id, emptyURL);
|
659
666
|
} else {
|
660
|
-
|
667
|
+
flash._unload(s.id);
|
661
668
|
}
|
662
669
|
} else {
|
663
|
-
|
664
|
-
if (
|
665
|
-
|
666
|
-
|
667
|
-
|
670
|
+
stop_html5_timer();
|
671
|
+
if (s._a) {
|
672
|
+
s._a.pause();
|
673
|
+
html5Unload(s._a, emptyURL);
|
674
|
+
lastURL = emptyURL;
|
668
675
|
}
|
669
676
|
}
|
670
|
-
|
677
|
+
resetProperties();
|
671
678
|
}
|
672
|
-
return
|
679
|
+
return s;
|
673
680
|
};
|
674
681
|
this.destruct = function(_bFromSM) {
|
675
|
-
if (!
|
676
|
-
|
677
|
-
|
682
|
+
if (!s.isHTML5) {
|
683
|
+
s._iO.onfailure = null;
|
684
|
+
flash._destroySound(s.id);
|
678
685
|
} else {
|
679
|
-
|
680
|
-
if (
|
681
|
-
|
682
|
-
|
683
|
-
if (!
|
684
|
-
|
686
|
+
stop_html5_timer();
|
687
|
+
if (s._a) {
|
688
|
+
s._a.pause();
|
689
|
+
html5Unload(s._a);
|
690
|
+
if (!useGlobalHTML5Audio) {
|
691
|
+
remove_html5_events();
|
685
692
|
}
|
686
|
-
|
687
|
-
|
693
|
+
s._a._s = null;
|
694
|
+
s._a = null;
|
688
695
|
}
|
689
696
|
}
|
690
697
|
if (!_bFromSM) {
|
691
|
-
|
698
|
+
sm2.destroySound(s.id, true);
|
692
699
|
}
|
693
700
|
};
|
694
701
|
this.play = function(oOptions, _updatePlayState) {
|
695
702
|
var fN, allowMulti, a, onready, startOK = true,
|
696
703
|
exit = null;
|
697
|
-
_updatePlayState = (
|
704
|
+
_updatePlayState = (_updatePlayState === _undefined ? true : _updatePlayState);
|
698
705
|
if (!oOptions) {
|
699
706
|
oOptions = {};
|
700
707
|
}
|
701
|
-
if (
|
702
|
-
|
708
|
+
if (s.url) {
|
709
|
+
s._iO.url = s.url;
|
703
710
|
}
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
if (
|
709
|
-
if (!
|
710
|
-
|
711
|
+
s._iO = mixin(s._iO, s.options);
|
712
|
+
s._iO = mixin(oOptions, s._iO);
|
713
|
+
s._iO.url = parseURL(s._iO.url);
|
714
|
+
s.instanceOptions = s._iO;
|
715
|
+
if (s._iO.serverURL && !s.connected) {
|
716
|
+
if (!s.getAutoPlay()) {
|
717
|
+
s.setAutoPlay(true);
|
711
718
|
}
|
712
|
-
return
|
719
|
+
return s;
|
713
720
|
}
|
714
|
-
if (
|
715
|
-
|
716
|
-
|
721
|
+
if (html5OK(s._iO)) {
|
722
|
+
s._setup_html5(s._iO);
|
723
|
+
start_html5_timer();
|
717
724
|
}
|
718
|
-
if (
|
719
|
-
allowMulti =
|
725
|
+
if (s.playState === 1 && !s.paused) {
|
726
|
+
allowMulti = s._iO.multiShot;
|
720
727
|
if (!allowMulti) {
|
721
|
-
exit =
|
728
|
+
exit = s;
|
722
729
|
} else {
|
723
730
|
}
|
724
731
|
}
|
725
732
|
if (exit !== null) {
|
726
733
|
return exit;
|
727
734
|
}
|
728
|
-
if (oOptions.url && oOptions.url !==
|
729
|
-
|
735
|
+
if (oOptions.url && oOptions.url !== s.url) {
|
736
|
+
s.load(s._iO);
|
730
737
|
}
|
731
|
-
if (!
|
732
|
-
if (
|
733
|
-
if (!
|
734
|
-
|
735
|
-
|
738
|
+
if (!s.loaded) {
|
739
|
+
if (s.readyState === 0) {
|
740
|
+
if (!s.isHTML5) {
|
741
|
+
s._iO.autoPlay = true;
|
742
|
+
s.load(s._iO);
|
736
743
|
} else {
|
737
|
-
|
744
|
+
s.load(s._iO);
|
738
745
|
}
|
739
|
-
|
740
|
-
|
746
|
+
s.instanceOptions = s._iO;
|
747
|
+
} else if (s.readyState === 2) {
|
748
|
+
exit = s;
|
741
749
|
} else {
|
742
750
|
}
|
743
751
|
} else {
|
@@ -745,25 +753,25 @@ function SoundManager(smURL, smID) {
|
|
745
753
|
if (exit !== null) {
|
746
754
|
return exit;
|
747
755
|
}
|
748
|
-
if (!
|
756
|
+
if (!s.isHTML5 && fV === 9 && s.position > 0 && s.position === s.duration) {
|
749
757
|
oOptions.position = 0;
|
750
758
|
}
|
751
|
-
if (
|
752
|
-
|
759
|
+
if (s.paused && s.position >= 0 && (!s._iO.serverURL || s.position > 0)) {
|
760
|
+
s.resume();
|
753
761
|
} else {
|
754
|
-
|
755
|
-
if (
|
762
|
+
s._iO = mixin(oOptions, s._iO);
|
763
|
+
if (s._iO.from !== null && s._iO.to !== null && s.instanceCount === 0 && s.playState === 0 && !s._iO.serverURL) {
|
756
764
|
onready = function() {
|
757
|
-
|
758
|
-
|
765
|
+
s._iO = mixin(oOptions, s._iO);
|
766
|
+
s.play(s._iO);
|
759
767
|
};
|
760
|
-
if (
|
761
|
-
|
762
|
-
|
768
|
+
if (s.isHTML5 && !s._html5_canplay) {
|
769
|
+
s.load({
|
770
|
+
oncanplay: onready
|
763
771
|
});
|
764
772
|
exit = false;
|
765
|
-
} else if (!
|
766
|
-
|
773
|
+
} else if (!s.isHTML5 && !s.loaded && (!s.readyState || s.readyState !== 2)) {
|
774
|
+
s.load({
|
767
775
|
onload: onready
|
768
776
|
});
|
769
777
|
exit = false;
|
@@ -771,118 +779,119 @@ function SoundManager(smURL, smID) {
|
|
771
779
|
if (exit !== null) {
|
772
780
|
return exit;
|
773
781
|
}
|
774
|
-
|
775
|
-
}
|
776
|
-
if (!
|
777
|
-
|
778
|
-
}
|
779
|
-
if (
|
780
|
-
|
781
|
-
}
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
if (!
|
786
|
-
|
787
|
-
}
|
788
|
-
if (
|
789
|
-
|
790
|
-
|
791
|
-
}
|
792
|
-
|
793
|
-
|
794
|
-
if (!
|
795
|
-
startOK =
|
796
|
-
if (
|
797
|
-
if (
|
798
|
-
|
782
|
+
s._iO = applyFromTo();
|
783
|
+
}
|
784
|
+
if (!s.instanceCount || s._iO.multiShotEvents || (!s.isHTML5 && fV > 8 && !s.getAutoPlay())) {
|
785
|
+
s.instanceCount++;
|
786
|
+
}
|
787
|
+
if (s._iO.onposition && s.playState === 0) {
|
788
|
+
attachOnPosition(s);
|
789
|
+
}
|
790
|
+
s.playState = 1;
|
791
|
+
s.paused = false;
|
792
|
+
s.position = (s._iO.position !== _undefined && !isNaN(s._iO.position) ? s._iO.position : 0);
|
793
|
+
if (!s.isHTML5) {
|
794
|
+
s._iO = policyFix(loopFix(s._iO));
|
795
|
+
}
|
796
|
+
if (s._iO.onplay && _updatePlayState) {
|
797
|
+
s._iO.onplay.apply(s);
|
798
|
+
onplay_called = true;
|
799
|
+
}
|
800
|
+
s.setVolume(s._iO.volume, true);
|
801
|
+
s.setPan(s._iO.pan, true);
|
802
|
+
if (!s.isHTML5) {
|
803
|
+
startOK = flash._start(s.id, s._iO.loops || 1, (fV === 9 ? s._iO.position : s._iO.position / 1000), s._iO.multiShot);
|
804
|
+
if (fV === 9 && !startOK) {
|
805
|
+
if (s._iO.onplayerror) {
|
806
|
+
s._iO.onplayerror.apply(s);
|
799
807
|
}
|
800
808
|
}
|
801
809
|
} else {
|
802
|
-
|
803
|
-
a =
|
804
|
-
|
810
|
+
start_html5_timer();
|
811
|
+
a = s._setup_html5();
|
812
|
+
s.setPosition(s._iO.position);
|
805
813
|
a.play();
|
806
814
|
}
|
807
815
|
}
|
808
|
-
return
|
816
|
+
return s;
|
809
817
|
};
|
810
818
|
this.start = this.play;
|
811
819
|
this.stop = function(bAll) {
|
812
|
-
var
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
820
|
+
var instanceOptions = s._iO,
|
821
|
+
originalPosition;
|
822
|
+
if (s.playState === 1) {
|
823
|
+
s._onbufferchange(0);
|
824
|
+
s._resetOnPosition(0);
|
825
|
+
s.paused = false;
|
826
|
+
if (!s.isHTML5) {
|
827
|
+
s.playState = 0;
|
828
|
+
}
|
829
|
+
detachOnPosition();
|
830
|
+
if (instanceOptions.to) {
|
831
|
+
s.clearOnPosition(instanceOptions.to);
|
832
|
+
}
|
833
|
+
if (!s.isHTML5) {
|
834
|
+
flash._stop(s.id, bAll);
|
835
|
+
if (instanceOptions.serverURL) {
|
836
|
+
s.unload();
|
828
837
|
}
|
829
838
|
} else {
|
830
|
-
if (
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
839
|
+
if (s._a) {
|
840
|
+
originalPosition = s.position;
|
841
|
+
s.setPosition(0);
|
842
|
+
s.position = originalPosition;
|
843
|
+
s._a.pause();
|
844
|
+
s.playState = 0;
|
845
|
+
s._onTimer();
|
846
|
+
stop_html5_timer();
|
838
847
|
}
|
839
848
|
}
|
840
|
-
|
841
|
-
|
842
|
-
if (
|
843
|
-
|
849
|
+
s.instanceCount = 0;
|
850
|
+
s._iO = {};
|
851
|
+
if (instanceOptions.onstop) {
|
852
|
+
instanceOptions.onstop.apply(s);
|
844
853
|
}
|
845
854
|
}
|
846
|
-
return
|
855
|
+
return s;
|
847
856
|
};
|
848
857
|
this.setAutoPlay = function(autoPlay) {
|
849
|
-
|
850
|
-
if (!
|
851
|
-
|
858
|
+
s._iO.autoPlay = autoPlay;
|
859
|
+
if (!s.isHTML5) {
|
860
|
+
flash._setAutoPlay(s.id, autoPlay);
|
852
861
|
if (autoPlay) {
|
853
|
-
if (!
|
854
|
-
|
862
|
+
if (!s.instanceCount && s.readyState === 1) {
|
863
|
+
s.instanceCount++;
|
855
864
|
}
|
856
865
|
}
|
857
866
|
}
|
858
867
|
};
|
859
868
|
this.getAutoPlay = function() {
|
860
|
-
return
|
869
|
+
return s._iO.autoPlay;
|
861
870
|
};
|
862
871
|
this.setPosition = function(nMsecOffset) {
|
863
|
-
if (
|
872
|
+
if (nMsecOffset === _undefined) {
|
864
873
|
nMsecOffset = 0;
|
865
874
|
}
|
866
875
|
var original_pos,
|
867
876
|
position, position1K,
|
868
|
-
offset = (
|
869
|
-
original_pos =
|
870
|
-
|
871
|
-
position1K =
|
872
|
-
|
873
|
-
|
874
|
-
if (!
|
875
|
-
position = (
|
876
|
-
if (
|
877
|
-
|
878
|
-
}
|
879
|
-
} else if (
|
880
|
-
if (
|
881
|
-
if (
|
877
|
+
offset = (s.isHTML5 ? Math.max(nMsecOffset, 0) : Math.min(s.duration || s._iO.duration, Math.max(nMsecOffset, 0)));
|
878
|
+
original_pos = s.position;
|
879
|
+
s.position = offset;
|
880
|
+
position1K = s.position/1000;
|
881
|
+
s._resetOnPosition(s.position);
|
882
|
+
s._iO.position = offset;
|
883
|
+
if (!s.isHTML5) {
|
884
|
+
position = (fV === 9 ? s.position : position1K);
|
885
|
+
if (s.readyState && s.readyState !== 2) {
|
886
|
+
flash._setPosition(s.id, position, (s.paused || !s.playState), s._iO.multiShot);
|
887
|
+
}
|
888
|
+
} else if (s._a) {
|
889
|
+
if (s._html5_canplay) {
|
890
|
+
if (s._a.currentTime !== position1K) {
|
882
891
|
try {
|
883
|
-
|
884
|
-
if (
|
885
|
-
|
892
|
+
s._a.currentTime = position1K;
|
893
|
+
if (s.playState === 0 || s.paused) {
|
894
|
+
s._a.pause();
|
886
895
|
}
|
887
896
|
} catch(e) {
|
888
897
|
}
|
@@ -890,135 +899,135 @@ function SoundManager(smURL, smID) {
|
|
890
899
|
} else {
|
891
900
|
}
|
892
901
|
}
|
893
|
-
if (
|
894
|
-
if (
|
895
|
-
|
902
|
+
if (s.isHTML5) {
|
903
|
+
if (s.paused) {
|
904
|
+
s._onTimer(true);
|
896
905
|
}
|
897
906
|
}
|
898
|
-
return
|
907
|
+
return s;
|
899
908
|
};
|
900
909
|
this.pause = function(_bCallFlash) {
|
901
|
-
if (
|
902
|
-
return
|
910
|
+
if (s.paused || (s.playState === 0 && s.readyState !== 1)) {
|
911
|
+
return s;
|
903
912
|
}
|
904
|
-
|
905
|
-
if (!
|
906
|
-
if (_bCallFlash ||
|
907
|
-
|
913
|
+
s.paused = true;
|
914
|
+
if (!s.isHTML5) {
|
915
|
+
if (_bCallFlash || _bCallFlash === _undefined) {
|
916
|
+
flash._pause(s.id, s._iO.multiShot);
|
908
917
|
}
|
909
918
|
} else {
|
910
|
-
|
911
|
-
|
919
|
+
s._setup_html5().pause();
|
920
|
+
stop_html5_timer();
|
912
921
|
}
|
913
|
-
if (
|
914
|
-
|
922
|
+
if (s._iO.onpause) {
|
923
|
+
s._iO.onpause.apply(s);
|
915
924
|
}
|
916
|
-
return
|
925
|
+
return s;
|
917
926
|
};
|
918
927
|
this.resume = function() {
|
919
|
-
var
|
920
|
-
if (!
|
921
|
-
return
|
928
|
+
var instanceOptions = s._iO;
|
929
|
+
if (!s.paused) {
|
930
|
+
return s;
|
922
931
|
}
|
923
|
-
|
924
|
-
|
925
|
-
if (!
|
926
|
-
if (
|
927
|
-
|
932
|
+
s.paused = false;
|
933
|
+
s.playState = 1;
|
934
|
+
if (!s.isHTML5) {
|
935
|
+
if (instanceOptions.isMovieStar && !instanceOptions.serverURL) {
|
936
|
+
s.setPosition(s.position);
|
928
937
|
}
|
929
|
-
|
938
|
+
flash._pause(s.id, instanceOptions.multiShot);
|
930
939
|
} else {
|
931
|
-
|
932
|
-
|
940
|
+
s._setup_html5().play();
|
941
|
+
start_html5_timer();
|
933
942
|
}
|
934
|
-
if (!
|
935
|
-
|
936
|
-
|
937
|
-
} else if (
|
938
|
-
|
943
|
+
if (!onplay_called && instanceOptions.onplay) {
|
944
|
+
instanceOptions.onplay.apply(s);
|
945
|
+
onplay_called = true;
|
946
|
+
} else if (instanceOptions.onresume) {
|
947
|
+
instanceOptions.onresume.apply(s);
|
939
948
|
}
|
940
|
-
return
|
949
|
+
return s;
|
941
950
|
};
|
942
951
|
this.togglePause = function() {
|
943
|
-
if (
|
944
|
-
|
945
|
-
position: (
|
952
|
+
if (s.playState === 0) {
|
953
|
+
s.play({
|
954
|
+
position: (fV === 9 && !s.isHTML5 ? s.position : s.position / 1000)
|
946
955
|
});
|
947
|
-
return
|
956
|
+
return s;
|
948
957
|
}
|
949
|
-
if (
|
950
|
-
|
958
|
+
if (s.paused) {
|
959
|
+
s.resume();
|
951
960
|
} else {
|
952
|
-
|
961
|
+
s.pause();
|
953
962
|
}
|
954
|
-
return
|
963
|
+
return s;
|
955
964
|
};
|
956
965
|
this.setPan = function(nPan, bInstanceOnly) {
|
957
|
-
if (
|
966
|
+
if (nPan === _undefined) {
|
958
967
|
nPan = 0;
|
959
968
|
}
|
960
|
-
if (
|
969
|
+
if (bInstanceOnly === _undefined) {
|
961
970
|
bInstanceOnly = false;
|
962
971
|
}
|
963
|
-
if (!
|
964
|
-
|
972
|
+
if (!s.isHTML5) {
|
973
|
+
flash._setPan(s.id, nPan);
|
965
974
|
}
|
966
|
-
|
975
|
+
s._iO.pan = nPan;
|
967
976
|
if (!bInstanceOnly) {
|
968
|
-
|
969
|
-
|
977
|
+
s.pan = nPan;
|
978
|
+
s.options.pan = nPan;
|
970
979
|
}
|
971
|
-
return
|
980
|
+
return s;
|
972
981
|
};
|
973
982
|
this.setVolume = function(nVol, _bInstanceOnly) {
|
974
|
-
if (
|
983
|
+
if (nVol === _undefined) {
|
975
984
|
nVol = 100;
|
976
985
|
}
|
977
|
-
if (
|
986
|
+
if (_bInstanceOnly === _undefined) {
|
978
987
|
_bInstanceOnly = false;
|
979
988
|
}
|
980
|
-
if (!
|
981
|
-
|
982
|
-
} else if (
|
983
|
-
|
989
|
+
if (!s.isHTML5) {
|
990
|
+
flash._setVolume(s.id, (sm2.muted && !s.muted) || s.muted?0:nVol);
|
991
|
+
} else if (s._a) {
|
992
|
+
s._a.volume = Math.max(0, Math.min(1, nVol/100));
|
984
993
|
}
|
985
|
-
|
994
|
+
s._iO.volume = nVol;
|
986
995
|
if (!_bInstanceOnly) {
|
987
|
-
|
988
|
-
|
996
|
+
s.volume = nVol;
|
997
|
+
s.options.volume = nVol;
|
989
998
|
}
|
990
|
-
return
|
999
|
+
return s;
|
991
1000
|
};
|
992
1001
|
this.mute = function() {
|
993
|
-
|
994
|
-
if (!
|
995
|
-
|
996
|
-
} else if (
|
997
|
-
|
1002
|
+
s.muted = true;
|
1003
|
+
if (!s.isHTML5) {
|
1004
|
+
flash._setVolume(s.id, 0);
|
1005
|
+
} else if (s._a) {
|
1006
|
+
s._a.muted = true;
|
998
1007
|
}
|
999
|
-
return
|
1008
|
+
return s;
|
1000
1009
|
};
|
1001
1010
|
this.unmute = function() {
|
1002
|
-
|
1003
|
-
var hasIO = (
|
1004
|
-
if (!
|
1005
|
-
|
1006
|
-
} else if (
|
1007
|
-
|
1008
|
-
}
|
1009
|
-
return
|
1011
|
+
s.muted = false;
|
1012
|
+
var hasIO = (s._iO.volume !== _undefined);
|
1013
|
+
if (!s.isHTML5) {
|
1014
|
+
flash._setVolume(s.id, hasIO?s._iO.volume:s.options.volume);
|
1015
|
+
} else if (s._a) {
|
1016
|
+
s._a.muted = false;
|
1017
|
+
}
|
1018
|
+
return s;
|
1010
1019
|
};
|
1011
1020
|
this.toggleMute = function() {
|
1012
|
-
return (
|
1021
|
+
return (s.muted?s.unmute():s.mute());
|
1013
1022
|
};
|
1014
1023
|
this.onPosition = function(nPosition, oMethod, oScope) {
|
1015
|
-
|
1024
|
+
onPositionItems.push({
|
1016
1025
|
position: parseInt(nPosition, 10),
|
1017
1026
|
method: oMethod,
|
1018
|
-
scope: (
|
1027
|
+
scope: (oScope !== _undefined ? oScope : s),
|
1019
1028
|
fired: false
|
1020
1029
|
});
|
1021
|
-
return
|
1030
|
+
return s;
|
1022
1031
|
};
|
1023
1032
|
this.onposition = this.onPosition;
|
1024
1033
|
this.clearOnPosition = function(nPosition, oMethod) {
|
@@ -1027,164 +1036,164 @@ function SoundManager(smURL, smID) {
|
|
1027
1036
|
if (isNaN(nPosition)) {
|
1028
1037
|
return false;
|
1029
1038
|
}
|
1030
|
-
for (i=0; i <
|
1031
|
-
if (nPosition ===
|
1032
|
-
if (!oMethod || (oMethod ===
|
1033
|
-
if (
|
1034
|
-
|
1039
|
+
for (i=0; i < onPositionItems.length; i++) {
|
1040
|
+
if (nPosition === onPositionItems[i].position) {
|
1041
|
+
if (!oMethod || (oMethod === onPositionItems[i].method)) {
|
1042
|
+
if (onPositionItems[i].fired) {
|
1043
|
+
onPositionFired--;
|
1035
1044
|
}
|
1036
|
-
|
1045
|
+
onPositionItems.splice(i, 1);
|
1037
1046
|
}
|
1038
1047
|
}
|
1039
1048
|
}
|
1040
1049
|
};
|
1041
1050
|
this._processOnPosition = function() {
|
1042
|
-
var i, item, j =
|
1043
|
-
if (!j || !
|
1051
|
+
var i, item, j = onPositionItems.length;
|
1052
|
+
if (!j || !s.playState || onPositionFired >= j) {
|
1044
1053
|
return false;
|
1045
1054
|
}
|
1046
1055
|
for (i=j-1; i >= 0; i--) {
|
1047
|
-
item =
|
1048
|
-
if (!item.fired &&
|
1056
|
+
item = onPositionItems[i];
|
1057
|
+
if (!item.fired && s.position >= item.position) {
|
1049
1058
|
item.fired = true;
|
1050
|
-
|
1059
|
+
onPositionFired++;
|
1051
1060
|
item.method.apply(item.scope, [item.position]);
|
1052
1061
|
}
|
1053
1062
|
}
|
1054
1063
|
return true;
|
1055
1064
|
};
|
1056
1065
|
this._resetOnPosition = function(nPosition) {
|
1057
|
-
var i, item, j =
|
1066
|
+
var i, item, j = onPositionItems.length;
|
1058
1067
|
if (!j) {
|
1059
1068
|
return false;
|
1060
1069
|
}
|
1061
1070
|
for (i=j-1; i >= 0; i--) {
|
1062
|
-
item =
|
1071
|
+
item = onPositionItems[i];
|
1063
1072
|
if (item.fired && nPosition <= item.position) {
|
1064
1073
|
item.fired = false;
|
1065
|
-
|
1074
|
+
onPositionFired--;
|
1066
1075
|
}
|
1067
1076
|
}
|
1068
1077
|
return true;
|
1069
1078
|
};
|
1070
|
-
|
1071
|
-
var
|
1072
|
-
f =
|
1073
|
-
t =
|
1079
|
+
applyFromTo = function() {
|
1080
|
+
var instanceOptions = s._iO,
|
1081
|
+
f = instanceOptions.from,
|
1082
|
+
t = instanceOptions.to,
|
1074
1083
|
start, end;
|
1075
1084
|
end = function() {
|
1076
|
-
|
1077
|
-
|
1085
|
+
s.clearOnPosition(t, end);
|
1086
|
+
s.stop();
|
1078
1087
|
};
|
1079
1088
|
start = function() {
|
1080
1089
|
if (t !== null && !isNaN(t)) {
|
1081
|
-
|
1090
|
+
s.onPosition(t, end);
|
1082
1091
|
}
|
1083
1092
|
};
|
1084
1093
|
if (f !== null && !isNaN(f)) {
|
1085
|
-
|
1086
|
-
|
1094
|
+
instanceOptions.position = f;
|
1095
|
+
instanceOptions.multiShot = false;
|
1087
1096
|
start();
|
1088
1097
|
}
|
1089
|
-
return
|
1098
|
+
return instanceOptions;
|
1090
1099
|
};
|
1091
|
-
|
1100
|
+
attachOnPosition = function() {
|
1092
1101
|
var item,
|
1093
|
-
op =
|
1102
|
+
op = s._iO.onposition;
|
1094
1103
|
if (op) {
|
1095
1104
|
for (item in op) {
|
1096
1105
|
if (op.hasOwnProperty(item)) {
|
1097
|
-
|
1106
|
+
s.onPosition(parseInt(item, 10), op[item]);
|
1098
1107
|
}
|
1099
1108
|
}
|
1100
1109
|
}
|
1101
1110
|
};
|
1102
|
-
|
1111
|
+
detachOnPosition = function() {
|
1103
1112
|
var item,
|
1104
|
-
op =
|
1113
|
+
op = s._iO.onposition;
|
1105
1114
|
if (op) {
|
1106
1115
|
for (item in op) {
|
1107
1116
|
if (op.hasOwnProperty(item)) {
|
1108
|
-
|
1117
|
+
s.clearOnPosition(parseInt(item, 10));
|
1109
1118
|
}
|
1110
1119
|
}
|
1111
1120
|
}
|
1112
1121
|
};
|
1113
|
-
|
1114
|
-
if (
|
1115
|
-
|
1122
|
+
start_html5_timer = function() {
|
1123
|
+
if (s.isHTML5) {
|
1124
|
+
startTimer(s);
|
1116
1125
|
}
|
1117
1126
|
};
|
1118
|
-
|
1119
|
-
if (
|
1120
|
-
|
1127
|
+
stop_html5_timer = function() {
|
1128
|
+
if (s.isHTML5) {
|
1129
|
+
stopTimer(s);
|
1121
1130
|
}
|
1122
1131
|
};
|
1123
|
-
|
1132
|
+
resetProperties = function(retainPosition) {
|
1124
1133
|
if (!retainPosition) {
|
1125
|
-
|
1126
|
-
|
1127
|
-
}
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
1149
|
-
|
1134
|
+
onPositionItems = [];
|
1135
|
+
onPositionFired = 0;
|
1136
|
+
}
|
1137
|
+
onplay_called = false;
|
1138
|
+
s._hasTimer = null;
|
1139
|
+
s._a = null;
|
1140
|
+
s._html5_canplay = false;
|
1141
|
+
s.bytesLoaded = null;
|
1142
|
+
s.bytesTotal = null;
|
1143
|
+
s.duration = (s._iO && s._iO.duration ? s._iO.duration : null);
|
1144
|
+
s.durationEstimate = null;
|
1145
|
+
s.buffered = [];
|
1146
|
+
s.eqData = [];
|
1147
|
+
s.eqData.left = [];
|
1148
|
+
s.eqData.right = [];
|
1149
|
+
s.failures = 0;
|
1150
|
+
s.isBuffering = false;
|
1151
|
+
s.instanceOptions = {};
|
1152
|
+
s.instanceCount = 0;
|
1153
|
+
s.loaded = false;
|
1154
|
+
s.metadata = {};
|
1155
|
+
s.readyState = 0;
|
1156
|
+
s.muted = false;
|
1157
|
+
s.paused = false;
|
1158
|
+
s.peakData = {
|
1150
1159
|
left: 0,
|
1151
1160
|
right: 0
|
1152
1161
|
};
|
1153
|
-
|
1162
|
+
s.waveformData = {
|
1154
1163
|
left: [],
|
1155
1164
|
right: []
|
1156
1165
|
};
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1166
|
+
s.playState = 0;
|
1167
|
+
s.position = null;
|
1168
|
+
s.id3 = {};
|
1160
1169
|
};
|
1161
|
-
|
1170
|
+
resetProperties();
|
1162
1171
|
this._onTimer = function(bForce) {
|
1163
1172
|
var duration, isNew = false, time, x = {};
|
1164
|
-
if (
|
1165
|
-
if (
|
1166
|
-
duration =
|
1167
|
-
if (duration !==
|
1168
|
-
|
1169
|
-
|
1173
|
+
if (s._hasTimer || bForce) {
|
1174
|
+
if (s._a && (bForce || ((s.playState > 0 || s.readyState === 1) && !s.paused))) {
|
1175
|
+
duration = s._get_html5_duration();
|
1176
|
+
if (duration !== lastHTML5State.duration) {
|
1177
|
+
lastHTML5State.duration = duration;
|
1178
|
+
s.duration = duration;
|
1170
1179
|
isNew = true;
|
1171
1180
|
}
|
1172
|
-
|
1173
|
-
time = (
|
1174
|
-
if (time !==
|
1175
|
-
|
1181
|
+
s.durationEstimate = s.duration;
|
1182
|
+
time = (s._a.currentTime * 1000 || 0);
|
1183
|
+
if (time !== lastHTML5State.time) {
|
1184
|
+
lastHTML5State.time = time;
|
1176
1185
|
isNew = true;
|
1177
1186
|
}
|
1178
1187
|
if (isNew || bForce) {
|
1179
|
-
|
1188
|
+
s._whileplaying(time,x,x,x,x);
|
1180
1189
|
}
|
1181
1190
|
}
|
1182
1191
|
return isNew;
|
1183
1192
|
}
|
1184
1193
|
};
|
1185
1194
|
this._get_html5_duration = function() {
|
1186
|
-
var
|
1187
|
-
d = (
|
1195
|
+
var instanceOptions = s._iO,
|
1196
|
+
d = (s._a && s._a.duration ? s._a.duration*1000 : (instanceOptions && instanceOptions.duration ? instanceOptions.duration : null)),
|
1188
1197
|
result = (d && !isNaN(d) && d !== Infinity ? d : null);
|
1189
1198
|
return result;
|
1190
1199
|
};
|
@@ -1192,338 +1201,343 @@ function SoundManager(smURL, smID) {
|
|
1192
1201
|
a.loop = (nLoops > 1 ? 'loop' : '');
|
1193
1202
|
};
|
1194
1203
|
this._setup_html5 = function(oOptions) {
|
1195
|
-
var
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
|
1202
|
-
|
1203
|
-
|
1204
|
-
|
1205
|
-
|
1206
|
-
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1204
|
+
var instanceOptions = mixin(s._iO, oOptions), d = decodeURI,
|
1205
|
+
a = useGlobalHTML5Audio ? globalHTML5Audio : s._a,
|
1206
|
+
dURL = d(instanceOptions.url),
|
1207
|
+
sameURL;
|
1208
|
+
if (useGlobalHTML5Audio) {
|
1209
|
+
if (dURL === lastGlobalHTML5URL) {
|
1210
|
+
sameURL = true;
|
1211
|
+
}
|
1212
|
+
} else if (dURL === lastURL) {
|
1213
|
+
sameURL = true;
|
1214
|
+
}
|
1215
|
+
if (a) {
|
1216
|
+
if (a._s) {
|
1217
|
+
if (useGlobalHTML5Audio) {
|
1218
|
+
if (a._s && a._s.playState && !sameURL) {
|
1219
|
+
a._s.stop();
|
1220
|
+
}
|
1221
|
+
} else if (!useGlobalHTML5Audio && dURL === d(lastURL)) {
|
1222
|
+
s._apply_loop(a, instanceOptions.loops);
|
1223
|
+
return a;
|
1210
1224
|
}
|
1211
1225
|
}
|
1212
|
-
if (
|
1213
|
-
|
1226
|
+
if (!sameURL) {
|
1227
|
+
resetProperties(false);
|
1228
|
+
a.src = instanceOptions.url;
|
1229
|
+
s.url = instanceOptions.url;
|
1230
|
+
lastURL = instanceOptions.url;
|
1231
|
+
lastGlobalHTML5URL = instanceOptions.url;
|
1232
|
+
a._called_load = false;
|
1214
1233
|
}
|
1215
|
-
_resetProperties((_oldIO && _oldIO.url ? _iO.url === _oldIO.url : (_lastURL ? _lastURL === _iO.url : false)));
|
1216
|
-
_a.src = _iO.url;
|
1217
|
-
_t.url = _iO.url;
|
1218
|
-
_lastURL = _iO.url;
|
1219
|
-
_a._called_load = false;
|
1220
1234
|
} else {
|
1221
|
-
if (
|
1222
|
-
|
1235
|
+
if (instanceOptions.autoLoad || instanceOptions.autoPlay) {
|
1236
|
+
s._a = new Audio(instanceOptions.url);
|
1223
1237
|
} else {
|
1224
|
-
|
1238
|
+
s._a = (isOpera && opera.version() < 10 ? new Audio(null) : new Audio());
|
1225
1239
|
}
|
1226
|
-
|
1227
|
-
|
1228
|
-
if (
|
1229
|
-
|
1240
|
+
a = s._a;
|
1241
|
+
a._called_load = false;
|
1242
|
+
if (useGlobalHTML5Audio) {
|
1243
|
+
globalHTML5Audio = a;
|
1230
1244
|
}
|
1231
1245
|
}
|
1232
|
-
|
1233
|
-
|
1234
|
-
|
1235
|
-
|
1236
|
-
|
1237
|
-
if (
|
1238
|
-
|
1246
|
+
s.isHTML5 = true;
|
1247
|
+
s._a = a;
|
1248
|
+
a._s = s;
|
1249
|
+
add_html5_events();
|
1250
|
+
s._apply_loop(a, instanceOptions.loops);
|
1251
|
+
if (instanceOptions.autoLoad || instanceOptions.autoPlay) {
|
1252
|
+
s.load();
|
1239
1253
|
} else {
|
1240
|
-
|
1241
|
-
|
1254
|
+
a.autobuffer = false;
|
1255
|
+
a.preload = 'auto';
|
1242
1256
|
}
|
1243
|
-
return
|
1257
|
+
return a;
|
1244
1258
|
};
|
1245
|
-
|
1246
|
-
if (
|
1259
|
+
add_html5_events = function() {
|
1260
|
+
if (s._a._added_events) {
|
1247
1261
|
return false;
|
1248
1262
|
}
|
1249
1263
|
var f;
|
1250
1264
|
function add(oEvt, oFn, bCapture) {
|
1251
|
-
return
|
1265
|
+
return s._a ? s._a.addEventListener(oEvt, oFn, bCapture||false) : null;
|
1252
1266
|
}
|
1253
|
-
|
1254
|
-
for (f in
|
1255
|
-
if (
|
1256
|
-
add(f,
|
1267
|
+
s._a._added_events = true;
|
1268
|
+
for (f in html5_events) {
|
1269
|
+
if (html5_events.hasOwnProperty(f)) {
|
1270
|
+
add(f, html5_events[f]);
|
1257
1271
|
}
|
1258
1272
|
}
|
1259
1273
|
return true;
|
1260
1274
|
};
|
1261
|
-
|
1275
|
+
remove_html5_events = function() {
|
1262
1276
|
var f;
|
1263
1277
|
function remove(oEvt, oFn, bCapture) {
|
1264
|
-
return (
|
1278
|
+
return (s._a ? s._a.removeEventListener(oEvt, oFn, bCapture||false) : null);
|
1265
1279
|
}
|
1266
|
-
|
1267
|
-
for (f in
|
1268
|
-
if (
|
1269
|
-
remove(f,
|
1280
|
+
s._a._added_events = false;
|
1281
|
+
for (f in html5_events) {
|
1282
|
+
if (html5_events.hasOwnProperty(f)) {
|
1283
|
+
remove(f, html5_events[f]);
|
1270
1284
|
}
|
1271
1285
|
}
|
1272
1286
|
};
|
1273
1287
|
this._onload = function(nSuccess) {
|
1274
1288
|
var fN,
|
1275
|
-
loadOK =
|
1276
|
-
|
1277
|
-
|
1278
|
-
|
1279
|
-
if (
|
1280
|
-
|
1289
|
+
loadOK = !!nSuccess || (!s.isHTML5 && fV === 8 && s.duration);
|
1290
|
+
s.loaded = loadOK;
|
1291
|
+
s.readyState = loadOK?3:2;
|
1292
|
+
s._onbufferchange(0);
|
1293
|
+
if (s._iO.onload) {
|
1294
|
+
s._iO.onload.apply(s, [loadOK]);
|
1281
1295
|
}
|
1282
1296
|
return true;
|
1283
1297
|
};
|
1284
1298
|
this._onbufferchange = function(nIsBuffering) {
|
1285
|
-
if (
|
1299
|
+
if (s.playState === 0) {
|
1286
1300
|
return false;
|
1287
1301
|
}
|
1288
|
-
if ((nIsBuffering &&
|
1302
|
+
if ((nIsBuffering && s.isBuffering) || (!nIsBuffering && !s.isBuffering)) {
|
1289
1303
|
return false;
|
1290
1304
|
}
|
1291
|
-
|
1292
|
-
if (
|
1293
|
-
|
1305
|
+
s.isBuffering = (nIsBuffering === 1);
|
1306
|
+
if (s._iO.onbufferchange) {
|
1307
|
+
s._iO.onbufferchange.apply(s);
|
1294
1308
|
}
|
1295
1309
|
return true;
|
1296
1310
|
};
|
1297
1311
|
this._onsuspend = function() {
|
1298
|
-
if (
|
1299
|
-
|
1312
|
+
if (s._iO.onsuspend) {
|
1313
|
+
s._iO.onsuspend.apply(s);
|
1300
1314
|
}
|
1301
1315
|
return true;
|
1302
1316
|
};
|
1303
1317
|
this._onfailure = function(msg, level, code) {
|
1304
|
-
|
1305
|
-
if (
|
1306
|
-
|
1318
|
+
s.failures++;
|
1319
|
+
if (s._iO.onfailure && s.failures === 1) {
|
1320
|
+
s._iO.onfailure(s, msg, level, code);
|
1307
1321
|
} else {
|
1308
1322
|
}
|
1309
1323
|
};
|
1310
1324
|
this._onfinish = function() {
|
1311
|
-
var
|
1312
|
-
|
1313
|
-
|
1314
|
-
if (
|
1315
|
-
|
1316
|
-
if (!
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1324
|
-
if (
|
1325
|
-
|
1325
|
+
var io_onfinish = s._iO.onfinish;
|
1326
|
+
s._onbufferchange(0);
|
1327
|
+
s._resetOnPosition(0);
|
1328
|
+
if (s.instanceCount) {
|
1329
|
+
s.instanceCount--;
|
1330
|
+
if (!s.instanceCount) {
|
1331
|
+
detachOnPosition();
|
1332
|
+
s.playState = 0;
|
1333
|
+
s.paused = false;
|
1334
|
+
s.instanceCount = 0;
|
1335
|
+
s.instanceOptions = {};
|
1336
|
+
s._iO = {};
|
1337
|
+
stop_html5_timer();
|
1338
|
+
if (s.isHTML5) {
|
1339
|
+
s.position = 0;
|
1326
1340
|
}
|
1327
1341
|
}
|
1328
|
-
if (!
|
1329
|
-
if (
|
1330
|
-
|
1342
|
+
if (!s.instanceCount || s._iO.multiShotEvents) {
|
1343
|
+
if (io_onfinish) {
|
1344
|
+
io_onfinish.apply(s);
|
1331
1345
|
}
|
1332
1346
|
}
|
1333
1347
|
}
|
1334
1348
|
};
|
1335
1349
|
this._whileloading = function(nBytesLoaded, nBytesTotal, nDuration, nBufferLength) {
|
1336
|
-
var
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1341
|
-
if (!
|
1342
|
-
if (
|
1343
|
-
|
1350
|
+
var instanceOptions = s._iO;
|
1351
|
+
s.bytesLoaded = nBytesLoaded;
|
1352
|
+
s.bytesTotal = nBytesTotal;
|
1353
|
+
s.duration = Math.floor(nDuration);
|
1354
|
+
s.bufferLength = nBufferLength;
|
1355
|
+
if (!s.isHTML5 && !instanceOptions.isMovieStar) {
|
1356
|
+
if (instanceOptions.duration) {
|
1357
|
+
s.durationEstimate = (s.duration > instanceOptions.duration) ? s.duration : instanceOptions.duration;
|
1344
1358
|
} else {
|
1345
|
-
|
1359
|
+
s.durationEstimate = parseInt((s.bytesTotal / s.bytesLoaded) * s.duration, 10);
|
1346
1360
|
}
|
1347
1361
|
} else {
|
1348
|
-
|
1362
|
+
s.durationEstimate = s.duration;
|
1349
1363
|
}
|
1350
|
-
if (!
|
1351
|
-
|
1364
|
+
if (!s.isHTML5) {
|
1365
|
+
s.buffered = [{
|
1352
1366
|
'start': 0,
|
1353
|
-
'end':
|
1367
|
+
'end': s.duration
|
1354
1368
|
}];
|
1355
1369
|
}
|
1356
|
-
if ((
|
1357
|
-
|
1370
|
+
if ((s.readyState !== 3 || s.isHTML5) && instanceOptions.whileloading) {
|
1371
|
+
instanceOptions.whileloading.apply(s);
|
1358
1372
|
}
|
1359
1373
|
};
|
1360
1374
|
this._whileplaying = function(nPosition, oPeakData, oWaveformDataLeft, oWaveformDataRight, oEQData) {
|
1361
|
-
var
|
1375
|
+
var instanceOptions = s._iO,
|
1362
1376
|
eqLeft;
|
1363
1377
|
if (isNaN(nPosition) || nPosition === null) {
|
1364
1378
|
return false;
|
1365
1379
|
}
|
1366
|
-
|
1367
|
-
|
1368
|
-
if (!
|
1369
|
-
if (
|
1370
|
-
|
1380
|
+
s.position = Math.max(0, nPosition);
|
1381
|
+
s._processOnPosition();
|
1382
|
+
if (!s.isHTML5 && fV > 8) {
|
1383
|
+
if (instanceOptions.usePeakData && oPeakData !== _undefined && oPeakData) {
|
1384
|
+
s.peakData = {
|
1371
1385
|
left: oPeakData.leftPeak,
|
1372
1386
|
right: oPeakData.rightPeak
|
1373
1387
|
};
|
1374
1388
|
}
|
1375
|
-
if (
|
1376
|
-
|
1389
|
+
if (instanceOptions.useWaveformData && oWaveformDataLeft !== _undefined && oWaveformDataLeft) {
|
1390
|
+
s.waveformData = {
|
1377
1391
|
left: oWaveformDataLeft.split(','),
|
1378
1392
|
right: oWaveformDataRight.split(',')
|
1379
1393
|
};
|
1380
1394
|
}
|
1381
|
-
if (
|
1382
|
-
if (
|
1395
|
+
if (instanceOptions.useEQData) {
|
1396
|
+
if (oEQData !== _undefined && oEQData && oEQData.leftEQ) {
|
1383
1397
|
eqLeft = oEQData.leftEQ.split(',');
|
1384
|
-
|
1385
|
-
|
1386
|
-
if (
|
1387
|
-
|
1398
|
+
s.eqData = eqLeft;
|
1399
|
+
s.eqData.left = eqLeft;
|
1400
|
+
if (oEQData.rightEQ !== _undefined && oEQData.rightEQ) {
|
1401
|
+
s.eqData.right = oEQData.rightEQ.split(',');
|
1388
1402
|
}
|
1389
1403
|
}
|
1390
1404
|
}
|
1391
1405
|
}
|
1392
|
-
if (
|
1393
|
-
if (!
|
1394
|
-
|
1406
|
+
if (s.playState === 1) {
|
1407
|
+
if (!s.isHTML5 && fV === 8 && !s.position && s.isBuffering) {
|
1408
|
+
s._onbufferchange(0);
|
1395
1409
|
}
|
1396
|
-
if (
|
1397
|
-
|
1410
|
+
if (instanceOptions.whileplaying) {
|
1411
|
+
instanceOptions.whileplaying.apply(s);
|
1398
1412
|
}
|
1399
1413
|
}
|
1400
1414
|
return true;
|
1401
1415
|
};
|
1402
1416
|
this._oncaptiondata = function(oData) {
|
1403
|
-
|
1404
|
-
if (
|
1405
|
-
|
1417
|
+
s.captiondata = oData;
|
1418
|
+
if (s._iO.oncaptiondata) {
|
1419
|
+
s._iO.oncaptiondata.apply(s, [oData]);
|
1406
1420
|
}
|
1407
|
-
|
1421
|
+
};
|
1408
1422
|
this._onmetadata = function(oMDProps, oMDData) {
|
1409
1423
|
var oData = {}, i, j;
|
1410
1424
|
for (i = 0, j = oMDProps.length; i < j; i++) {
|
1411
1425
|
oData[oMDProps[i]] = oMDData[i];
|
1412
1426
|
}
|
1413
|
-
|
1414
|
-
if (
|
1415
|
-
|
1427
|
+
s.metadata = oData;
|
1428
|
+
if (s._iO.onmetadata) {
|
1429
|
+
s._iO.onmetadata.apply(s);
|
1416
1430
|
}
|
1417
|
-
|
1431
|
+
};
|
1418
1432
|
this._onid3 = function(oID3Props, oID3Data) {
|
1419
1433
|
var oData = [], i, j;
|
1420
1434
|
for (i = 0, j = oID3Props.length; i < j; i++) {
|
1421
1435
|
oData[oID3Props[i]] = oID3Data[i];
|
1422
1436
|
}
|
1423
|
-
|
1424
|
-
if (
|
1425
|
-
|
1437
|
+
s.id3 = mixin(s.id3, oData);
|
1438
|
+
if (s._iO.onid3) {
|
1439
|
+
s._iO.onid3.apply(s);
|
1426
1440
|
}
|
1427
1441
|
};
|
1428
1442
|
this._onconnect = function(bSuccess) {
|
1429
1443
|
bSuccess = (bSuccess === 1);
|
1430
|
-
|
1444
|
+
s.connected = bSuccess;
|
1431
1445
|
if (bSuccess) {
|
1432
|
-
|
1433
|
-
if (
|
1434
|
-
if (
|
1435
|
-
|
1436
|
-
} else if (
|
1437
|
-
|
1446
|
+
s.failures = 0;
|
1447
|
+
if (idCheck(s.id)) {
|
1448
|
+
if (s.getAutoPlay()) {
|
1449
|
+
s.play(_undefined, s.getAutoPlay());
|
1450
|
+
} else if (s._iO.autoLoad) {
|
1451
|
+
s.load();
|
1438
1452
|
}
|
1439
1453
|
}
|
1440
|
-
if (
|
1441
|
-
|
1454
|
+
if (s._iO.onconnect) {
|
1455
|
+
s._iO.onconnect.apply(s, [bSuccess]);
|
1442
1456
|
}
|
1443
1457
|
}
|
1444
1458
|
};
|
1445
1459
|
this._ondataerror = function(sError) {
|
1446
|
-
if (
|
1447
|
-
if (
|
1448
|
-
|
1460
|
+
if (s.playState > 0) {
|
1461
|
+
if (s._iO.ondataerror) {
|
1462
|
+
s._iO.ondataerror.apply(s);
|
1449
1463
|
}
|
1450
1464
|
}
|
1451
1465
|
};
|
1452
1466
|
};
|
1453
|
-
|
1454
|
-
return (
|
1467
|
+
getDocument = function() {
|
1468
|
+
return (doc.body || doc._docElement || doc.getElementsByTagName('div')[0]);
|
1455
1469
|
};
|
1456
|
-
|
1457
|
-
return
|
1470
|
+
id = function(sID) {
|
1471
|
+
return doc.getElementById(sID);
|
1458
1472
|
};
|
1459
|
-
|
1473
|
+
mixin = function(oMain, oAdd) {
|
1460
1474
|
var o1 = (oMain || {}), o2, o;
|
1461
|
-
o2 = (
|
1475
|
+
o2 = (oAdd === _undefined ? sm2.defaultOptions : oAdd);
|
1462
1476
|
for (o in o2) {
|
1463
|
-
if (o2.hasOwnProperty(o) &&
|
1477
|
+
if (o2.hasOwnProperty(o) && o1[o] === _undefined) {
|
1464
1478
|
if (typeof o2[o] !== 'object' || o2[o] === null) {
|
1465
1479
|
o1[o] = o2[o];
|
1466
1480
|
} else {
|
1467
|
-
o1[o] =
|
1481
|
+
o1[o] = mixin(o1[o], o2[o]);
|
1468
1482
|
}
|
1469
1483
|
}
|
1470
1484
|
}
|
1471
1485
|
return o1;
|
1472
1486
|
};
|
1473
|
-
|
1487
|
+
extraOptions = {
|
1474
1488
|
'onready': 1,
|
1475
1489
|
'ontimeout': 1,
|
1476
1490
|
'defaultOptions': 1,
|
1477
1491
|
'flash9Options': 1,
|
1478
1492
|
'movieStarOptions': 1
|
1479
1493
|
};
|
1480
|
-
|
1494
|
+
assign = function(o, oParent) {
|
1481
1495
|
var i,
|
1482
1496
|
result = true,
|
1483
|
-
hasParent = (
|
1484
|
-
setupOptions =
|
1485
|
-
|
1497
|
+
hasParent = (oParent !== _undefined),
|
1498
|
+
setupOptions = sm2.setupOptions,
|
1499
|
+
bonusOptions = extraOptions;
|
1486
1500
|
for (i in o) {
|
1487
1501
|
if (o.hasOwnProperty(i)) {
|
1488
|
-
if (typeof o[i] !== 'object' || o[i] === null || o[i] instanceof Array) {
|
1489
|
-
if (hasParent &&
|
1490
|
-
|
1491
|
-
} else if (
|
1492
|
-
|
1493
|
-
|
1494
|
-
} else if (
|
1495
|
-
|
1502
|
+
if (typeof o[i] !== 'object' || o[i] === null || o[i] instanceof Array || o[i] instanceof RegExp) {
|
1503
|
+
if (hasParent && bonusOptions[oParent] !== _undefined) {
|
1504
|
+
sm2[oParent][i] = o[i];
|
1505
|
+
} else if (setupOptions[i] !== _undefined) {
|
1506
|
+
sm2.setupOptions[i] = o[i];
|
1507
|
+
sm2[i] = o[i];
|
1508
|
+
} else if (bonusOptions[i] === _undefined) {
|
1509
|
+
complain(str((sm2[i] === _undefined ? 'setupUndef' : 'setupError'), i), 2);
|
1496
1510
|
result = false;
|
1497
1511
|
} else {
|
1498
|
-
if (
|
1499
|
-
|
1512
|
+
if (sm2[i] instanceof Function) {
|
1513
|
+
sm2[i].apply(sm2, (o[i] instanceof Array? o[i] : [o[i]]));
|
1500
1514
|
} else {
|
1501
|
-
|
1515
|
+
sm2[i] = o[i];
|
1502
1516
|
}
|
1503
1517
|
}
|
1504
1518
|
} else {
|
1505
|
-
if (
|
1506
|
-
|
1519
|
+
if (bonusOptions[i] === _undefined) {
|
1520
|
+
complain(str((sm2[i] === _undefined ? 'setupUndef' : 'setupError'), i), 2);
|
1507
1521
|
result = false;
|
1508
1522
|
} else {
|
1509
|
-
return
|
1523
|
+
return assign(o[i], i);
|
1510
1524
|
}
|
1511
1525
|
}
|
1512
1526
|
}
|
1513
1527
|
}
|
1514
1528
|
return result;
|
1515
1529
|
};
|
1516
|
-
function
|
1517
|
-
return (
|
1530
|
+
function preferFlashCheck(kind) {
|
1531
|
+
return (sm2.preferFlash && hasFlash && !sm2.ignoreFlash && (sm2.flash[kind] !== _undefined && sm2.flash[kind]));
|
1518
1532
|
}
|
1519
|
-
|
1520
|
-
var old = (
|
1533
|
+
event = (function() {
|
1534
|
+
var old = (window.attachEvent),
|
1521
1535
|
evt = {
|
1522
1536
|
add: (old?'attachEvent':'addEventListener'),
|
1523
1537
|
remove: (old?'detachEvent':'removeEventListener')
|
1524
1538
|
};
|
1525
1539
|
function getArgs(oArgs) {
|
1526
|
-
var args =
|
1540
|
+
var args = slice.call(oArgs),
|
1527
1541
|
len = args.length;
|
1528
1542
|
if (old) {
|
1529
1543
|
args[1] = 'on' + args[1];
|
@@ -1555,11 +1569,11 @@ function SoundManager(smURL, smID) {
|
|
1555
1569
|
'remove': remove
|
1556
1570
|
};
|
1557
1571
|
}());
|
1558
|
-
function
|
1572
|
+
function html5_event(oFn) {
|
1559
1573
|
return function(e) {
|
1560
|
-
var
|
1574
|
+
var s = this._s,
|
1561
1575
|
result;
|
1562
|
-
if (!
|
1576
|
+
if (!s || !s._a) {
|
1563
1577
|
result = null;
|
1564
1578
|
} else {
|
1565
1579
|
result = oFn.call(this, e);
|
@@ -1567,72 +1581,72 @@ function SoundManager(smURL, smID) {
|
|
1567
1581
|
return result;
|
1568
1582
|
};
|
1569
1583
|
}
|
1570
|
-
|
1571
|
-
abort:
|
1584
|
+
html5_events = {
|
1585
|
+
abort: html5_event(function() {
|
1572
1586
|
}),
|
1573
|
-
canplay:
|
1574
|
-
var
|
1587
|
+
canplay: html5_event(function() {
|
1588
|
+
var s = this._s,
|
1575
1589
|
position1K;
|
1576
|
-
if (
|
1590
|
+
if (s._html5_canplay) {
|
1577
1591
|
return true;
|
1578
1592
|
}
|
1579
|
-
|
1580
|
-
|
1581
|
-
position1K = (
|
1582
|
-
if (
|
1593
|
+
s._html5_canplay = true;
|
1594
|
+
s._onbufferchange(0);
|
1595
|
+
position1K = (s._iO.position !== _undefined && !isNaN(s._iO.position)?s._iO.position/1000:null);
|
1596
|
+
if (s.position && this.currentTime !== position1K) {
|
1583
1597
|
try {
|
1584
1598
|
this.currentTime = position1K;
|
1585
1599
|
} catch(ee) {
|
1586
1600
|
}
|
1587
1601
|
}
|
1588
|
-
if (
|
1589
|
-
|
1602
|
+
if (s._iO._oncanplay) {
|
1603
|
+
s._iO._oncanplay();
|
1590
1604
|
}
|
1591
1605
|
}),
|
1592
|
-
canplaythrough:
|
1593
|
-
var
|
1594
|
-
if (!
|
1595
|
-
|
1596
|
-
|
1597
|
-
|
1606
|
+
canplaythrough: html5_event(function() {
|
1607
|
+
var s = this._s;
|
1608
|
+
if (!s.loaded) {
|
1609
|
+
s._onbufferchange(0);
|
1610
|
+
s._whileloading(s.bytesLoaded, s.bytesTotal, s._get_html5_duration());
|
1611
|
+
s._onload(true);
|
1598
1612
|
}
|
1599
1613
|
}),
|
1600
|
-
ended:
|
1601
|
-
var
|
1602
|
-
|
1614
|
+
ended: html5_event(function() {
|
1615
|
+
var s = this._s;
|
1616
|
+
s._onfinish();
|
1603
1617
|
}),
|
1604
|
-
error:
|
1605
|
-
this.
|
1618
|
+
error: html5_event(function() {
|
1619
|
+
this._s._onload(false);
|
1606
1620
|
}),
|
1607
|
-
loadeddata:
|
1608
|
-
var
|
1609
|
-
if (!
|
1610
|
-
|
1621
|
+
loadeddata: html5_event(function() {
|
1622
|
+
var s = this._s;
|
1623
|
+
if (!s._loaded && !isSafari) {
|
1624
|
+
s.duration = s._get_html5_duration();
|
1611
1625
|
}
|
1612
1626
|
}),
|
1613
|
-
loadedmetadata:
|
1627
|
+
loadedmetadata: html5_event(function() {
|
1614
1628
|
}),
|
1615
|
-
loadstart:
|
1616
|
-
this.
|
1629
|
+
loadstart: html5_event(function() {
|
1630
|
+
this._s._onbufferchange(1);
|
1617
1631
|
}),
|
1618
|
-
play:
|
1619
|
-
this.
|
1632
|
+
play: html5_event(function() {
|
1633
|
+
this._s._onbufferchange(0);
|
1620
1634
|
}),
|
1621
|
-
playing:
|
1622
|
-
this.
|
1635
|
+
playing: html5_event(function() {
|
1636
|
+
this._s._onbufferchange(0);
|
1623
1637
|
}),
|
1624
|
-
progress:
|
1625
|
-
var
|
1638
|
+
progress: html5_event(function(e) {
|
1639
|
+
var s = this._s,
|
1626
1640
|
i, j, str, buffered = 0,
|
1627
1641
|
isProgress = (e.type === 'progress'),
|
1628
1642
|
ranges = e.target.buffered,
|
1629
1643
|
loaded = (e.loaded||0),
|
1630
1644
|
total = (e.total||1),
|
1631
1645
|
scale = 1000;
|
1632
|
-
|
1646
|
+
s.buffered = [];
|
1633
1647
|
if (ranges && ranges.length) {
|
1634
1648
|
for (i=0, j=ranges.length; i<j; i++) {
|
1635
|
-
|
1649
|
+
s.buffered.push({
|
1636
1650
|
'start': ranges.start(i) * scale,
|
1637
1651
|
'end': ranges.end(i) * scale
|
1638
1652
|
});
|
@@ -1641,71 +1655,75 @@ function SoundManager(smURL, smID) {
|
|
1641
1655
|
loaded = buffered/(e.target.duration*scale);
|
1642
1656
|
}
|
1643
1657
|
if (!isNaN(loaded)) {
|
1644
|
-
|
1645
|
-
|
1658
|
+
s._onbufferchange(0);
|
1659
|
+
s._whileloading(loaded, total, s._get_html5_duration());
|
1646
1660
|
if (loaded && total && loaded === total) {
|
1647
|
-
|
1661
|
+
html5_events.canplaythrough.call(this, e);
|
1648
1662
|
}
|
1649
1663
|
}
|
1650
1664
|
}),
|
1651
|
-
ratechange:
|
1665
|
+
ratechange: html5_event(function() {
|
1652
1666
|
}),
|
1653
|
-
suspend:
|
1654
|
-
var
|
1655
|
-
|
1656
|
-
|
1667
|
+
suspend: html5_event(function(e) {
|
1668
|
+
var s = this._s;
|
1669
|
+
html5_events.progress.call(this, e);
|
1670
|
+
s._onsuspend();
|
1657
1671
|
}),
|
1658
|
-
stalled:
|
1672
|
+
stalled: html5_event(function() {
|
1659
1673
|
}),
|
1660
|
-
timeupdate:
|
1661
|
-
this.
|
1674
|
+
timeupdate: html5_event(function() {
|
1675
|
+
this._s._onTimer();
|
1662
1676
|
}),
|
1663
|
-
waiting:
|
1664
|
-
var
|
1665
|
-
|
1677
|
+
waiting: html5_event(function() {
|
1678
|
+
var s = this._s;
|
1679
|
+
s._onbufferchange(1);
|
1666
1680
|
})
|
1667
1681
|
};
|
1668
|
-
|
1682
|
+
html5OK = function(iO) {
|
1669
1683
|
var result;
|
1670
|
-
if (iO.serverURL || (iO.type &&
|
1684
|
+
if (iO.serverURL || (iO.type && preferFlashCheck(iO.type))) {
|
1671
1685
|
result = false;
|
1672
1686
|
} else {
|
1673
|
-
result = ((iO.type ?
|
1687
|
+
result = ((iO.type ? html5CanPlay({type:iO.type}) : html5CanPlay({url:iO.url}) || sm2.html5Only));
|
1674
1688
|
}
|
1675
1689
|
return result;
|
1676
1690
|
};
|
1677
|
-
|
1691
|
+
html5Unload = function(oAudio, url) {
|
1678
1692
|
if (oAudio) {
|
1679
1693
|
oAudio.src = url;
|
1694
|
+
oAudio._called_load = false;
|
1695
|
+
}
|
1696
|
+
if (useGlobalHTML5Audio) {
|
1697
|
+
lastGlobalHTML5URL = null;
|
1680
1698
|
}
|
1681
1699
|
};
|
1682
|
-
|
1683
|
-
if (!
|
1700
|
+
html5CanPlay = function(o) {
|
1701
|
+
if (!sm2.useHTML5Audio || !sm2.hasHTML5) {
|
1684
1702
|
return false;
|
1685
1703
|
}
|
1686
1704
|
var url = (o.url || null),
|
1687
1705
|
mime = (o.type || null),
|
1688
|
-
aF =
|
1706
|
+
aF = sm2.audioFormats,
|
1689
1707
|
result,
|
1690
1708
|
offset,
|
1691
1709
|
fileExt,
|
1692
1710
|
item;
|
1693
|
-
if (mime &&
|
1694
|
-
return (
|
1711
|
+
if (mime && sm2.html5[mime] !== _undefined) {
|
1712
|
+
return (sm2.html5[mime] && !preferFlashCheck(mime));
|
1695
1713
|
}
|
1696
|
-
if (!
|
1697
|
-
|
1714
|
+
if (!html5Ext) {
|
1715
|
+
html5Ext = [];
|
1698
1716
|
for (item in aF) {
|
1699
1717
|
if (aF.hasOwnProperty(item)) {
|
1700
|
-
|
1718
|
+
html5Ext.push(item);
|
1701
1719
|
if (aF[item].related) {
|
1702
|
-
|
1720
|
+
html5Ext = html5Ext.concat(aF[item].related);
|
1703
1721
|
}
|
1704
1722
|
}
|
1705
1723
|
}
|
1706
|
-
|
1724
|
+
html5Ext = new RegExp('\\.('+html5Ext.join('|')+')(\\?.*)?$','i');
|
1707
1725
|
}
|
1708
|
-
fileExt = (url ? url.toLowerCase().match(
|
1726
|
+
fileExt = (url ? url.toLowerCase().match(html5Ext) : null);
|
1709
1727
|
if (!fileExt || !fileExt.length) {
|
1710
1728
|
if (!mime) {
|
1711
1729
|
result = false;
|
@@ -1716,23 +1734,23 @@ function SoundManager(smURL, smID) {
|
|
1716
1734
|
} else {
|
1717
1735
|
fileExt = fileExt[1];
|
1718
1736
|
}
|
1719
|
-
if (fileExt &&
|
1720
|
-
result = (
|
1737
|
+
if (fileExt && sm2.html5[fileExt] !== _undefined) {
|
1738
|
+
result = (sm2.html5[fileExt] && !preferFlashCheck(fileExt));
|
1721
1739
|
} else {
|
1722
1740
|
mime = 'audio/'+fileExt;
|
1723
|
-
result =
|
1724
|
-
|
1725
|
-
result = (result &&
|
1741
|
+
result = sm2.html5.canPlayType({type:mime});
|
1742
|
+
sm2.html5[fileExt] = result;
|
1743
|
+
result = (result && sm2.html5[mime] && !preferFlashCheck(mime));
|
1726
1744
|
}
|
1727
1745
|
return result;
|
1728
1746
|
};
|
1729
|
-
|
1730
|
-
if (!
|
1747
|
+
testHTML5 = function() {
|
1748
|
+
if (!sm2.useHTML5Audio || !sm2.hasHTML5) {
|
1731
1749
|
return false;
|
1732
1750
|
}
|
1733
|
-
var a = (
|
1751
|
+
var a = (Audio !== _undefined ? (isOpera && opera.version() < 10 ? new Audio(null) : new Audio()) : null),
|
1734
1752
|
item, lookup, support = {}, aF, i;
|
1735
|
-
function
|
1753
|
+
function cp(m) {
|
1736
1754
|
var canPlay, i, j,
|
1737
1755
|
result = false,
|
1738
1756
|
isOK = false;
|
@@ -1741,84 +1759,84 @@ function SoundManager(smURL, smID) {
|
|
1741
1759
|
}
|
1742
1760
|
if (m instanceof Array) {
|
1743
1761
|
for (i=0, j=m.length; i<j; i++) {
|
1744
|
-
if (
|
1762
|
+
if (sm2.html5[m[i]] || a.canPlayType(m[i]).match(sm2.html5Test)) {
|
1745
1763
|
isOK = true;
|
1746
|
-
|
1747
|
-
|
1764
|
+
sm2.html5[m[i]] = true;
|
1765
|
+
sm2.flash[m[i]] = !!(m[i].match(flashMIME));
|
1748
1766
|
}
|
1749
1767
|
}
|
1750
1768
|
result = isOK;
|
1751
1769
|
} else {
|
1752
1770
|
canPlay = (a && typeof a.canPlayType === 'function' ? a.canPlayType(m) : false);
|
1753
|
-
result = !!(canPlay && (canPlay.match(
|
1771
|
+
result = !!(canPlay && (canPlay.match(sm2.html5Test)));
|
1754
1772
|
}
|
1755
1773
|
return result;
|
1756
1774
|
}
|
1757
|
-
aF =
|
1775
|
+
aF = sm2.audioFormats;
|
1758
1776
|
for (item in aF) {
|
1759
1777
|
if (aF.hasOwnProperty(item)) {
|
1760
1778
|
lookup = 'audio/' + item;
|
1761
|
-
support[item] =
|
1779
|
+
support[item] = cp(aF[item].type);
|
1762
1780
|
support[lookup] = support[item];
|
1763
|
-
if (item.match(
|
1764
|
-
|
1765
|
-
|
1781
|
+
if (item.match(flashMIME)) {
|
1782
|
+
sm2.flash[item] = true;
|
1783
|
+
sm2.flash[lookup] = true;
|
1766
1784
|
} else {
|
1767
|
-
|
1768
|
-
|
1785
|
+
sm2.flash[item] = false;
|
1786
|
+
sm2.flash[lookup] = false;
|
1769
1787
|
}
|
1770
1788
|
if (aF[item] && aF[item].related) {
|
1771
1789
|
for (i=aF[item].related.length-1; i >= 0; i--) {
|
1772
1790
|
support['audio/'+aF[item].related[i]] = support[item];
|
1773
|
-
|
1774
|
-
|
1791
|
+
sm2.html5[aF[item].related[i]] = support[item];
|
1792
|
+
sm2.flash[aF[item].related[i]] = support[item];
|
1775
1793
|
}
|
1776
1794
|
}
|
1777
1795
|
}
|
1778
1796
|
}
|
1779
|
-
support.canPlayType = (a?
|
1780
|
-
|
1797
|
+
support.canPlayType = (a?cp:null);
|
1798
|
+
sm2.html5 = mixin(sm2.html5, support);
|
1781
1799
|
return true;
|
1782
1800
|
};
|
1783
|
-
|
1801
|
+
strings = {
|
1784
1802
|
};
|
1785
|
-
|
1803
|
+
str = function() {
|
1786
1804
|
};
|
1787
|
-
|
1788
|
-
if (
|
1805
|
+
loopFix = function(sOpt) {
|
1806
|
+
if (fV === 8 && sOpt.loops > 1 && sOpt.stream) {
|
1789
1807
|
sOpt.stream = false;
|
1790
1808
|
}
|
1791
1809
|
return sOpt;
|
1792
1810
|
};
|
1793
|
-
|
1811
|
+
policyFix = function(sOpt, sPre) {
|
1794
1812
|
if (sOpt && !sOpt.usePolicyFile && (sOpt.onid3 || sOpt.usePeakData || sOpt.useWaveformData || sOpt.useEQData)) {
|
1795
1813
|
sOpt.usePolicyFile = true;
|
1796
1814
|
}
|
1797
1815
|
return sOpt;
|
1798
1816
|
};
|
1799
|
-
|
1817
|
+
complain = function(sMsg) {
|
1800
1818
|
};
|
1801
|
-
|
1819
|
+
doNothing = function() {
|
1802
1820
|
return false;
|
1803
1821
|
};
|
1804
|
-
|
1822
|
+
disableObject = function(o) {
|
1805
1823
|
var oProp;
|
1806
1824
|
for (oProp in o) {
|
1807
1825
|
if (o.hasOwnProperty(oProp) && typeof o[oProp] === 'function') {
|
1808
|
-
o[oProp] =
|
1826
|
+
o[oProp] = doNothing;
|
1809
1827
|
}
|
1810
1828
|
}
|
1811
1829
|
oProp = null;
|
1812
1830
|
};
|
1813
|
-
|
1814
|
-
if (
|
1831
|
+
failSafely = function(bNoDisable) {
|
1832
|
+
if (bNoDisable === _undefined) {
|
1815
1833
|
bNoDisable = false;
|
1816
1834
|
}
|
1817
|
-
if (
|
1818
|
-
|
1835
|
+
if (disabled || bNoDisable) {
|
1836
|
+
sm2.disable(bNoDisable);
|
1819
1837
|
}
|
1820
1838
|
};
|
1821
|
-
|
1839
|
+
normalizeMovieURL = function(smURL) {
|
1822
1840
|
var urlParams = null, url;
|
1823
1841
|
if (smURL) {
|
1824
1842
|
if (smURL.match(/\.swf(\?.*)?$/i)) {
|
@@ -1830,110 +1848,110 @@ function SoundManager(smURL, smID) {
|
|
1830
1848
|
smURL += '/';
|
1831
1849
|
}
|
1832
1850
|
}
|
1833
|
-
url = (smURL && smURL.lastIndexOf('/') !== - 1 ? smURL.substr(0, smURL.lastIndexOf('/') + 1) : './') +
|
1834
|
-
if (
|
1851
|
+
url = (smURL && smURL.lastIndexOf('/') !== - 1 ? smURL.substr(0, smURL.lastIndexOf('/') + 1) : './') + sm2.movieURL;
|
1852
|
+
if (sm2.noSWFCache) {
|
1835
1853
|
url += ('?ts=' + new Date().getTime());
|
1836
1854
|
}
|
1837
1855
|
return url;
|
1838
1856
|
};
|
1839
|
-
|
1840
|
-
|
1841
|
-
if (
|
1842
|
-
|
1843
|
-
}
|
1844
|
-
var isDebug = (
|
1845
|
-
if (
|
1846
|
-
|
1847
|
-
}
|
1848
|
-
|
1849
|
-
if (
|
1850
|
-
|
1851
|
-
|
1852
|
-
|
1853
|
-
|
1854
|
-
|
1857
|
+
setVersionInfo = function() {
|
1858
|
+
fV = parseInt(sm2.flashVersion, 10);
|
1859
|
+
if (fV !== 8 && fV !== 9) {
|
1860
|
+
sm2.flashVersion = fV = defaultFlashVersion;
|
1861
|
+
}
|
1862
|
+
var isDebug = (sm2.debugMode || sm2.debugFlash?'_debug.swf':'.swf');
|
1863
|
+
if (sm2.useHTML5Audio && !sm2.html5Only && sm2.audioFormats.mp4.required && fV < 9) {
|
1864
|
+
sm2.flashVersion = fV = 9;
|
1865
|
+
}
|
1866
|
+
sm2.version = sm2.versionNumber + (sm2.html5Only?' (HTML5-only mode)':(fV === 9?' (AS3/Flash 9)':' (AS2/Flash 8)'));
|
1867
|
+
if (fV > 8) {
|
1868
|
+
sm2.defaultOptions = mixin(sm2.defaultOptions, sm2.flash9Options);
|
1869
|
+
sm2.features.buffering = true;
|
1870
|
+
sm2.defaultOptions = mixin(sm2.defaultOptions, sm2.movieStarOptions);
|
1871
|
+
sm2.filePatterns.flash9 = new RegExp('\\.(mp3|' + netStreamTypes.join('|') + ')(\\?.*)?$', 'i');
|
1872
|
+
sm2.features.movieStar = true;
|
1855
1873
|
} else {
|
1856
|
-
|
1874
|
+
sm2.features.movieStar = false;
|
1857
1875
|
}
|
1858
|
-
|
1859
|
-
|
1860
|
-
|
1876
|
+
sm2.filePattern = sm2.filePatterns[(fV !== 8?'flash9':'flash8')];
|
1877
|
+
sm2.movieURL = (fV === 8?'soundmanager2.swf':'soundmanager2_flash9.swf').replace('.swf', isDebug);
|
1878
|
+
sm2.features.peakData = sm2.features.waveformData = sm2.features.eqData = (fV > 8);
|
1861
1879
|
};
|
1862
|
-
|
1863
|
-
if (!
|
1880
|
+
setPolling = function(bPolling, bHighPerformance) {
|
1881
|
+
if (!flash) {
|
1864
1882
|
return false;
|
1865
1883
|
}
|
1866
|
-
|
1884
|
+
flash._setPolling(bPolling, bHighPerformance);
|
1867
1885
|
};
|
1868
|
-
|
1869
|
-
if (
|
1870
|
-
|
1886
|
+
initDebug = function() {
|
1887
|
+
if (sm2.debugURLParam.test(wl)) {
|
1888
|
+
sm2.debugMode = true;
|
1871
1889
|
}
|
1872
1890
|
};
|
1873
|
-
|
1874
|
-
|
1891
|
+
idCheck = this.getSoundById;
|
1892
|
+
getSWFCSS = function() {
|
1875
1893
|
var css = [];
|
1876
|
-
if (
|
1877
|
-
css.push(
|
1894
|
+
if (sm2.debugMode) {
|
1895
|
+
css.push(swfCSS.sm2Debug);
|
1878
1896
|
}
|
1879
|
-
if (
|
1880
|
-
css.push(
|
1897
|
+
if (sm2.debugFlash) {
|
1898
|
+
css.push(swfCSS.flashDebug);
|
1881
1899
|
}
|
1882
|
-
if (
|
1883
|
-
css.push(
|
1900
|
+
if (sm2.useHighPerformance) {
|
1901
|
+
css.push(swfCSS.highPerf);
|
1884
1902
|
}
|
1885
1903
|
return css.join(' ');
|
1886
1904
|
};
|
1887
|
-
|
1888
|
-
var name =
|
1889
|
-
p =
|
1890
|
-
css =
|
1905
|
+
flashBlockHandler = function() {
|
1906
|
+
var name = str('fbHandler'),
|
1907
|
+
p = sm2.getMoviePercent(),
|
1908
|
+
css = swfCSS,
|
1891
1909
|
error = {type:'FLASHBLOCK'};
|
1892
|
-
if (
|
1910
|
+
if (sm2.html5Only) {
|
1893
1911
|
return false;
|
1894
1912
|
}
|
1895
|
-
if (!
|
1896
|
-
if (
|
1897
|
-
|
1913
|
+
if (!sm2.ok()) {
|
1914
|
+
if (needsFlash) {
|
1915
|
+
sm2.oMC.className = getSWFCSS() + ' ' + css.swfDefault + ' ' + (p === null?css.swfTimedout:css.swfError);
|
1898
1916
|
}
|
1899
|
-
|
1900
|
-
|
1901
|
-
|
1917
|
+
sm2.didFlashBlock = true;
|
1918
|
+
processOnEvents({type:'ontimeout', ignoreInit:true, error:error});
|
1919
|
+
catchError(error);
|
1902
1920
|
} else {
|
1903
|
-
if (
|
1904
|
-
|
1921
|
+
if (sm2.oMC) {
|
1922
|
+
sm2.oMC.className = [getSWFCSS(), css.swfDefault, css.swfLoaded + (sm2.didFlashBlock?' '+css.swfUnblocked:'')].join(' ');
|
1905
1923
|
}
|
1906
1924
|
}
|
1907
1925
|
};
|
1908
|
-
|
1909
|
-
if (
|
1910
|
-
|
1926
|
+
addOnEvent = function(sType, oMethod, oScope) {
|
1927
|
+
if (on_queue[sType] === _undefined) {
|
1928
|
+
on_queue[sType] = [];
|
1911
1929
|
}
|
1912
|
-
|
1930
|
+
on_queue[sType].push({
|
1913
1931
|
'method': oMethod,
|
1914
1932
|
'scope': (oScope || null),
|
1915
1933
|
'fired': false
|
1916
1934
|
});
|
1917
1935
|
};
|
1918
|
-
|
1936
|
+
processOnEvents = function(oOptions) {
|
1919
1937
|
if (!oOptions) {
|
1920
1938
|
oOptions = {
|
1921
|
-
type: (
|
1939
|
+
type: (sm2.ok() ? 'onready' : 'ontimeout')
|
1922
1940
|
};
|
1923
1941
|
}
|
1924
|
-
if (!
|
1942
|
+
if (!didInit && oOptions && !oOptions.ignoreInit) {
|
1925
1943
|
return false;
|
1926
1944
|
}
|
1927
|
-
if (oOptions.type === 'ontimeout' && (
|
1945
|
+
if (oOptions.type === 'ontimeout' && (sm2.ok() || (disabled && !oOptions.ignoreInit))) {
|
1928
1946
|
return false;
|
1929
1947
|
}
|
1930
1948
|
var status = {
|
1931
|
-
success: (oOptions && oOptions.ignoreInit?
|
1949
|
+
success: (oOptions && oOptions.ignoreInit?sm2.ok():!disabled)
|
1932
1950
|
},
|
1933
|
-
srcQueue = (oOptions && oOptions.type?
|
1951
|
+
srcQueue = (oOptions && oOptions.type?on_queue[oOptions.type]||[]:[]),
|
1934
1952
|
queue = [], i, j,
|
1935
1953
|
args = [status],
|
1936
|
-
canRetry = (
|
1954
|
+
canRetry = (needsFlash && !sm2.ok());
|
1937
1955
|
if (oOptions.error) {
|
1938
1956
|
args[0].error = oOptions.error;
|
1939
1957
|
}
|
@@ -1956,86 +1974,87 @@ function SoundManager(smURL, smID) {
|
|
1956
1974
|
}
|
1957
1975
|
return true;
|
1958
1976
|
};
|
1959
|
-
|
1960
|
-
|
1961
|
-
if (
|
1962
|
-
|
1977
|
+
initUserOnload = function() {
|
1978
|
+
window.setTimeout(function() {
|
1979
|
+
if (sm2.useFlashBlock) {
|
1980
|
+
flashBlockHandler();
|
1963
1981
|
}
|
1964
|
-
|
1965
|
-
if (typeof
|
1966
|
-
|
1982
|
+
processOnEvents();
|
1983
|
+
if (typeof sm2.onload === 'function') {
|
1984
|
+
sm2.onload.apply(window);
|
1967
1985
|
}
|
1968
|
-
if (
|
1969
|
-
|
1986
|
+
if (sm2.waitForWindowLoad) {
|
1987
|
+
event.add(window, 'load', initUserOnload);
|
1970
1988
|
}
|
1971
1989
|
},1);
|
1972
1990
|
};
|
1973
|
-
|
1974
|
-
if (
|
1975
|
-
return
|
1991
|
+
detectFlash = function() {
|
1992
|
+
if (hasFlash !== _undefined) {
|
1993
|
+
return hasFlash;
|
1976
1994
|
}
|
1977
|
-
var hasPlugin = false, n = navigator, nP = n.plugins, obj, type, types, AX =
|
1995
|
+
var hasPlugin = false, n = navigator, nP = n.plugins, obj, type, types, AX = window.ActiveXObject;
|
1978
1996
|
if (nP && nP.length) {
|
1979
1997
|
type = 'application/x-shockwave-flash';
|
1980
1998
|
types = n.mimeTypes;
|
1981
1999
|
if (types && types[type] && types[type].enabledPlugin && types[type].enabledPlugin.description) {
|
1982
2000
|
hasPlugin = true;
|
1983
2001
|
}
|
1984
|
-
} else if (
|
2002
|
+
} else if (AX !== _undefined && !ua.match(/MSAppHost/i)) {
|
1985
2003
|
try {
|
1986
2004
|
obj = new AX('ShockwaveFlash.ShockwaveFlash');
|
1987
2005
|
} catch(e) {
|
1988
2006
|
}
|
1989
2007
|
hasPlugin = (!!obj);
|
2008
|
+
obj = null;
|
1990
2009
|
}
|
1991
|
-
|
2010
|
+
hasFlash = hasPlugin;
|
1992
2011
|
return hasPlugin;
|
1993
2012
|
};
|
1994
|
-
|
2013
|
+
featureCheck = function() {
|
1995
2014
|
var needsFlash,
|
1996
2015
|
item,
|
1997
2016
|
result = true,
|
1998
|
-
formats =
|
1999
|
-
isSpecial = (
|
2017
|
+
formats = sm2.audioFormats,
|
2018
|
+
isSpecial = (is_iDevice && !!(ua.match(/os (1|2|3_0|3_1)/i)));
|
2000
2019
|
if (isSpecial) {
|
2001
|
-
|
2002
|
-
|
2003
|
-
if (
|
2004
|
-
|
2020
|
+
sm2.hasHTML5 = false;
|
2021
|
+
sm2.html5Only = true;
|
2022
|
+
if (sm2.oMC) {
|
2023
|
+
sm2.oMC.style.display = 'none';
|
2005
2024
|
}
|
2006
2025
|
result = false;
|
2007
2026
|
} else {
|
2008
|
-
if (
|
2009
|
-
if (!
|
2010
|
-
|
2027
|
+
if (sm2.useHTML5Audio) {
|
2028
|
+
if (!sm2.html5 || !sm2.html5.canPlayType) {
|
2029
|
+
sm2.hasHTML5 = false;
|
2011
2030
|
}
|
2012
2031
|
}
|
2013
2032
|
}
|
2014
|
-
if (
|
2033
|
+
if (sm2.useHTML5Audio && sm2.hasHTML5) {
|
2015
2034
|
for (item in formats) {
|
2016
2035
|
if (formats.hasOwnProperty(item)) {
|
2017
|
-
if ((formats[item].required && !
|
2036
|
+
if ((formats[item].required && !sm2.html5.canPlayType(formats[item].type)) || (sm2.preferFlash && (sm2.flash[item] || sm2.flash[formats[item].type]))) {
|
2018
2037
|
needsFlash = true;
|
2019
2038
|
}
|
2020
2039
|
}
|
2021
2040
|
}
|
2022
2041
|
}
|
2023
|
-
if (
|
2042
|
+
if (sm2.ignoreFlash) {
|
2024
2043
|
needsFlash = false;
|
2025
2044
|
}
|
2026
|
-
|
2027
|
-
return (!
|
2045
|
+
sm2.html5Only = (sm2.hasHTML5 && sm2.useHTML5Audio && !needsFlash);
|
2046
|
+
return (!sm2.html5Only);
|
2028
2047
|
};
|
2029
|
-
|
2048
|
+
parseURL = function(url) {
|
2030
2049
|
var i, j, urlResult = 0, result;
|
2031
2050
|
if (url instanceof Array) {
|
2032
2051
|
for (i=0, j=url.length; i<j; i++) {
|
2033
2052
|
if (url[i] instanceof Object) {
|
2034
|
-
if (
|
2053
|
+
if (sm2.canPlayMIME(url[i].type)) {
|
2035
2054
|
urlResult = i;
|
2036
2055
|
break;
|
2037
2056
|
}
|
2038
|
-
} else if (
|
2057
|
+
} else if (sm2.canPlayURL(url[i])) {
|
2039
2058
|
urlResult = i;
|
2040
2059
|
break;
|
2041
2060
|
}
|
@@ -2049,59 +2068,59 @@ function SoundManager(smURL, smID) {
|
|
2049
2068
|
}
|
2050
2069
|
return result;
|
2051
2070
|
};
|
2052
|
-
|
2071
|
+
startTimer = function(oSound) {
|
2053
2072
|
if (!oSound._hasTimer) {
|
2054
2073
|
oSound._hasTimer = true;
|
2055
|
-
if (!
|
2056
|
-
if (
|
2057
|
-
|
2074
|
+
if (!mobileHTML5 && sm2.html5PollingInterval) {
|
2075
|
+
if (h5IntervalTimer === null && h5TimerCount === 0) {
|
2076
|
+
h5IntervalTimer = window.setInterval(timerExecute, sm2.html5PollingInterval);
|
2058
2077
|
}
|
2059
|
-
|
2078
|
+
h5TimerCount++;
|
2060
2079
|
}
|
2061
2080
|
}
|
2062
2081
|
};
|
2063
|
-
|
2082
|
+
stopTimer = function(oSound) {
|
2064
2083
|
if (oSound._hasTimer) {
|
2065
2084
|
oSound._hasTimer = false;
|
2066
|
-
if (!
|
2067
|
-
|
2085
|
+
if (!mobileHTML5 && sm2.html5PollingInterval) {
|
2086
|
+
h5TimerCount--;
|
2068
2087
|
}
|
2069
2088
|
}
|
2070
2089
|
};
|
2071
|
-
|
2090
|
+
timerExecute = function() {
|
2072
2091
|
var i;
|
2073
|
-
if (
|
2074
|
-
|
2075
|
-
|
2092
|
+
if (h5IntervalTimer !== null && !h5TimerCount) {
|
2093
|
+
window.clearInterval(h5IntervalTimer);
|
2094
|
+
h5IntervalTimer = null;
|
2076
2095
|
return false;
|
2077
2096
|
}
|
2078
|
-
for (i =
|
2079
|
-
if (
|
2080
|
-
|
2097
|
+
for (i = sm2.soundIDs.length-1; i >= 0; i--) {
|
2098
|
+
if (sm2.sounds[sm2.soundIDs[i]].isHTML5 && sm2.sounds[sm2.soundIDs[i]]._hasTimer) {
|
2099
|
+
sm2.sounds[sm2.soundIDs[i]]._onTimer();
|
2081
2100
|
}
|
2082
2101
|
}
|
2083
2102
|
};
|
2084
|
-
|
2085
|
-
options = (
|
2086
|
-
if (typeof
|
2087
|
-
|
2103
|
+
catchError = function(options) {
|
2104
|
+
options = (options !== _undefined ? options : {});
|
2105
|
+
if (typeof sm2.onerror === 'function') {
|
2106
|
+
sm2.onerror.apply(window, [{type:(options.type !== _undefined ? options.type : null)}]);
|
2088
2107
|
}
|
2089
|
-
if (
|
2090
|
-
|
2108
|
+
if (options.fatal !== _undefined && options.fatal) {
|
2109
|
+
sm2.disable();
|
2091
2110
|
}
|
2092
2111
|
};
|
2093
|
-
|
2094
|
-
if (!
|
2112
|
+
badSafariFix = function() {
|
2113
|
+
if (!isBadSafari || !detectFlash()) {
|
2095
2114
|
return false;
|
2096
2115
|
}
|
2097
|
-
var aF =
|
2116
|
+
var aF = sm2.audioFormats, i, item;
|
2098
2117
|
for (item in aF) {
|
2099
2118
|
if (aF.hasOwnProperty(item)) {
|
2100
2119
|
if (item === 'mp3' || item === 'mp4') {
|
2101
|
-
|
2120
|
+
sm2.html5[item] = false;
|
2102
2121
|
if (aF[item] && aF[item].related) {
|
2103
2122
|
for (i = aF[item].related.length-1; i >= 0; i--) {
|
2104
|
-
|
2123
|
+
sm2.html5[aF[item].related[i]] = false;
|
2105
2124
|
}
|
2106
2125
|
}
|
2107
2126
|
}
|
@@ -2111,104 +2130,105 @@ function SoundManager(smURL, smID) {
|
|
2111
2130
|
this._setSandboxType = function(sandboxType) {
|
2112
2131
|
};
|
2113
2132
|
this._externalInterfaceOK = function(flashDate, swfVersion) {
|
2114
|
-
if (
|
2133
|
+
if (sm2.swfLoaded) {
|
2115
2134
|
return false;
|
2116
2135
|
}
|
2117
|
-
var e
|
2118
|
-
|
2119
|
-
|
2120
|
-
if (
|
2121
|
-
|
2136
|
+
var e;
|
2137
|
+
sm2.swfLoaded = true;
|
2138
|
+
tryInitOnFocus = false;
|
2139
|
+
if (isBadSafari) {
|
2140
|
+
badSafariFix();
|
2122
2141
|
}
|
2123
|
-
setTimeout(
|
2142
|
+
setTimeout(init, isIE ? 100 : 1);
|
2124
2143
|
};
|
2125
|
-
|
2126
|
-
if (
|
2144
|
+
createMovie = function(smID, smURL) {
|
2145
|
+
if (didAppend && appendSuccess) {
|
2127
2146
|
return false;
|
2128
2147
|
}
|
2129
|
-
function
|
2148
|
+
function initMsg() {
|
2130
2149
|
}
|
2131
|
-
if (
|
2132
|
-
|
2133
|
-
|
2134
|
-
|
2135
|
-
|
2136
|
-
|
2137
|
-
|
2150
|
+
if (sm2.html5Only) {
|
2151
|
+
setVersionInfo();
|
2152
|
+
initMsg();
|
2153
|
+
sm2.oMC = id(sm2.movieID);
|
2154
|
+
init();
|
2155
|
+
didAppend = true;
|
2156
|
+
appendSuccess = true;
|
2138
2157
|
return false;
|
2139
2158
|
}
|
2140
|
-
var remoteURL = (smURL ||
|
2141
|
-
localURL = (
|
2159
|
+
var remoteURL = (smURL || sm2.url),
|
2160
|
+
localURL = (sm2.altURL || remoteURL),
|
2142
2161
|
swfTitle = 'JS/Flash audio component (SoundManager 2)',
|
2143
|
-
oTarget =
|
2144
|
-
extraClass =
|
2162
|
+
oTarget = getDocument(),
|
2163
|
+
extraClass = getSWFCSS(),
|
2145
2164
|
isRTL = null,
|
2146
|
-
html =
|
2165
|
+
html = doc.getElementsByTagName('html')[0],
|
2147
2166
|
oEmbed, oMovie, tmp, movieHTML, oEl, s, x, sClass;
|
2148
2167
|
isRTL = (html && html.dir && html.dir.match(/rtl/i));
|
2149
|
-
smID = (
|
2168
|
+
smID = (smID === _undefined?sm2.id:smID);
|
2150
2169
|
function param(name, value) {
|
2151
2170
|
return '<param name="'+name+'" value="'+value+'" />';
|
2152
2171
|
}
|
2153
|
-
|
2154
|
-
|
2155
|
-
smURL =
|
2156
|
-
|
2157
|
-
if (
|
2158
|
-
|
2172
|
+
setVersionInfo();
|
2173
|
+
sm2.url = normalizeMovieURL(overHTTP?remoteURL:localURL);
|
2174
|
+
smURL = sm2.url;
|
2175
|
+
sm2.wmode = (!sm2.wmode && sm2.useHighPerformance ? 'transparent' : sm2.wmode);
|
2176
|
+
if (sm2.wmode !== null && (ua.match(/msie 8/i) || (!isIE && !sm2.useHighPerformance)) && navigator.platform.match(/win32|win64/i)) {
|
2177
|
+
messages.push(strings.spcWmode);
|
2178
|
+
sm2.wmode = null;
|
2159
2179
|
}
|
2160
2180
|
oEmbed = {
|
2161
2181
|
'name': smID,
|
2162
2182
|
'id': smID,
|
2163
2183
|
'src': smURL,
|
2164
2184
|
'quality': 'high',
|
2165
|
-
'allowScriptAccess':
|
2166
|
-
'bgcolor':
|
2167
|
-
'pluginspage':
|
2185
|
+
'allowScriptAccess': sm2.allowScriptAccess,
|
2186
|
+
'bgcolor': sm2.bgColor,
|
2187
|
+
'pluginspage': http+'www.macromedia.com/go/getflashplayer',
|
2168
2188
|
'title': swfTitle,
|
2169
2189
|
'type': 'application/x-shockwave-flash',
|
2170
|
-
'wmode':
|
2190
|
+
'wmode': sm2.wmode,
|
2171
2191
|
'hasPriority': 'true'
|
2172
2192
|
};
|
2173
|
-
if (
|
2193
|
+
if (sm2.debugFlash) {
|
2174
2194
|
oEmbed.FlashVars = 'debug=1';
|
2175
2195
|
}
|
2176
|
-
if (!
|
2196
|
+
if (!sm2.wmode) {
|
2177
2197
|
delete oEmbed.wmode;
|
2178
2198
|
}
|
2179
|
-
if (
|
2180
|
-
oMovie =
|
2199
|
+
if (isIE) {
|
2200
|
+
oMovie = doc.createElement('div');
|
2181
2201
|
movieHTML = [
|
2182
|
-
'<object id="' + smID + '" data="' + smURL + '" type="' + oEmbed.type + '" title="' + oEmbed.title +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="' +
|
2202
|
+
'<object id="' + smID + '" data="' + smURL + '" type="' + oEmbed.type + '" title="' + oEmbed.title +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="' + http+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">',
|
2183
2203
|
param('movie', smURL),
|
2184
|
-
param('AllowScriptAccess',
|
2204
|
+
param('AllowScriptAccess', sm2.allowScriptAccess),
|
2185
2205
|
param('quality', oEmbed.quality),
|
2186
|
-
(
|
2187
|
-
param('bgcolor',
|
2206
|
+
(sm2.wmode? param('wmode', sm2.wmode): ''),
|
2207
|
+
param('bgcolor', sm2.bgColor),
|
2188
2208
|
param('hasPriority', 'true'),
|
2189
|
-
(
|
2209
|
+
(sm2.debugFlash ? param('FlashVars', oEmbed.FlashVars) : ''),
|
2190
2210
|
'</object>'
|
2191
2211
|
].join('');
|
2192
2212
|
} else {
|
2193
|
-
oMovie =
|
2213
|
+
oMovie = doc.createElement('embed');
|
2194
2214
|
for (tmp in oEmbed) {
|
2195
2215
|
if (oEmbed.hasOwnProperty(tmp)) {
|
2196
2216
|
oMovie.setAttribute(tmp, oEmbed[tmp]);
|
2197
2217
|
}
|
2198
2218
|
}
|
2199
2219
|
}
|
2200
|
-
|
2201
|
-
extraClass =
|
2202
|
-
oTarget =
|
2220
|
+
initDebug();
|
2221
|
+
extraClass = getSWFCSS();
|
2222
|
+
oTarget = getDocument();
|
2203
2223
|
if (oTarget) {
|
2204
|
-
|
2205
|
-
if (!
|
2206
|
-
|
2207
|
-
|
2224
|
+
sm2.oMC = (id(sm2.movieID) || doc.createElement('div'));
|
2225
|
+
if (!sm2.oMC.id) {
|
2226
|
+
sm2.oMC.id = sm2.movieID;
|
2227
|
+
sm2.oMC.className = swfCSS.swfDefault + ' ' + extraClass;
|
2208
2228
|
s = null;
|
2209
2229
|
oEl = null;
|
2210
|
-
if (!
|
2211
|
-
if (
|
2230
|
+
if (!sm2.useFlashBlock) {
|
2231
|
+
if (sm2.useHighPerformance) {
|
2212
2232
|
s = {
|
2213
2233
|
'position': 'fixed',
|
2214
2234
|
'width': '8px',
|
@@ -2230,280 +2250,295 @@ function SoundManager(smURL, smID) {
|
|
2230
2250
|
}
|
2231
2251
|
}
|
2232
2252
|
}
|
2233
|
-
if (
|
2234
|
-
|
2253
|
+
if (isWebkit) {
|
2254
|
+
sm2.oMC.style.zIndex = 10000;
|
2235
2255
|
}
|
2236
|
-
if (!
|
2256
|
+
if (!sm2.debugFlash) {
|
2237
2257
|
for (x in s) {
|
2238
2258
|
if (s.hasOwnProperty(x)) {
|
2239
|
-
|
2259
|
+
sm2.oMC.style[x] = s[x];
|
2240
2260
|
}
|
2241
2261
|
}
|
2242
2262
|
}
|
2243
2263
|
try {
|
2244
|
-
if (!
|
2245
|
-
|
2264
|
+
if (!isIE) {
|
2265
|
+
sm2.oMC.appendChild(oMovie);
|
2246
2266
|
}
|
2247
|
-
oTarget.appendChild(
|
2248
|
-
if (
|
2249
|
-
oEl =
|
2250
|
-
oEl.className =
|
2267
|
+
oTarget.appendChild(sm2.oMC);
|
2268
|
+
if (isIE) {
|
2269
|
+
oEl = sm2.oMC.appendChild(doc.createElement('div'));
|
2270
|
+
oEl.className = swfCSS.swfBox;
|
2251
2271
|
oEl.innerHTML = movieHTML;
|
2252
2272
|
}
|
2253
|
-
|
2273
|
+
appendSuccess = true;
|
2254
2274
|
} catch(e) {
|
2255
|
-
throw new Error(
|
2275
|
+
throw new Error(str('domError')+' \n'+e.toString());
|
2256
2276
|
}
|
2257
2277
|
} else {
|
2258
|
-
sClass =
|
2259
|
-
|
2260
|
-
|
2261
|
-
if (
|
2262
|
-
oEl =
|
2263
|
-
oEl.className =
|
2278
|
+
sClass = sm2.oMC.className;
|
2279
|
+
sm2.oMC.className = (sClass?sClass+' ':swfCSS.swfDefault) + (extraClass?' '+extraClass:'');
|
2280
|
+
sm2.oMC.appendChild(oMovie);
|
2281
|
+
if (isIE) {
|
2282
|
+
oEl = sm2.oMC.appendChild(doc.createElement('div'));
|
2283
|
+
oEl.className = swfCSS.swfBox;
|
2264
2284
|
oEl.innerHTML = movieHTML;
|
2265
2285
|
}
|
2266
|
-
|
2286
|
+
appendSuccess = true;
|
2267
2287
|
}
|
2268
2288
|
}
|
2269
|
-
|
2270
|
-
|
2289
|
+
didAppend = true;
|
2290
|
+
initMsg();
|
2271
2291
|
return true;
|
2272
2292
|
};
|
2273
|
-
|
2274
|
-
if (
|
2275
|
-
|
2293
|
+
initMovie = function() {
|
2294
|
+
if (sm2.html5Only) {
|
2295
|
+
createMovie();
|
2276
2296
|
return false;
|
2277
2297
|
}
|
2278
|
-
if (
|
2298
|
+
if (flash) {
|
2279
2299
|
return false;
|
2280
2300
|
}
|
2281
|
-
if (!
|
2301
|
+
if (!sm2.url) {
|
2282
2302
|
return false;
|
2283
2303
|
}
|
2284
|
-
|
2285
|
-
if (!
|
2286
|
-
if (!
|
2287
|
-
|
2304
|
+
flash = sm2.getMovie(sm2.id);
|
2305
|
+
if (!flash) {
|
2306
|
+
if (!oRemoved) {
|
2307
|
+
createMovie(sm2.id, sm2.url);
|
2288
2308
|
} else {
|
2289
|
-
if (!
|
2290
|
-
|
2309
|
+
if (!isIE) {
|
2310
|
+
sm2.oMC.appendChild(oRemoved);
|
2291
2311
|
} else {
|
2292
|
-
|
2312
|
+
sm2.oMC.innerHTML = oRemovedHTML;
|
2293
2313
|
}
|
2294
|
-
|
2295
|
-
|
2314
|
+
oRemoved = null;
|
2315
|
+
didAppend = true;
|
2296
2316
|
}
|
2297
|
-
|
2317
|
+
flash = sm2.getMovie(sm2.id);
|
2298
2318
|
}
|
2299
|
-
if (typeof
|
2300
|
-
setTimeout(
|
2319
|
+
if (typeof sm2.oninitmovie === 'function') {
|
2320
|
+
setTimeout(sm2.oninitmovie, 1);
|
2301
2321
|
}
|
2302
2322
|
return true;
|
2303
2323
|
};
|
2304
|
-
|
2305
|
-
setTimeout(
|
2324
|
+
delayWaitForEI = function() {
|
2325
|
+
setTimeout(waitForEI, 1000);
|
2306
2326
|
};
|
2307
|
-
|
2327
|
+
waitForEI = function() {
|
2308
2328
|
var p,
|
2309
2329
|
loadIncomplete = false;
|
2310
|
-
if (!
|
2330
|
+
if (!sm2.url) {
|
2311
2331
|
return false;
|
2312
2332
|
}
|
2313
|
-
if (
|
2333
|
+
if (waitingForEI) {
|
2314
2334
|
return false;
|
2315
2335
|
}
|
2316
|
-
|
2317
|
-
|
2318
|
-
if (
|
2336
|
+
waitingForEI = true;
|
2337
|
+
event.remove(window, 'load', delayWaitForEI);
|
2338
|
+
if (tryInitOnFocus && !isFocused) {
|
2319
2339
|
return false;
|
2320
2340
|
}
|
2321
|
-
if (!
|
2322
|
-
p =
|
2341
|
+
if (!didInit) {
|
2342
|
+
p = sm2.getMoviePercent();
|
2323
2343
|
if (p > 0 && p < 100) {
|
2324
2344
|
loadIncomplete = true;
|
2325
2345
|
}
|
2326
2346
|
}
|
2327
2347
|
setTimeout(function() {
|
2328
|
-
p =
|
2348
|
+
p = sm2.getMoviePercent();
|
2329
2349
|
if (loadIncomplete) {
|
2330
|
-
|
2331
|
-
|
2350
|
+
waitingForEI = false;
|
2351
|
+
window.setTimeout(delayWaitForEI, 1);
|
2332
2352
|
return false;
|
2333
2353
|
}
|
2334
|
-
if (!
|
2354
|
+
if (!didInit && okToDisable) {
|
2335
2355
|
if (p === null) {
|
2336
|
-
if (
|
2337
|
-
if (
|
2338
|
-
|
2356
|
+
if (sm2.useFlashBlock || sm2.flashLoadTimeout === 0) {
|
2357
|
+
if (sm2.useFlashBlock) {
|
2358
|
+
flashBlockHandler();
|
2339
2359
|
}
|
2340
2360
|
} else {
|
2341
|
-
|
2361
|
+
processOnEvents({type:'ontimeout', ignoreInit: true});
|
2342
2362
|
}
|
2343
2363
|
} else {
|
2344
|
-
if (
|
2364
|
+
if (sm2.flashLoadTimeout === 0) {
|
2345
2365
|
} else {
|
2346
|
-
|
2366
|
+
failSafely(true);
|
2347
2367
|
}
|
2348
2368
|
}
|
2349
2369
|
}
|
2350
|
-
},
|
2370
|
+
}, sm2.flashLoadTimeout);
|
2351
2371
|
};
|
2352
|
-
|
2372
|
+
handleFocus = function() {
|
2353
2373
|
function cleanup() {
|
2354
|
-
|
2374
|
+
event.remove(window, 'focus', handleFocus);
|
2355
2375
|
}
|
2356
|
-
if (
|
2376
|
+
if (isFocused || !tryInitOnFocus) {
|
2357
2377
|
cleanup();
|
2358
2378
|
return true;
|
2359
2379
|
}
|
2360
|
-
|
2361
|
-
|
2362
|
-
|
2363
|
-
|
2380
|
+
okToDisable = true;
|
2381
|
+
isFocused = true;
|
2382
|
+
waitingForEI = false;
|
2383
|
+
delayWaitForEI();
|
2364
2384
|
cleanup();
|
2365
2385
|
return true;
|
2366
2386
|
};
|
2367
|
-
|
2387
|
+
flushMessages = function() {
|
2368
2388
|
};
|
2369
|
-
|
2370
|
-
|
2389
|
+
showSupport = function() {
|
2390
|
+
};
|
2391
|
+
initComplete = function(bNoDisable) {
|
2392
|
+
if (didInit) {
|
2371
2393
|
return false;
|
2372
2394
|
}
|
2373
|
-
if (
|
2374
|
-
|
2375
|
-
|
2395
|
+
if (sm2.html5Only) {
|
2396
|
+
didInit = true;
|
2397
|
+
initUserOnload();
|
2376
2398
|
return true;
|
2377
2399
|
}
|
2378
|
-
var wasTimeout = (
|
2400
|
+
var wasTimeout = (sm2.useFlashBlock && sm2.flashLoadTimeout && !sm2.getMoviePercent()),
|
2379
2401
|
result = true,
|
2380
2402
|
error;
|
2381
2403
|
if (!wasTimeout) {
|
2382
|
-
|
2383
|
-
if (
|
2384
|
-
error = {type: (!
|
2404
|
+
didInit = true;
|
2405
|
+
if (disabled) {
|
2406
|
+
error = {type: (!hasFlash && needsFlash ? 'NO_FLASH' : 'INIT_TIMEOUT')};
|
2385
2407
|
}
|
2386
2408
|
}
|
2387
|
-
if (
|
2388
|
-
if (
|
2389
|
-
|
2409
|
+
if (disabled || bNoDisable) {
|
2410
|
+
if (sm2.useFlashBlock && sm2.oMC) {
|
2411
|
+
sm2.oMC.className = getSWFCSS() + ' ' + (sm2.getMoviePercent() === null?swfCSS.swfTimedout:swfCSS.swfError);
|
2390
2412
|
}
|
2391
|
-
|
2392
|
-
|
2413
|
+
processOnEvents({type:'ontimeout', error:error, ignoreInit: true});
|
2414
|
+
catchError(error);
|
2393
2415
|
result = false;
|
2394
2416
|
} else {
|
2395
2417
|
}
|
2396
|
-
if (!
|
2397
|
-
if (
|
2398
|
-
|
2418
|
+
if (!disabled) {
|
2419
|
+
if (sm2.waitForWindowLoad && !windowLoaded) {
|
2420
|
+
event.add(window, 'load', initUserOnload);
|
2399
2421
|
} else {
|
2400
|
-
|
2422
|
+
initUserOnload();
|
2401
2423
|
}
|
2402
2424
|
}
|
2403
2425
|
return result;
|
2404
2426
|
};
|
2405
|
-
|
2427
|
+
setProperties = function() {
|
2406
2428
|
var i,
|
2407
|
-
o =
|
2429
|
+
o = sm2.setupOptions;
|
2408
2430
|
for (i in o) {
|
2409
2431
|
if (o.hasOwnProperty(i)) {
|
2410
|
-
if (
|
2411
|
-
|
2412
|
-
} else if (
|
2413
|
-
|
2432
|
+
if (sm2[i] === _undefined) {
|
2433
|
+
sm2[i] = o[i];
|
2434
|
+
} else if (sm2[i] !== o[i]) {
|
2435
|
+
sm2.setupOptions[i] = sm2[i];
|
2414
2436
|
}
|
2415
2437
|
}
|
2416
2438
|
}
|
2417
2439
|
};
|
2418
|
-
|
2419
|
-
if (
|
2440
|
+
init = function() {
|
2441
|
+
if (didInit) {
|
2420
2442
|
return false;
|
2421
2443
|
}
|
2422
|
-
function
|
2423
|
-
|
2444
|
+
function cleanup() {
|
2445
|
+
event.remove(window, 'load', sm2.beginDelayedInit);
|
2424
2446
|
}
|
2425
|
-
if (
|
2426
|
-
if (!
|
2427
|
-
|
2428
|
-
|
2429
|
-
|
2447
|
+
if (sm2.html5Only) {
|
2448
|
+
if (!didInit) {
|
2449
|
+
cleanup();
|
2450
|
+
sm2.enabled = true;
|
2451
|
+
initComplete();
|
2430
2452
|
}
|
2431
2453
|
return true;
|
2432
2454
|
}
|
2433
|
-
|
2455
|
+
initMovie();
|
2434
2456
|
try {
|
2435
|
-
|
2436
|
-
|
2437
|
-
if (!
|
2438
|
-
|
2457
|
+
flash._externalInterfaceTest(false);
|
2458
|
+
setPolling(true, (sm2.flashPollingInterval || (sm2.useHighPerformance ? 10 : 50)));
|
2459
|
+
if (!sm2.debugMode) {
|
2460
|
+
flash._disableDebug();
|
2439
2461
|
}
|
2440
|
-
|
2441
|
-
if (!
|
2442
|
-
|
2462
|
+
sm2.enabled = true;
|
2463
|
+
if (!sm2.html5Only) {
|
2464
|
+
event.add(window, 'unload', doNothing);
|
2443
2465
|
}
|
2444
2466
|
} catch(e) {
|
2445
|
-
|
2446
|
-
|
2447
|
-
|
2467
|
+
catchError({type:'JS_TO_FLASH_EXCEPTION', fatal:true});
|
2468
|
+
failSafely(true);
|
2469
|
+
initComplete();
|
2448
2470
|
return false;
|
2449
2471
|
}
|
2450
|
-
|
2451
|
-
|
2472
|
+
initComplete();
|
2473
|
+
cleanup();
|
2452
2474
|
return true;
|
2453
2475
|
};
|
2454
|
-
|
2455
|
-
if (
|
2476
|
+
domContentLoaded = function() {
|
2477
|
+
if (didDCLoaded) {
|
2456
2478
|
return false;
|
2457
2479
|
}
|
2458
|
-
|
2459
|
-
|
2460
|
-
|
2461
|
-
if (!
|
2462
|
-
|
2480
|
+
didDCLoaded = true;
|
2481
|
+
setProperties();
|
2482
|
+
initDebug();
|
2483
|
+
if (!hasFlash && sm2.hasHTML5) {
|
2484
|
+
sm2.setup({
|
2463
2485
|
'useHTML5Audio': true,
|
2464
2486
|
'preferFlash': false
|
2465
2487
|
});
|
2466
2488
|
}
|
2467
|
-
|
2468
|
-
|
2469
|
-
|
2470
|
-
|
2471
|
-
|
2472
|
-
|
2489
|
+
testHTML5();
|
2490
|
+
sm2.html5.usingFlash = featureCheck();
|
2491
|
+
needsFlash = sm2.html5.usingFlash;
|
2492
|
+
if (!hasFlash && needsFlash) {
|
2493
|
+
messages.push(strings.needFlash);
|
2494
|
+
sm2.setup({
|
2473
2495
|
'flashLoadTimeout': 1
|
2474
2496
|
});
|
2475
2497
|
}
|
2476
|
-
if (
|
2477
|
-
|
2498
|
+
if (doc.removeEventListener) {
|
2499
|
+
doc.removeEventListener('DOMContentLoaded', domContentLoaded, false);
|
2478
2500
|
}
|
2479
|
-
|
2501
|
+
initMovie();
|
2480
2502
|
return true;
|
2481
2503
|
};
|
2482
|
-
|
2483
|
-
if (
|
2484
|
-
|
2485
|
-
|
2504
|
+
domContentLoadedIE = function() {
|
2505
|
+
if (doc.readyState === 'complete') {
|
2506
|
+
domContentLoaded();
|
2507
|
+
doc.detachEvent('onreadystatechange', domContentLoadedIE);
|
2486
2508
|
}
|
2487
2509
|
return true;
|
2488
2510
|
};
|
2489
|
-
|
2490
|
-
|
2491
|
-
|
2492
|
-
};
|
2493
|
-
|
2494
|
-
|
2495
|
-
|
2496
|
-
|
2497
|
-
|
2498
|
-
|
2499
|
-
|
2500
|
-
|
2511
|
+
winOnLoad = function() {
|
2512
|
+
windowLoaded = true;
|
2513
|
+
event.remove(window, 'load', winOnLoad);
|
2514
|
+
};
|
2515
|
+
preInit = function() {
|
2516
|
+
if (mobileHTML5) {
|
2517
|
+
sm2.setupOptions.useHTML5Audio = true;
|
2518
|
+
sm2.setupOptions.preferFlash = false;
|
2519
|
+
if (is_iDevice || (isAndroid && !ua.match(/android\s2\.3/i))) {
|
2520
|
+
if (is_iDevice) {
|
2521
|
+
sm2.ignoreFlash = true;
|
2522
|
+
}
|
2523
|
+
useGlobalHTML5Audio = true;
|
2524
|
+
}
|
2525
|
+
}
|
2526
|
+
};
|
2527
|
+
preInit();
|
2528
|
+
detectFlash();
|
2529
|
+
event.add(window, 'focus', handleFocus);
|
2530
|
+
event.add(window, 'load', delayWaitForEI);
|
2531
|
+
event.add(window, 'load', winOnLoad);
|
2532
|
+
if (doc.addEventListener) {
|
2533
|
+
doc.addEventListener('DOMContentLoaded', domContentLoaded, false);
|
2534
|
+
} else if (doc.attachEvent) {
|
2535
|
+
doc.attachEvent('onreadystatechange', domContentLoadedIE);
|
2501
2536
|
} else {
|
2502
|
-
|
2537
|
+
catchError({type:'NO_DOM2_EVENTS', fatal:true});
|
2503
2538
|
}
|
2504
2539
|
}
|
2505
2540
|
// SM2_DEFER details: http://www.schillmania.com/projects/soundmanager2/doc/getstarted/#lazy-loading
|
2506
|
-
if (
|
2541
|
+
if (window.SM2_DEFER === undefined || !SM2_DEFER) {
|
2507
2542
|
soundManager = new SoundManager();
|
2508
2543
|
}
|
2509
2544
|
window.SoundManager = SoundManager;
|