]> jfr.im git - irc/quakenet/qwebirc.git/commitdiff
Update SoundManager2 to 2.95a.20090501 (fixes issue 48).
authorChris Porter <redacted>
Sat, 20 Jun 2009 15:40:34 +0000 (16:40 +0100)
committerChris Porter <redacted>
Sat, 20 Jun 2009 15:40:34 +0000 (16:40 +0100)
.hgignore
static/js/soundmanager2-nodebug-jsmin.js
static/js/soundmanager2.js
static/sound/soundmanager2.swf
static/sound/soundmanager2_flash9.swf

index 26ddb70dc9d1cf789ce424df50e93e281bc9a815..2751b4dae20c5c567f54e15c81ff0879ba8b706d 100644 (file)
--- a/.hgignore
+++ b/.hgignore
@@ -16,3 +16,5 @@ Thumbs.db
 static/{ugly,swm,mocha,q}ui{,debug}.html
 {bin/,}.checked
 {bin/,}.compiled
+ssl
+screenlog*
index e1fd36e40bc59b3be07a707d96f90fd10fe0afec..7077a74739cfe3b9a314e9e6700bab4ac3dc2a20 100644 (file)
@@ -7,6 +7,6 @@
    Code licensed under the BSD License:\r
    http://schillmania.com/projects/soundmanager2/license.txt\r
 \r
-   V2.93a.20090117\r
+   V2.95a.20090501\r
 */\r
-var soundManager=null;function SoundManager(b,a){this.flashVersion=8;this.debugMode=true;this.useConsole=true;this.consoleOnly=false;this.waitForWindowLoad=false;this.nullURL="null.mp3";this.allowPolling=true;this.useMovieStar=false;this.bgColor="#ffffff";this.useHighPerformance=true;this.defaultOptions={autoLoad:false,stream:true,autoPlay:false,onid3:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onstop:null,onfinish:null,onbeforefinish:null,onbeforefinishtime:5000,onbeforefinishcomplete:null,onjustbeforefinish:null,onjustbeforefinishtime:200,multiShot:true,position:null,pan:0,volume:100};this.flash9Options={isMovieStar:null,usePeakData:false,useWaveformData:false,useEQData:false};this.movieStarOptions={onmetadata:null,useVideo:false};var f=null;var e=this;this.version=null;this.versionNumber="V2.93a.20090117";this.movieURL=null;this.url=null;this.altURL=null;this.swfLoaded=false;this.enabled=false;this.o=null;this.id=(a||"sm2movie");this.oMC=null;this.sounds={};this.soundIDs=[];this.muted=false;this.isIE=(navigator.userAgent.match(/MSIE/i));this.isSafari=(navigator.userAgent.match(/safari/i));this.isGecko=(navigator.userAgent.match(/gecko/i));this.debugID="soundmanager-debug";this._debugOpen=true;this._didAppend=false;this._appendSuccess=false;this._didInit=false;this._disabled=false;this._windowLoaded=false;this._hasConsole=(typeof console!="undefined"&&typeof console.log!="undefined");this._debugLevels=["log","info","warn","error"];this._defaultFlashVersion=8;this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};this.netStreamTypes=["aac","flv","mov","mp4","m4v","f4v","m4a","mp4v","3gp","3g2"];this.netStreamPattern=new RegExp("\\.("+this.netStreamTypes.join("|")+")(\\?.*)?$","i");this.filePattern=null;this.features={peakData:false,waveformData:false,eqData:false,movieStar:false};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._setVersionInfo=function(){if(e.flashVersion!=8&&e.flashVersion!=9){alert('soundManager.flashVersion must be 8 or 9. "'+e.flashVersion+'" is invalid. Reverting to '+e._defaultFlashVersion+".");e.flashVersion=e._defaultFlashVersion}e.version=e.versionNumber+(e.flashVersion==9?" (AS3/Flash 9)":" (AS2/Flash 8)");if(e.flashVersion>8){e.defaultOptions=e._mergeObjects(e.defaultOptions,e.flash9Options)}if(e.flashVersion>8&&e.useMovieStar){e.defaultOptions=e._mergeObjects(e.defaultOptions,e.movieStarOptions);e.filePatterns.flash9=new RegExp("\\.(mp3|"+e.netStreamTypes.join("|")+")(\\?.*)?$","i");e.features.movieStar=true}else{e.useMovieStar=false;e.features.movieStar=false}e.filePattern=e.filePatterns[(e.flashVersion!=8?"flash9":"flash8")];e.movieURL=(e.flashVersion==8?"soundmanager2.swf":"soundmanager2_flash9.swf");e.features.peakData=e.features.waveformData=e.features.eqData=(e.flashVersion==9)};this._overHTTP=(document.location?document.location.protocol.match(/http/i):null);this._waitingforEI=false;this._initPending=false;this._tryInitOnFocus=(this.isSafari&&typeof document.hasFocus=="undefined");this._isFocused=(typeof document.hasFocus!="undefined"?document.hasFocus():null);this._okToDisable=!this._tryInitOnFocus;this.useAltURL=!this._overHTTP;var d="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html";this.supported=function(){return(e._didInit&&!e._disabled)};this.getMovie=function(g){return e.isIE?window[g]:(e.isSafari?document.getElementById(g)||document[g]:document.getElementById(g))};this.loadFromXML=function(g){try{e.o._loadFromXML(g)}catch(h){e._failSafely();return true}};this.createSound=function(h){if(!e._didInit){throw new Error("soundManager.createSound(): Not loaded yet - wait for soundManager.onload() before calling sound-related methods")}if(arguments.length==2){h={id:arguments[0],url:arguments[1]}}var i=e._mergeObjects(h);var g=i;if(e._idCheck(g.id,true)){return e.sounds[g.id]}if(e.flashVersion>8&&e.useMovieStar){if(g.isMovieStar===null){g.isMovieStar=(g.url.match(e.netStreamPattern)?true:false)}if(g.isMovieStar&&(g.usePeakData||g.useWaveformData||g.useEQData)){g.usePeakData=false;g.useWaveformData=false;g.useEQData=false}}e.sounds[g.id]=new f(g);e.soundIDs[e.soundIDs.length]=g.id;if(e.flashVersion==8){e.o._createSound(g.id,g.onjustbeforefinishtime)}else{e.o._createSound(g.id,g.url,g.onjustbeforefinishtime,g.usePeakData,g.useWaveformData,g.useEQData,g.isMovieStar,(g.isMovieStar?g.useVideo:false))}if(g.autoLoad||g.autoPlay){if(e.sounds[g.id]){e.sounds[g.id].load(g)}}if(g.autoPlay){e.sounds[g.id].play()}return e.sounds[g.id]};this.createVideo=function(g){if(arguments.length==2){g={id:arguments[0],url:arguments[1]}}if(e.flashVersion>=9){g.isMovieStar=true;g.useVideo=true}else{return false}return e.createSound(g)};this.destroySound=function(h,g){if(!e._idCheck(h)){return false}for(var j=0;j<e.soundIDs.length;j++){if(e.soundIDs[j]==h){e.soundIDs.splice(j,1);continue}}e.sounds[h].unload();if(!g){e.sounds[h].destruct()}delete e.sounds[h]};this.destroyVideo=this.destroySound;this.load=function(g,h){if(!e._idCheck(g)){return false}e.sounds[g].load(h)};this.unload=function(g){if(!e._idCheck(g)){return false}e.sounds[g].unload()};this.play=function(g,h){if(!e._idCheck(g)){if(typeof h!="Object"){h={url:h}}if(h&&h.url){h.id=g;e.createSound(h)}else{return false}}e.sounds[g].play(h)};this.start=this.play;this.setPosition=function(g,h){if(!e._idCheck(g)){return false}e.sounds[g].setPosition(h)};this.stop=function(g){if(!e._idCheck(g)){return false}e.sounds[g].stop()};this.stopAll=function(){for(var g in e.sounds){if(e.sounds[g] instanceof f){e.sounds[g].stop()}}};this.pause=function(g){if(!e._idCheck(g)){return false}e.sounds[g].pause()};this.pauseAll=function(){for(var g=e.soundIDs.length;g--;){e.sounds[e.soundIDs[g]].pause()}};this.resume=function(g){if(!e._idCheck(g)){return false}e.sounds[g].resume()};this.resumeAll=function(){for(var g=e.soundIDs.length;g--;){e.sounds[e.soundIDs[g]].resume()}};this.togglePause=function(g){if(!e._idCheck(g)){return false}e.sounds[g].togglePause()};this.setPan=function(g,h){if(!e._idCheck(g)){return false}e.sounds[g].setPan(h)};this.setVolume=function(h,g){if(!e._idCheck(h)){return false}e.sounds[h].setVolume(g)};this.mute=function(g){if(typeof g!="string"){g=null}if(!g){for(var h=e.soundIDs.length;h--;){e.sounds[e.soundIDs[h]].mute()}e.muted=true}else{if(!e._idCheck(g)){return false}e.sounds[g].mute()}};this.muteAll=function(){e.mute()};this.unmute=function(g){if(typeof g!="string"){g=null}if(!g){for(var h=e.soundIDs.length;h--;){e.sounds[e.soundIDs[h]].unmute()}e.muted=false}else{if(!e._idCheck(g)){return false}e.sounds[g].unmute()}};this.unmuteAll=function(){e.unmute()};this.getMemoryUse=function(){if(e.flashVersion==8){return 0}if(e.o){return parseInt(e.o._getMemoryUse(),10)}};this.setPolling=function(g){if(!e.o||!e.allowPolling){return false}e.o._setPolling(g)};this.disable=function(g){if(e._disabled){return false}e._disabled=true;for(var h=e.soundIDs.length;h--;){e._disableObject(e.sounds[e.soundIDs[h]])}e.initComplete();e._disableObject(e)};this.canPlayURL=function(g){return(g?(g.match(e.filePattern)?true:false):null)};this.getSoundById=function(h,i){if(!h){throw new Error("SoundManager.getSoundById(): sID is null/undefined")}var g=e.sounds[h];if(!g&&!i){}return g};this.onload=function(){soundManager._wD("<em>Warning</em>: soundManager.onload() is undefined.",2)};this.onerror=function(){};this._idCheck=this.getSoundById;var c=function(){return false};c._protected=true;this._disableObject=function(h){for(var g in h){if(typeof h[g]=="function"&&typeof h[g]._protected=="undefined"){h[g]=c}}g=null};this._failSafely=function(){if(!e._disabled){e.disable()}};this._normalizeMovieURL=function(g){var h=null;if(g){if(g.match(/\.swf(\?.*)?$/i)){h=g.substr(g.toLowerCase().lastIndexOf(".swf?")+4);if(h){return g}}else{if(g.lastIndexOf("/")!=g.length-1){g=g+"/"}}}return(g&&g.lastIndexOf("/")!=-1?g.substr(0,g.lastIndexOf("/")+1):"./")+e.movieURL};this._getDocument=function(){return(document.body?document.body:(document.documentElement?document.documentElement:document.getElementsByTagName("div")[0]))};this._getDocument._protected=true;this._createMovie=function(z,o){if(e._didAppend&&e._appendSuccess){return false}if(window.location.href.indexOf("debug=1")+1){e.debugMode=true}e._didAppend=true;e._setVersionInfo();var y=(o?o:e.url);var t=(e.altURL?e.altURL:y);e.url=e._normalizeMovieURL(e._overHTTP?y:t);o=e.url;var u=null;if(e.useHighPerformance&&e.useHighPerformance!="always"&&navigator.platform.match(/win32/i)&&navigator.userAgent.match(/firefox/i)){u="Note: disabling highPerformance, known issues with this browser/OS combo.";e.useHighPerformance=false}if(e.useHighPerformance&&e.useMovieStar){u="Note: disabling highPerformance, not applicable with movieStar mode on";e.useHighPerformance=false}var B={name:z,id:z,src:o,width:"100%",height:"100%",quality:"high",allowScriptAccess:"always",bgcolor:e.bgColor,pluginspage:"http://www.macromedia.com/go/getflashplayer",type:"application/x-shockwave-flash"};var i={id:z,data:o,type:"application/x-shockwave-flash",width:"100%",height:"100%"};var g={movie:o,AllowScriptAccess:"always",quality:"high",bgcolor:e.bgColor};if(e.useHighPerformance&&!e.useMovieStar){B.wmode="transparent";g.wmode="transparent"}var p=null;var C=null;if(e.isIE){p=document.createElement("div");var v='<object id="'+z+'" data="'+o+'" type="application/x-shockwave-flash" width="100%" height="100%"><param name="movie" value="'+o+'" /><param name="AllowScriptAccess" value="always" /><param name="quality" value="high" />'+(e.useHighPerformance&&!e.useMovieStar?'<param name="wmode" value="transparent" /> ':"")+'<param name="bgcolor" value="'+e.bgColor+'" /><!-- --></object>'}else{p=document.createElement("embed");for(C in B){if(B.hasOwnProperty(C)){p.setAttribute(C,B[C])}}}var k=document.createElement("div");k.id=e.debugID+"-toggle";var l={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};k.appendChild(document.createTextNode("-"));k.onclick=e._toggleDebug;k.title="Toggle SM2 debug console";if(navigator.userAgent.match(/msie 6/i)){k.style.position="absolute";k.style.cursor="hand"}for(C in l){if(l.hasOwnProperty(C)){k.style[C]=l[C]}}var h="soundManager._createMovie(): appendChild/innerHTML set failed. May be app/xhtml+xml DOM-related.";var w=e._getDocument();if(w){e.oMC=document.getElementById("sm2-container")?document.getElementById("sm2-container"):document.createElement("div");if(!e.oMC.id){e.oMC.id="sm2-container";e.oMC.className="movieContainer";var q=null;var r=null;if(e.useHighPerformance){q={position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",zIndex:-1}}else{q={position:"absolute",width:"1px",height:"1px",bottom:"0px",left:"0px"}}var m=null;for(m in q){if(q.hasOwnProperty(m)){e.oMC.style[m]=q[m]}}try{if(!e.isIE){e.oMC.appendChild(p)}w.appendChild(e.oMC);if(e.isIE){r=e.oMC.appendChild(document.createElement("div"));r.className="sm2-object-box";r.innerHTML=v}e._appendSuccess=true}catch(A){throw new Error(h)}}else{e.oMC.appendChild(p);if(e.isIE){r=e.oMC.appendChild(document.createElement("div"));r.className="sm2-object-box";r.innerHTML=v}e._appendSuccess=true}if(!document.getElementById(e.debugID)&&((!e._hasConsole||!e.useConsole)||(e.useConsole&&e._hasConsole&&!e.consoleOnly))){var n=document.createElement("div");n.id=e.debugID;n.style.display=(e.debugMode?"block":"none");if(e.debugMode){try{w.appendChild(k)}catch(j){throw new Error(h)}}w.appendChild(n)}w=null}};this._writeDebug=function(g,i,h){};this._writeDebug._protected=true;this._wD=this._writeDebug;this._wDAlert=function(g){alert(g)};this._toggleDebug=function(){};this._toggleDebug._protected=true;this._debug=function(){};this._debugTS=function(j,g,h){if(typeof sm2Debugger!="undefined"){try{sm2Debugger.handleEvent(j,g,h)}catch(i){}}};this._debugTS._protected=true;this._mergeObjects=function(h,g){var l={};for(var j in h){if(h.hasOwnProperty(j)){l[j]=h[j]}}var k=(typeof g=="undefined"?e.defaultOptions:g);for(var m in k){if(k.hasOwnProperty(m)&&typeof l[m]=="undefined"){l[m]=k[m]}}return l};this.createMovie=function(g){if(g){e.url=g}e._initMovie()};this.go=this.createMovie;this._initMovie=function(){if(e.o){return false}e.o=e.getMovie(e.id);if(!e.o){e._createMovie(e.id,e.url);e.o=e.getMovie(e.id)}};this.waitForExternalInterface=function(){if(e._waitingForEI){return false}e._waitingForEI=true;if(e._tryInitOnFocus&&!e._isFocused){return false}setTimeout(function(){if(!e._didInit){e._debugTS("flashtojs",false,": Timed out"+(e._overHTTP)?" (Check flash security)":" (No plugin/missing SWF?)")}if(!e._didInit&&e._okToDisable){e._failSafely()}},750)};this.handleFocus=function(){if(e._isFocused||!e._tryInitOnFocus){return true}e._okToDisable=true;e._isFocused=true;if(e._tryInitOnFocus){window.removeEventListener("mousemove",e.handleFocus,false)}e._waitingForEI=false;setTimeout(e.waitForExternalInterface,500);if(window.removeEventListener){window.removeEventListener("focus",e.handleFocus,false)}else{if(window.detachEvent){window.detachEvent("onfocus",e.handleFocus)}}};this.initComplete=function(){if(e._didInit){return false}e._didInit=true;if(e._disabled){e._debugTS("onload",false);e.onerror.apply(window);return false}else{e._debugTS("onload",true)}if(e.waitForWindowLoad&&!e._windowLoaded){if(window.addEventListener){window.addEventListener("load",e.initUserOnload,false)}else{if(window.attachEvent){window.attachEvent("onload",e.initUserOnload)}}return false}else{e.initUserOnload()}};this.initUserOnload=function(){e.onload.apply(window)};this.init=function(){e._initMovie();if(e._didInit){return false}if(window.removeEventListener){window.removeEventListener("load",e.beginDelayedInit,false)}else{if(window.detachEvent){window.detachEvent("onload",e.beginDelayedInit)}}try{e.o._externalInterfaceTest(false);e.setPolling(true);if(!e.debugMode){e.o._disableDebug()}e.enabled=true;e._debugTS("jstoflash",true)}catch(g){e._debugTS("jstoflash",false);e._failSafely();e.initComplete();return false}e.initComplete()};this.beginDelayedInit=function(){e._windowLoaded=true;setTimeout(e.waitForExternalInterface,500);setTimeout(e.beginInit,20)};this.beginInit=function(){if(e._initPending){return false}e.createMovie();e._initMovie();e._initPending=true;return true};this.domContentLoaded=function(){if(document.removeEventListener){document.removeEventListener("DOMContentLoaded",e.domContentLoaded,false)}e.go()};this._externalInterfaceOK=function(){if(e.swfLoaded){return false}e._debugTS("swf",true);e._debugTS("flashtojs",true);e.swfLoaded=true;e._tryInitOnFocus=false;if(e.isIE){setTimeout(e.init,100)}else{e.init()}};this._setSandboxType=function(g){var h=e.sandbox;h.type=g;h.description=h.types[(typeof h.types[g]!="undefined"?g:"unknown")];if(h.type=="localWithFile"){h.noRemote=true;h.noLocal=false}else{if(h.type=="localWithNetwork"){h.noRemote=false;h.noLocal=true}else{if(h.type=="localTrusted"){h.noRemote=false;h.noLocal=false}}}};this.destruct=function(){e.disable(true)};f=function(g){var h=this;this.sID=g.id;this.url=g.url;this.options=e._mergeObjects(g);this.instanceOptions=this.options;this._iO=this.instanceOptions;this.pan=this.options.pan;this.volume=this.options.volume;this._debug=function(){if(e.debugMode){var k=null;var m=[];var j=null;var l=null;var i=64;for(k in h.options){if(h.options[k]!==null){if(h.options[k] instanceof Function){j=h.options[k].toString();j=j.replace(/\s\s+/g," ");l=j.indexOf("{");m[m.length]=" "+k+": {"+j.substr(l+1,(Math.min(Math.max(j.indexOf("\n")-1,i),i))).replace(/\n/g,"")+"... }"}else{m[m.length]=" "+k+": "+h.options[k]}}}}};this._debug();this.id3={};this.resetProperties=function(i){h.bytesLoaded=null;h.bytesTotal=null;h.position=null;h.duration=null;h.durationEstimate=null;h.loaded=false;h.playState=0;h.paused=false;h.readyState=0;h.muted=false;h.didBeforeFinish=false;h.didJustBeforeFinish=false;h.instanceOptions={};h.instanceCount=0;h.peakData={left:0,right:0};h.waveformData=[];h.eqData=[]};h.resetProperties();this.load=function(i){if(typeof i!="undefined"){h._iO=e._mergeObjects(i);h.instanceOptions=h._iO}else{i=h.options;h._iO=i;h.instanceOptions=h._iO}if(typeof h._iO.url=="undefined"){h._iO.url=h.url}if(h._iO.url==h.url&&h.readyState!==0&&h.readyState!=2){return false}h.loaded=false;h.readyState=1;h.playState=0;try{if(e.flashVersion==8){e.o._load(h.sID,h._iO.url,h._iO.stream,h._iO.autoPlay,(h._iO.whileloading?1:0))}else{e.o._load(h.sID,h._iO.url,h._iO.stream?true:false,h._iO.autoPlay?true:false);if(h._iO.isMovieStar&&h._iO.autoLoad&&!h._iO.autoPlay){h.pause()}}}catch(j){e._debugTS("onload",false);e.onerror();e.disable()}};this.unload=function(){if(h.readyState!==0){if(h.readyState!=2){h.setPosition(0,true)}e.o._unload(h.sID,e.nullURL);h.resetProperties()}};this.destruct=function(){e.o._destroySound(h.sID);e.destroySound(h.sID,true)};this.play=function(j){if(!j){j={}}h._iO=e._mergeObjects(j,h._iO);h._iO=e._mergeObjects(h._iO,h.options);h.instanceOptions=h._iO;if(h.playState==1){var i=h._iO.multiShot;if(!i){return false}}if(!h.loaded){if(h.readyState===0){h._iO.stream=true;h._iO.autoPlay=true;h.load(h._iO)}else{if(h.readyState==2){return false}}}if(h.paused){h.resume()}else{h.playState=1;if(!h.instanceCount||e.flashVersion==9){h.instanceCount++}h.position=(typeof h._iO.position!="undefined"&&!isNaN(h._iO.position)?h._iO.position:0);if(h._iO.onplay){h._iO.onplay.apply(h)}h.setVolume(h._iO.volume,true);h.setPan(h._iO.pan,true);e.o._start(h.sID,h._iO.loop||1,(e.flashVersion==9?h.position:h.position/1000))}};this.start=this.play;this.stop=function(i){if(h.playState==1){h.playState=0;h.paused=false;if(h._iO.onstop){h._iO.onstop.apply(h)}e.o._stop(h.sID,i);h.instanceCount=0;h._iO={}}};this.setPosition=function(j,i){if(typeof j=="undefined"){j=0}var k=Math.min(h.duration,Math.max(j,0));h._iO.position=k;e.o._setPosition(h.sID,(e.flashVersion==9?h._iO.position:h._iO.position/1000),(h.paused||!h.playState))};this.pause=function(){if(h.paused||h.playState===0){return false}h.paused=true;e.o._pause(h.sID);if(h._iO.onpause){h._iO.onpause.apply(h)}};this.resume=function(){if(!h.paused||h.playState===0){return false}h.paused=false;e.o._pause(h.sID);if(h._iO.onresume){h._iO.onresume.apply(h)}};this.togglePause=function(){if(!h.playState){h.play({position:(e.flashVersion==9?h.position:h.position/1000)});return false}if(h.paused){h.resume()}else{h.pause()}};this.setPan=function(j,i){if(typeof j=="undefined"){j=0}if(typeof i=="undefined"){i=false}e.o._setPan(h.sID,j);h._iO.pan=j;if(!i){h.pan=j}};this.setVolume=function(i,j){if(typeof i=="undefined"){i=100}if(typeof j=="undefined"){j=false}e.o._setVolume(h.sID,(e.muted&&!h.muted)||h.muted?0:i);h._iO.volume=i;if(!j){h.volume=i}};this.mute=function(){h.muted=true;e.o._setVolume(h.sID,0)};this.unmute=function(){h.muted=false;var i=typeof h._iO.volume!="undefined";e.o._setVolume(h.sID,i?h._iO.volume:h.options.volume,i?false:true)};this._whileloading=function(i,j,k){if(!h._iO.isMovieStar){h.bytesLoaded=i;h.bytesTotal=j;h.duration=Math.floor(k);h.durationEstimate=parseInt((h.bytesTotal/h.bytesLoaded)*h.duration,10);if(h.readyState!=3&&h._iO.whileloading){h._iO.whileloading.apply(h)}}else{h.bytesLoaded=i;h.bytesTotal=j;h.duration=Math.floor(k);h.durationEstimate=h.duration;if(h.readyState!=3&&h._iO.whileloading){h._iO.whileloading.apply(h)}}};this._onid3=function(n,k){var o=[];for(var m=0,l=n.length;m<l;m++){o[n[m]]=k[m]}h.id3=e._mergeObjects(h.id3,o);if(h._iO.onid3){h._iO.onid3.apply(h)}};this._whileplaying=function(j,k,i,l){if(isNaN(j)||j===null){return false}h.position=j;if(h._iO.usePeakData&&typeof k!="undefined"&&k){h.peakData={left:k.leftPeak,right:k.rightPeak}}if(h._iO.useWaveformData&&typeof i!="undefined"&&i){h.waveformData=i}if(h._iO.useEQData&&typeof l!="undefined"&&l){h.eqData=l}if(h.playState==1){if(h._iO.whileplaying){h._iO.whileplaying.apply(h)}if(h.loaded&&h._iO.onbeforefinish&&h._iO.onbeforefinishtime&&!h.didBeforeFinish&&h.duration-h.position<=h._iO.onbeforefinishtime){h._onbeforefinish()}}};this._onload=function(i){i=(i==1?true:false);h.loaded=i;h.readyState=i?3:2;if(h._iO.onload){h._iO.onload.apply(h)}};this._onbeforefinish=function(){if(!h.didBeforeFinish){h.didBeforeFinish=true;if(h._iO.onbeforefinish){h._iO.onbeforefinish.apply(h)}}};this._onjustbeforefinish=function(i){if(!h.didJustBeforeFinish){h.didJustBeforeFinish=true;if(h._iO.onjustbeforefinish){h._iO.onjustbeforefinish.apply(h)}}};this._onfinish=function(){if(h._iO.onbeforefinishcomplete){h._iO.onbeforefinishcomplete.apply(h)}h.didBeforeFinish=false;h.didJustBeforeFinish=false;if(h.instanceCount){h.instanceCount--;if(!h.instanceCount){h.playState=0;h.paused=false;h.instanceCount=0;h.instanceOptions={};if(h._iO.onfinish){h._iO.onfinish.apply(h)}}}else{}};this._onmetadata=function(i){if(!i.width&&!i.height){i.width=320;i.height=240}h.metadata=i;h.width=i.width;h.height=i.height;if(h._iO.onmetadata){h._iO.onmetadata.apply(h)}}};if(window.addEventListener){window.addEventListener("focus",e.handleFocus,false);window.addEventListener("load",e.beginDelayedInit,false);window.addEventListener("unload",e.destruct,false);if(e._tryInitOnFocus){window.addEventListener("mousemove",e.handleFocus,false)}}else{if(window.attachEvent){window.attachEvent("onfocus",e.handleFocus);window.attachEvent("onload",e.beginDelayedInit);window.attachEvent("unload",e.destruct)}else{e._debugTS("onload",false);soundManager.onerror();soundManager.disable()}}if(document.addEventListener){document.addEventListener("DOMContentLoaded",e.domContentLoaded,false)}}soundManager=new SoundManager();
\ No newline at end of file
+var soundManager=null;function SoundManager(b,a){this.flashVersion=8;this.debugMode=true;this.useConsole=true;this.consoleOnly=false;this.waitForWindowLoad=false;this.nullURL="null.mp3";this.allowPolling=true;this.useMovieStar=false;this.bgColor="#ffffff";this.useHighPerformance=false;this.flashLoadTimeout=750;this.wmode=null;this.allowFullScreen=true;this.defaultOptions={autoLoad:false,stream:true,autoPlay:false,onid3:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onstop:null,onfinish:null,onbeforefinish:null,onbeforefinishtime:5000,onbeforefinishcomplete:null,onjustbeforefinish:null,onjustbeforefinishtime:200,multiShot:true,position:null,pan:0,volume:100};this.flash9Options={isMovieStar:null,usePeakData:false,useWaveformData:false,useEQData:false,onbufferchange:null,ondataerror:null};this.movieStarOptions={onmetadata:null,useVideo:false,bufferTime:null};var f=null;var e=this;this.version=null;this.versionNumber="V2.95a.20090501";this.movieURL=null;this.url=null;this.altURL=null;this.swfLoaded=false;this.enabled=false;this.o=null;this.id=(a||"sm2movie");this.oMC=null;this.sounds={};this.soundIDs=[];this.muted=false;this.isFullScreen=false;this.isIE=(navigator.userAgent.match(/MSIE/i));this.isSafari=(navigator.userAgent.match(/safari/i));this.isGecko=(navigator.userAgent.match(/gecko/i));this.debugID="soundmanager-debug";this.specialWmodeCase=false;this._debugOpen=true;this._didAppend=false;this._appendSuccess=false;this._didInit=false;this._disabled=false;this._windowLoaded=false;this._hasConsole=(typeof console!="undefined"&&typeof console.log!="undefined");this._debugLevels=["log","info","warn","error"];this._defaultFlashVersion=8;this._oRemoved=null;this._oRemovedHTML=null;var g=function(h){return document.getElementById(h)};this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};this.netStreamTypes=["aac","flv","mov","mp4","m4v","f4v","m4a","mp4v","3gp","3g2"];this.netStreamPattern=new RegExp("\\.("+this.netStreamTypes.join("|")+")(\\?.*)?$","i");this.filePattern=null;this.features={buffering:false,peakData:false,waveformData:false,eqData:false,movieStar:false};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._setVersionInfo=function(){if(e.flashVersion!=8&&e.flashVersion!=9){alert('soundManager.flashVersion must be 8 or 9. "'+e.flashVersion+'" is invalid. Reverting to '+e._defaultFlashVersion+".");e.flashVersion=e._defaultFlashVersion}e.version=e.versionNumber+(e.flashVersion==9?" (AS3/Flash 9)":" (AS2/Flash 8)");if(e.flashVersion>8){e.defaultOptions=e._mergeObjects(e.defaultOptions,e.flash9Options);e.features.buffering=true}if(e.flashVersion>8&&e.useMovieStar){e.defaultOptions=e._mergeObjects(e.defaultOptions,e.movieStarOptions);e.filePatterns.flash9=new RegExp("\\.(mp3|"+e.netStreamTypes.join("|")+")(\\?.*)?$","i");e.features.movieStar=true}else{e.useMovieStar=false;e.features.movieStar=false}e.filePattern=e.filePatterns[(e.flashVersion!=8?"flash9":"flash8")];e.movieURL=(e.flashVersion==8?"soundmanager2.swf":"soundmanager2_flash9.swf");e.features.peakData=e.features.waveformData=e.features.eqData=(e.flashVersion>8)};this._overHTTP=(document.location?document.location.protocol.match(/http/i):null);this._waitingforEI=false;this._initPending=false;this._tryInitOnFocus=(this.isSafari&&typeof document.hasFocus=="undefined");this._isFocused=(typeof document.hasFocus!="undefined"?document.hasFocus():null);this._okToDisable=!this._tryInitOnFocus;this.useAltURL=!this._overHTTP;var d="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html";this.strings={notReady:"Not loaded yet",appXHTML:"appendChild/innerHTML set failed."};this.supported=function(){return(e._didInit&&!e._disabled)};this.getMovie=function(h){return e.isIE?window[h]:(e.isSafari?g(h)||document[h]:g(h))};this.loadFromXML=function(h){try{e.o._loadFromXML(h)}catch(i){e._failSafely();return true}};this.createSound=function(i){if(arguments.length==2){i={id:arguments[0],url:arguments[1]}}var j=e._mergeObjects(i);var h=j;if(e._idCheck(h.id,true)){return e.sounds[h.id]}if(e.flashVersion>8&&e.useMovieStar){if(h.isMovieStar===null){h.isMovieStar=(h.url.match(e.netStreamPattern)?true:false)}if(h.isMovieStar){}if(h.isMovieStar&&(h.usePeakData||h.useWaveformData||h.useEQData)){h.usePeakData=false;h.useWaveformData=false;h.useEQData=false}}e.sounds[h.id]=new f(h);e.soundIDs[e.soundIDs.length]=h.id;if(e.flashVersion==8){e.o._createSound(h.id,h.onjustbeforefinishtime)}else{e.o._createSound(h.id,h.url,h.onjustbeforefinishtime,h.usePeakData,h.useWaveformData,h.useEQData,h.isMovieStar,(h.isMovieStar?h.useVideo:false),(h.isMovieStar?h.bufferTime:false))}if(h.autoLoad||h.autoPlay){if(e.sounds[h.id]){e.sounds[h.id].load(h)}}if(h.autoPlay){e.sounds[h.id].play()}return e.sounds[h.id]};this.createVideo=function(h){if(arguments.length==2){h={id:arguments[0],url:arguments[1]}}if(e.flashVersion>=9){h.isMovieStar=true;h.useVideo=true}else{return false}if(!e.useMovieStar){}return e.createSound(h)};this.destroySound=function(j,h){if(!e._idCheck(j)){return false}for(var k=0;k<e.soundIDs.length;k++){if(e.soundIDs[k]==j){e.soundIDs.splice(k,1);continue}}e.sounds[j].unload();if(!h){e.sounds[j].destruct()}delete e.sounds[j]};this.destroyVideo=this.destroySound;this.load=function(h,i){if(!e._idCheck(h)){return false}e.sounds[h].load(i)};this.unload=function(h){if(!e._idCheck(h)){return false}e.sounds[h].unload()};this.play=function(h,i){if(!e._idCheck(h)){if(typeof i!="Object"){i={url:i}}if(i&&i.url){i.id=h;e.createSound(i)}else{return false}}e.sounds[h].play(i)};this.start=this.play;this.setPosition=function(h,i){if(!e._idCheck(h)){return false}e.sounds[h].setPosition(i)};this.stop=function(h){if(!e._idCheck(h)){return false}e.sounds[h].stop()};this.stopAll=function(){for(var h in e.sounds){if(e.sounds[h] instanceof f){e.sounds[h].stop()}}};this.pause=function(h){if(!e._idCheck(h)){return false}e.sounds[h].pause()};this.pauseAll=function(){for(var h=e.soundIDs.length;h--;){e.sounds[e.soundIDs[h]].pause()}};this.resume=function(h){if(!e._idCheck(h)){return false}e.sounds[h].resume()};this.resumeAll=function(){for(var h=e.soundIDs.length;h--;){e.sounds[e.soundIDs[h]].resume()}};this.togglePause=function(h){if(!e._idCheck(h)){return false}e.sounds[h].togglePause()};this.setPan=function(h,i){if(!e._idCheck(h)){return false}e.sounds[h].setPan(i)};this.setVolume=function(i,h){if(!e._idCheck(i)){return false}e.sounds[i].setVolume(h)};this.mute=function(h){if(typeof h!="string"){h=null}if(!h){for(var j=e.soundIDs.length;j--;){e.sounds[e.soundIDs[j]].mute()}e.muted=true}else{if(!e._idCheck(h)){return false}e.sounds[h].mute()}};this.muteAll=function(){e.mute()};this.unmute=function(h){if(typeof h!="string"){h=null}if(!h){for(var j=e.soundIDs.length;j--;){e.sounds[e.soundIDs[j]].unmute()}e.muted=false}else{if(!e._idCheck(h)){return false}e.sounds[h].unmute()}};this.unmuteAll=function(){e.unmute()};this.getMemoryUse=function(){if(e.flashVersion==8){return 0}if(e.o){return parseInt(e.o._getMemoryUse(),10)}};this.setPolling=function(h){if(!e.o||!e.allowPolling){return false}e.o._setPolling(h)};this.disable=function(j){if(typeof j=="undefined"){j=false}if(e._disabled){return false}e._disabled=true;for(var h=e.soundIDs.length;h--;){e._disableObject(e.sounds[e.soundIDs[h]])}e.initComplete(j)};this.canPlayURL=function(h){return(h?(h.match(e.filePattern)?true:false):null)};this.getSoundById=function(i,j){if(!i){throw new Error("SoundManager.getSoundById(): sID is null/undefined")}var h=e.sounds[i];if(!h&&!j){}return h};this.onload=function(){soundManager._wD("Warning: soundManager.onload() is undefined.",2)};this.onerror=function(){};this._idCheck=this.getSoundById;this._complain=function(h,i){};var c=function(){return false};c._protected=true;this._disableObject=function(i){for(var h in i){if(typeof i[h]=="function"&&typeof i[h]._protected=="undefined"){i[h]=c}}h=null};this._failSafely=function(h){if(typeof h=="undefined"){h=false}if(!e._disabled||h){e.disable(h)}};this._normalizeMovieURL=function(h){var i=null;if(h){if(h.match(/\.swf(\?.*)?$/i)){i=h.substr(h.toLowerCase().lastIndexOf(".swf?")+4);if(i){return h}}else{if(h.lastIndexOf("/")!=h.length-1){h=h+"/"}}}return(h&&h.lastIndexOf("/")!=-1?h.substr(0,h.lastIndexOf("/")+1):"./")+e.movieURL};this._getDocument=function(){return(document.body?document.body:(document.documentElement?document.documentElement:document.getElementsByTagName("div")[0]))};this._getDocument._protected=true;this._createMovie=function(y,n){if(e._didAppend&&e._appendSuccess){return false}if(window.location.href.indexOf("debug=1")+1){e.debugMode=true}e._didAppend=true;e._setVersionInfo();var w=(n?n:e.url);var r=(e.altURL?e.altURL:w);e.url=e._normalizeMovieURL(e._overHTTP?w:r);n=e.url;var t=null;if(e.useHighPerformance&&e.useMovieStar&&e.defaultOptions.useVideo===true){t="soundManager note: disabling highPerformance, not applicable with movieStar mode + useVideo";e.useHighPerformance=false}e.wmode=(!e.wmode&&e.useHighPerformance&&!e.useMovieStar?"transparent":e.wmode);if(e.wmode!==null&&e.flashLoadTimeout!==0&&!e.useHighPerformance&&!e.isIE&&navigator.platform.match(/win32/i)){e.specialWmodeCase=true;e.wmode=null}if(e.flashVersion==8){e.allowFullScreen=false}var A={name:y,id:y,src:n,width:"100%",height:"100%",quality:"high",allowScriptAccess:"always",bgcolor:e.bgColor,pluginspage:"http://www.macromedia.com/go/getflashplayer",type:"application/x-shockwave-flash",wmode:e.wmode,allowfullscreen:(e.allowFullScreen?"true":"false")};if(!e.wmode){delete A.wmode}var h={id:y,data:n,type:"application/x-shockwave-flash",width:"100%",height:"100%",wmode:e.wmode};var o=null;var B=null;if(e.isIE){o=document.createElement("div");var u='<object id="'+y+'" data="'+n+'" type="application/x-shockwave-flash" width="100%" height="100%"><param name="movie" value="'+n+'" /><param name="AllowScriptAccess" value="always" /><param name="quality" value="high" />'+(e.wmode?'<param name="wmode" value="'+e.wmode+'" /> ':"")+'<param name="bgcolor" value="'+e.bgColor+'" /><param name="allowFullScreen" value="'+(e.allowFullScreen?"true":"false")+'" /><!-- --></object>'}else{o=document.createElement("embed");for(B in A){if(A.hasOwnProperty(B)){o.setAttribute(B,A[B])}}}var j=document.createElement("div");j.id=e.debugID+"-toggle";var k={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};j.appendChild(document.createTextNode("-"));j.onclick=e._toggleDebug;j.title="Toggle SM2 debug console";if(navigator.userAgent.match(/msie 6/i)){j.style.position="absolute";j.style.cursor="hand"}for(B in k){if(k.hasOwnProperty(B)){j.style[B]=k[B]}}var v=e._getDocument();if(v){e.oMC=g("sm2-container")?g("sm2-container"):document.createElement("div");if(!e.oMC.id){e.oMC.id="sm2-container";e.oMC.className="movieContainer";var p=null;var q=null;if(e.useHighPerformance){p={position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px"}}else{p={position:"absolute",width:"1px",height:"1px",top:"-999px",left:"-999px"}}var l=null;for(l in p){if(p.hasOwnProperty(l)){e.oMC.style[l]=p[l]}}try{if(!e.isIE){e.oMC.appendChild(o)}v.appendChild(e.oMC);if(e.isIE){q=e.oMC.appendChild(document.createElement("div"));q.className="sm2-object-box";q.innerHTML=u}e._appendSuccess=true}catch(z){throw new Error(e.strings.appXHTML)}}else{e.oMC.appendChild(o);if(e.isIE){q=e.oMC.appendChild(document.createElement("div"));q.className="sm2-object-box";q.innerHTML=u}e._appendSuccess=true}if(!g(e.debugID)&&((!e._hasConsole||!e.useConsole)||(e.useConsole&&e._hasConsole&&!e.consoleOnly))){var m=document.createElement("div");m.id=e.debugID;m.style.display=(e.debugMode?"block":"none");if(e.debugMode&&!g(j.id)){try{v.appendChild(j)}catch(i){throw new Error(e.strings.appXHTML)}v.appendChild(m)}}v=null}if(t){}};this._writeDebug=function(i,p,k){if(!e.debugMode){return false}if(typeof k!="undefined"&&k){i=i+" | "+new Date().getTime()}if(e._hasConsole&&e.useConsole){var h=e._debugLevels[p];if(typeof console[h]!="undefined"){console[h](i)}else{console.log(i)}if(e.useConsoleOnly){return true}}var n="soundmanager-debug";try{var m=g(n);if(!m){return false}var l=document.createElement("div");if(++e._wdCount%2===0){l.className="sm2-alt"}if(typeof p=="undefined"){p=0}else{p=parseInt(p,10)}l.appendChild(document.createTextNode(i));if(p){if(p>=2){l.style.fontWeight="bold"}if(p==3){l.style.color="#ff3333"}}m.insertBefore(l,m.firstChild)}catch(j){}m=null};this._writeDebug._protected=true;this._wdCount=0;this._wdCount._protected=true;this._wD=this._writeDebug;this._wDAlert=function(h){alert(h)};if(window.location.href.indexOf("debug=alert")+1&&e.debugMode){e._wD=e._wDAlert}this._toggleDebug=function(){var i=g(e.debugID);var h=g(e.debugID+"-toggle");if(!i){return false}if(e._debugOpen){h.innerHTML="+";i.style.display="none"}else{h.innerHTML="-";i.style.display="block"}e._debugOpen=!e._debugOpen};this._toggleDebug._protected=true;this._debug=function(){for(var k=0,h=e.soundIDs.length;k<h;k++){e.sounds[e.soundIDs[k]]._debug()}};this._debugTS=function(k,h,i){if(typeof sm2Debugger!="undefined"){try{sm2Debugger.handleEvent(k,h,i)}catch(j){}}};this._debugTS._protected=true;this._mergeObjects=function(j,h){var m={};for(var k in j){if(j.hasOwnProperty(k)){m[k]=j[k]}}var l=(typeof h=="undefined"?e.defaultOptions:h);for(var n in l){if(l.hasOwnProperty(n)&&typeof m[n]=="undefined"){m[n]=l[n]}}return m};this.createMovie=function(h){if(h){e.url=h}e._initMovie()};this.go=this.createMovie;this._initMovie=function(){if(e.o){return false}e.o=e.getMovie(e.id);if(!e.o){if(!e.oRemoved){e._createMovie(e.id,e.url)}else{if(!e.isIE){e.oMC.appendChild(e.oRemoved)}else{e.oMC.innerHTML=e.oRemovedHTML}e.oRemoved=null;e._didAppend=true}e.o=e.getMovie(e.id)}if(e.o){if(e.flashLoadTimeout>0){}}};this.waitForExternalInterface=function(){if(e._waitingForEI){return false}e._waitingForEI=true;if(e._tryInitOnFocus&&!e._isFocused){return false}if(e.flashLoadTimeout>0){if(!e._didInit){}setTimeout(function(){if(!e._didInit){if(!e._overHTTP){}e._debugTS("flashtojs",false,": Timed out"+(e._overHTTP)?" (Check flash security)":" (No plugin/missing SWF?)")}if(!e._didInit&&e._okToDisable){e._failSafely(true)}},e.flashLoadTimeout)}else{if(!e.didInit){}}};this.handleFocus=function(){if(e._isFocused||!e._tryInitOnFocus){return true}e._okToDisable=true;e._isFocused=true;if(e._tryInitOnFocus){window.removeEventListener("mousemove",e.handleFocus,false)}e._waitingForEI=false;setTimeout(e.waitForExternalInterface,500);if(window.removeEventListener){window.removeEventListener("focus",e.handleFocus,false)}else{if(window.detachEvent){window.detachEvent("onfocus",e.handleFocus)}}};this.initComplete=function(h){if(e._didInit){return false}e._didInit=true;if(e._disabled||h){e._debugTS("onload",false);e.onerror.apply(window);return false}else{e._debugTS("onload",true)}if(e.waitForWindowLoad&&!e._windowLoaded){if(window.addEventListener){window.addEventListener("load",e.initUserOnload,false)}else{if(window.attachEvent){window.attachEvent("onload",e.initUserOnload)}}return false}else{if(e.waitForWindowLoad&&e._windowLoaded){}e.initUserOnload()}};this.initUserOnload=function(){e.onload.apply(window)};this.init=function(){e._initMovie();if(e._didInit){return false}if(window.removeEventListener){window.removeEventListener("load",e.beginDelayedInit,false)}else{if(window.detachEvent){window.detachEvent("onload",e.beginDelayedInit)}}try{e.o._externalInterfaceTest(false);if(!e.allowPolling){}e.setPolling(true);if(!e.debugMode){e.o._disableDebug()}e.enabled=true;e._debugTS("jstoflash",true)}catch(h){e._debugTS("jstoflash",false);e._failSafely(true);e.initComplete();return false}e.initComplete()};this.beginDelayedInit=function(){e._windowLoaded=true;setTimeout(e.waitForExternalInterface,500);setTimeout(e.beginInit,20)};this.beginInit=function(){if(e._initPending){return false}e.createMovie();e._initMovie();e._initPending=true;return true};this.domContentLoaded=function(){if(document.removeEventListener){document.removeEventListener("DOMContentLoaded",e.domContentLoaded,false)}e.go()};this._externalInterfaceOK=function(){if(e.swfLoaded){return false}e._debugTS("swf",true);e._debugTS("flashtojs",true);e.swfLoaded=true;e._tryInitOnFocus=false;if(e.isIE){setTimeout(e.init,100)}else{e.init()}};this._setSandboxType=function(h){var i=e.sandbox;i.type=h;i.description=i.types[(typeof i.types[h]!="undefined"?h:"unknown")];if(i.type=="localWithFile"){i.noRemote=true;i.noLocal=false}else{if(i.type=="localWithNetwork"){i.noRemote=false;i.noLocal=true}else{if(i.type=="localTrusted"){i.noRemote=false;i.noLocal=false}}}};this.reboot=function(){if(e.soundIDs.length){}for(var h=e.soundIDs.length;h--;){e.sounds[e.soundIDs[h]].destruct()}try{if(e.isIE){e.oRemovedHTML=e.o.innerHTML}e.oRemoved=e.o.parentNode.removeChild(e.o)}catch(j){}e.enabled=false;e._didInit=false;e._waitingForEI=false;e._initPending=false;e._didInit=false;e._didAppend=false;e._appendSuccess=false;e._didInit=false;e._disabled=false;e._waitingforEI=true;e.swfLoaded=false;e.soundIDs={};e.sounds=[];e.o=null;window.setTimeout(function(){soundManager.beginDelayedInit()},20)};this.destruct=function(){e.disable(true)};f=function(h){var i=this;this.sID=h.id;this.url=h.url;this.options=e._mergeObjects(h);this.instanceOptions=this.options;this._iO=this.instanceOptions;this.pan=this.options.pan;this.volume=this.options.volume;this._lastURL=null;this._debug=function(){if(e.debugMode){var l=null;var n=[];var k=null;var m=null;var j=64;for(l in i.options){if(i.options[l]!==null){if(i.options[l] instanceof Function){k=i.options[l].toString();k=k.replace(/\s\s+/g," ");m=k.indexOf("{");n[n.length]=" "+l+": {"+k.substr(m+1,(Math.min(Math.max(k.indexOf("\n")-1,j),j))).replace(/\n/g,"")+"... }"}else{n[n.length]=" "+l+": "+i.options[l]}}}}};this._debug();this.id3={};this.resetProperties=function(j){i.bytesLoaded=null;i.bytesTotal=null;i.position=null;i.duration=null;i.durationEstimate=null;i.loaded=false;i.playState=0;i.paused=false;i.readyState=0;i.muted=false;i.didBeforeFinish=false;i.didJustBeforeFinish=false;i.isBuffering=false;i.instanceOptions={};i.instanceCount=0;i.peakData={left:0,right:0};i.waveformData={left:[],right:[]};i.eqData=[]};i.resetProperties();this.load=function(j){if(typeof j!="undefined"){i._iO=e._mergeObjects(j);i.instanceOptions=i._iO}else{j=i.options;i._iO=j;i.instanceOptions=i._iO;if(i._lastURL&&i._lastURL!=i.url){i._iO.url=i.url;i.url=null}}if(typeof i._iO.url=="undefined"){i._iO.url=i.url}if(i._iO.url==i.url&&i.readyState!==0&&i.readyState!=2){return false}i.url=i._iO.url;i._lastURL=i._iO.url;i.loaded=false;i.readyState=1;i.playState=0;try{if(e.flashVersion==8){e.o._load(i.sID,i._iO.url,i._iO.stream,i._iO.autoPlay,(i._iO.whileloading?1:0))}else{e.o._load(i.sID,i._iO.url,i._iO.stream?true:false,i._iO.autoPlay?true:false);if(i._iO.isMovieStar&&i._iO.autoLoad&&!i._iO.autoPlay){i.pause()}}}catch(k){e._debugTS("onload",false);e.onerror();e.disable()}};this.unload=function(){if(i.readyState!==0){if(i.readyState!=2){i.setPosition(0,true)}e.o._unload(i.sID,e.nullURL);i.resetProperties()}};this.destruct=function(){e.o._destroySound(i.sID);e.destroySound(i.sID,true)};this.play=function(k){if(!k){k={}}i._iO=e._mergeObjects(k,i._iO);i._iO=e._mergeObjects(i._iO,i.options);i.instanceOptions=i._iO;if(i.playState==1){var j=i._iO.multiShot;if(!j){return false}else{}}if(!i.loaded){if(i.readyState===0){i._iO.stream=true;i._iO.autoPlay=true;i.load(i._iO)}else{if(i.readyState==2){return false}else{}}}else{}if(i.paused){i.resume()}else{i.playState=1;if(!i.instanceCount||e.flashVersion>8){i.instanceCount++}i.position=(typeof i._iO.position!="undefined"&&!isNaN(i._iO.position)?i._iO.position:0);if(i._iO.onplay){i._iO.onplay.apply(i)}i.setVolume(i._iO.volume,true);i.setPan(i._iO.pan,true);e.o._start(i.sID,i._iO.loop||1,(e.flashVersion==9?i.position:i.position/1000))}};this.start=this.play;this.stop=function(j){if(i.playState==1){i.playState=0;i.paused=false;if(i._iO.onstop){i._iO.onstop.apply(i)}e.o._stop(i.sID,j);i.instanceCount=0;i._iO={}}};this.setPosition=function(k,j){if(typeof k=="undefined"){k=0}var l=Math.min(i.duration,Math.max(k,0));i._iO.position=l;if(!j){}e.o._setPosition(i.sID,(e.flashVersion==9?i._iO.position:i._iO.position/1000),(i.paused||!i.playState))};this.pause=function(){if(i.paused||i.playState===0){return false}i.paused=true;e.o._pause(i.sID);if(i._iO.onpause){i._iO.onpause.apply(i)}};this.resume=function(){if(!i.paused||i.playState===0){return false}i.paused=false;e.o._pause(i.sID);if(i._iO.onresume){i._iO.onresume.apply(i)}};this.togglePause=function(){if(i.playState===0){i.play({position:(e.flashVersion==9?i.position:i.position/1000)});return false}if(i.paused){i.resume()}else{i.pause()}};this.setPan=function(k,j){if(typeof k=="undefined"){k=0}if(typeof j=="undefined"){j=false}e.o._setPan(i.sID,k);i._iO.pan=k;if(!j){i.pan=k}};this.setVolume=function(j,k){if(typeof j=="undefined"){j=100}if(typeof k=="undefined"){k=false}e.o._setVolume(i.sID,(e.muted&&!i.muted)||i.muted?0:j);i._iO.volume=j;if(!k){i.volume=j}};this.mute=function(){i.muted=true;e.o._setVolume(i.sID,0)};this.unmute=function(){i.muted=false;var j=typeof i._iO.volume!="undefined";e.o._setVolume(i.sID,j?i._iO.volume:i.options.volume)};this._whileloading=function(j,k,l){if(!i._iO.isMovieStar){i.bytesLoaded=j;i.bytesTotal=k;i.duration=Math.floor(l);i.durationEstimate=parseInt((i.bytesTotal/i.bytesLoaded)*i.duration,10);if(i.readyState!=3&&i._iO.whileloading){i._iO.whileloading.apply(i)}}else{i.bytesLoaded=j;i.bytesTotal=k;i.duration=Math.floor(l);i.durationEstimate=i.duration;if(i.readyState!=3&&i._iO.whileloading){i._iO.whileloading.apply(i)}}};this._onid3=function(n,k){var o=[];for(var m=0,l=n.length;m<l;m++){o[n[m]]=k[m]}i.id3=e._mergeObjects(i.id3,o);if(i._iO.onid3){i._iO.onid3.apply(i)}};this._whileplaying=function(k,l,n,j,m){if(isNaN(k)||k===null){return false}if(i.playState===0&&k>0){k=0}i.position=k;if(i._iO.usePeakData&&typeof l!="undefined"&&l){i.peakData={left:l.leftPeak,right:l.rightPeak}}if(i._iO.useWaveformData&&typeof n!="undefined"&&n){i.waveformData={left:n.split(","),right:j.split(",")}}if(i._iO.useEQData&&typeof m!="undefined"&&m){i.eqData=m}if(i.playState==1){if(i.isBuffering){i._onbufferchange(0)}if(i._iO.whileplaying){i._iO.whileplaying.apply(i)}if(i.loaded&&i._iO.onbeforefinish&&i._iO.onbeforefinishtime&&!i.didBeforeFinish&&i.duration-i.position<=i._iO.onbeforefinishtime){i._onbeforefinish()}}};this._onload=function(j){j=(j==1?true:false);if(!j){if(e.sandbox.noRemote===true){}if(e.sandbox.noLocal===true){}}i.loaded=j;i.readyState=j?3:2;if(i._iO.onload){i._iO.onload.apply(i)}};this._onbeforefinish=function(){if(!i.didBeforeFinish){i.didBeforeFinish=true;if(i._iO.onbeforefinish){i._iO.onbeforefinish.apply(i)}}};this._onjustbeforefinish=function(j){if(!i.didJustBeforeFinish){i.didJustBeforeFinish=true;if(i._iO.onjustbeforefinish){i._iO.onjustbeforefinish.apply(i)}}};this._onfinish=function(){if(i._iO.onbeforefinishcomplete){i._iO.onbeforefinishcomplete.apply(i)}i.didBeforeFinish=false;i.didJustBeforeFinish=false;if(i.instanceCount){i.instanceCount--;if(!i.instanceCount){i.playState=0;i.paused=false;i.instanceCount=0;i.instanceOptions={};if(i._iO.onfinish){i._iO.onfinish.apply(i)}}}else{if(i.useVideo){}}};this._onmetadata=function(j){if(!j.width&&!j.height){j.width=320;j.height=240}i.metadata=j;i.width=j.width;i.height=j.height;if(i._iO.onmetadata){i._iO.onmetadata.apply(i)}};this._onbufferchange=function(j){if(i.playState===0){return false}if(j==i.isBuffering){return false}i.isBuffering=(j==1?true:false);if(i._iO.onbufferchange){i._iO.onbufferchange.apply(i)}};this._ondataerror=function(j){if(i.playState>0){if(i._iO.ondataerror){i._iO.ondataerror.apply(i)}}else{}}};this._onfullscreenchange=function(h){e.isFullScreen=(h==1?true:false);if(!e.isFullScreen){try{window.focus()}catch(i){}}};if(window.addEventListener){window.addEventListener("focus",e.handleFocus,false);window.addEventListener("load",e.beginDelayedInit,false);window.addEventListener("unload",e.destruct,false);if(e._tryInitOnFocus){window.addEventListener("mousemove",e.handleFocus,false)}}else{if(window.attachEvent){window.attachEvent("onfocus",e.handleFocus);window.attachEvent("onload",e.beginDelayedInit);window.attachEvent("unload",e.destruct)}else{e._debugTS("onload",false);soundManager.onerror();soundManager.disable()}}if(document.addEventListener){document.addEventListener("DOMContentLoaded",e.domContentLoaded,false)}}if(typeof SM2_DEFER=="undefined"||!SM2_DEFER){soundManager=new SoundManager()};\r
index 508d461770d04696ed1872fe7517fd30834ae327..ea545b85b8c84c10121c2e35601de10bb09a3ce7 100644 (file)
@@ -7,7 +7,7 @@
    Code licensed under the BSD License:\r
    http://schillmania.com/projects/soundmanager2/license.txt\r
 \r
-   V2.93a.20090117\r
+   V2.95a.20090501\r
 */\r
 \r
 var soundManager = null;\r
@@ -22,8 +22,11 @@ function SoundManager(smURL,smID) {
   this.nullURL = 'null.mp3';       // path to "null" (empty) MP3 file, used to unload sounds (Flash 8 only)\r
   this.allowPolling = true;        // allow flash to poll for status update (required for "while playing", peak, sound spectrum functions to work.)\r
   this.useMovieStar = false;      // enable support for Flash 9.0r115+ (codename "MovieStar") MPEG4 audio + video formats (AAC, M4V, FLV, MOV etc.)\r
-  this.bgColor = '#ffffff';       // movie (.swf) background color, useful if showing on-screen for video etc.\r
-  this.useHighPerformance = true;  // position:fixed flash movie gives increased js/flash speed, but buggy and disabled for firefox/win32 by default (set value to 'always' to override)\r
+  this.bgColor = '#ffffff';           // movie (.swf) background color, '#000000' useful if showing on-screen/full-screen video etc.\r
+  this.useHighPerformance = false; // position:fixed flash movie gives increased js/flash speed\r
+  this.flashLoadTimeout = 750;     // ms to wait for flash movie to load before failing (0 = infinity)\r
+  this.wmode = null;                      // mode to render the flash movie in - null, transparent, opaque (last two allow layering of HTML on top)\r
+  this.allowFullScreen = true;     // enter full-screen (via double-click on movie) for flash 9+ video\r
 \r
   this.defaultOptions = {\r
     'autoLoad': false,             // enable automatic loading (otherwise .load() will be called on demand with .play(), the latter being nicer on bandwidth - if you want to .load yourself, you also can)\r
@@ -50,25 +53,28 @@ function SoundManager(smURL,smID) {
   };\r
 \r
   this.flash9Options = {           // flash 9-only options, merged into defaultOptions if flash 9 is being used\r
-    'isMovieStar': null,          // "MovieStar" MPEG4 audio/video mode. Null (default) = auto detect MP4, AAC etc. based on URL. true = force on, ignore URL\r
+    'isMovieStar': null,                  // "MovieStar" MPEG4 audio/video mode. Null (default) = auto detect MP4, AAC etc. based on URL. true = force on, ignore URL\r
     'usePeakData': false,          // enable left/right channel peak (level) data\r
     'useWaveformData': false,      // enable sound spectrum (raw waveform data) - WARNING: CPU-INTENSIVE: may set CPUs on fire.\r
-    'useEQData': false             // enable sound EQ (frequency spectrum data) - WARNING: Also CPU-intensive.\r
+    'useEQData': false,            // enable sound EQ (frequency spectrum data) - WARNING: Also CPU-intensive.\r
+    'onbufferchange': null,               // callback for "isBuffering" property change\r
+    'ondataerror': null                           // callback for waveform/eq data access error (flash playing audio in other tabs/domains)\r
   };\r
 \r
   this.movieStarOptions = {        // flash 9.0r115+ MPEG4 audio/video options, merged into defaultOptions if flash 9 + movieStar mode is enabled\r
-    'onmetadata': null,                   // callback for when video width/height etc. are received\r
-    'useVideo': false             // if loading movieStar content, whether to show video\r
+    'onmetadata': null,                           // callback for when video width/height etc. are received\r
+    'useVideo': false,                    // if loading movieStar content, whether to show video\r
+    'bufferTime': null                    // seconds of data to buffer before playback begins (null = flash default of 0.1 seconds - if AAC playback is gappy, try up to 3 seconds)\r
   };\r
 \r
   // jslint global declarations\r
-  /*global sm2Debugger, alert, console, document, navigator, setTimeout, window */\r
+  /*global SM2_DEFER, sm2Debugger, alert, console, document, navigator, setTimeout, window */\r
 \r
   var SMSound = null; // defined later\r
 \r
   var _s = this;\r
   this.version = null;\r
-  this.versionNumber = 'V2.93a.20090117';\r
+  this.versionNumber = 'V2.95a.20090501';\r
   this.movieURL = null;\r
   this.url = null;\r
   this.altURL = null;\r
@@ -80,10 +86,12 @@ function SoundManager(smURL,smID) {
   this.sounds = {};\r
   this.soundIDs = [];\r
   this.muted = false;\r
+  this.isFullScreen = false; // set later by flash 9+\r
   this.isIE = (navigator.userAgent.match(/MSIE/i));\r
   this.isSafari = (navigator.userAgent.match(/safari/i));\r
   this.isGecko = (navigator.userAgent.match(/gecko/i));\r
   this.debugID = 'soundmanager-debug';\r
+  this.specialWmodeCase = false;\r
   this._debugOpen = true;\r
   this._didAppend = false;\r
   this._appendSuccess = false;\r
@@ -93,6 +101,12 @@ function SoundManager(smURL,smID) {
   this._hasConsole = (typeof console != 'undefined' && typeof console.log != 'undefined');\r
   this._debugLevels = ['log','info','warn','error'];\r
   this._defaultFlashVersion = 8;\r
+  this._oRemoved = null;\r
+  this._oRemovedHTML = null;\r
+\r
+  var _$ = function(sID) {\r
+    return document.getElementById(sID);\r
+  };\r
 \r
   this.filePatterns = {\r
        flash8: /\.mp3(\?.*)?$/i,\r
@@ -104,6 +118,7 @@ function SoundManager(smURL,smID) {
 \r
   this.filePattern = null;\r
   this.features = {\r
+       buffering: false,\r
     peakData: false,\r
     waveformData: false,\r
     eqData: false,\r
@@ -132,6 +147,7 @@ function SoundManager(smURL,smID) {
     // set up default options\r
        if (_s.flashVersion > 8) {\r
          _s.defaultOptions = _s._mergeObjects(_s.defaultOptions,_s.flash9Options);\r
+         _s.features.buffering = true;\r
        }\r
     if (_s.flashVersion > 8 && _s.useMovieStar) {\r
       // flash 9+ support for movieStar formats as well as MP3\r
@@ -144,7 +160,7 @@ function SoundManager(smURL,smID) {
     }\r
     _s.filePattern = _s.filePatterns[(_s.flashVersion!=8?'flash9':'flash8')];\r
     _s.movieURL = (_s.flashVersion==8?'soundmanager2.swf':'soundmanager2_flash9.swf');\r
-    _s.features.peakData = _s.features.waveformData = _s.features.eqData = (_s.flashVersion==9);\r
+    _s.features.peakData = _s.features.waveformData = _s.features.eqData = (_s.flashVersion>8);\r
   };\r
 \r
   this._overHTTP = (document.location?document.location.protocol.match(/http/i):null);\r
@@ -158,6 +174,11 @@ function SoundManager(smURL,smID) {
 \r
   var flashCPLink = 'http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html';\r
 \r
+  this.strings = {\r
+    notReady: 'Not loaded yet - wait for soundManager.onload() before calling sound-related methods',\r
+    appXHTML: 'soundManager._createMovie(): appendChild/innerHTML set failed. May be app/xhtml+xml DOM-related.'\r
+  };\r
+\r
   // --- public methods ---\r
   \r
   this.supported = function() {\r
@@ -165,7 +186,7 @@ function SoundManager(smURL,smID) {
   };\r
 \r
   this.getMovie = function(smID) {\r
-    return _s.isIE?window[smID]:(_s.isSafari?document.getElementById(smID)||document[smID]:document.getElementById(smID));\r
+    return _s.isIE?window[smID]:(_s.isSafari?_$(smID)||document[smID]:_$(smID));\r
   };\r
 \r
   this.loadFromXML = function(sXmlUrl) {\r
@@ -179,7 +200,7 @@ function SoundManager(smURL,smID) {
 \r
   this.createSound = function(oOptions) {\r
     if (!_s._didInit) {\r
-         throw new Error('soundManager.createSound(): Not loaded yet - wait for soundManager.onload() before calling sound-related methods');\r
+         throw _s._complain('soundManager.createSound(): '+_s.strings.notReady,arguments.callee.caller);\r
        }\r
     if (arguments.length == 2) {\r
       // function overloading in JS! :) ..assume simple createSound(id,url) use case\r
@@ -212,7 +233,7 @@ function SoundManager(smURL,smID) {
     if (_s.flashVersion == 8) {\r
       _s.o._createSound(_tO.id,_tO.onjustbeforefinishtime);\r
     } else {\r
-      _s.o._createSound(_tO.id,_tO.url,_tO.onjustbeforefinishtime,_tO.usePeakData,_tO.useWaveformData,_tO.useEQData,_tO.isMovieStar,(_tO.isMovieStar?_tO.useVideo:false));\r
+      _s.o._createSound(_tO.id,_tO.url,_tO.onjustbeforefinishtime,_tO.usePeakData,_tO.useWaveformData,_tO.useEQData,_tO.isMovieStar,(_tO.isMovieStar?_tO.useVideo:false),(_tO.isMovieStar?_tO.bufferTime:false));\r
     }\r
     if (_tO.autoLoad || _tO.autoPlay) {\r
       // TODO: does removing timeout here cause problems?\r
@@ -283,6 +304,9 @@ function SoundManager(smURL,smID) {
   };\r
 \r
   this.play = function(sID,oOptions) {\r
+    if (!_s._didInit) {\r
+         throw _s._complain('soundManager.play(): '+_s.strings.notReady,arguments.callee.caller);\r
+       }\r
     if (!_s._idCheck(sID)) {\r
       if (typeof oOptions != 'Object') {\r
                oOptions = {url:oOptions}; // overloading use case: play('mySound','/path/to/some.mp3');\r
@@ -432,22 +456,24 @@ function SoundManager(smURL,smID) {
     if (!_s.o || !_s.allowPolling) {\r
          return false;\r
        }\r
-    // _s._wD('soundManager.setPolling('+bPolling+')');\r
     _s.o._setPolling(bPolling);\r
   };\r
 \r
-  this.disable = function(bUnload) {\r
+  this.disable = function(bNoDisable) {\r
     // destroy all functions\r
+    if (typeof bNoDisable == 'undefined') {\r
+      bNoDisable = false;\r
+    }\r
     if (_s._disabled) {\r
          return false;\r
-       }\r
+    }\r
     _s._disabled = true;\r
-    _s._wD('soundManager.disable(): Disabling all functions - future calls will return false.',1);\r
+    _s._wD('soundManager.disable(): Shutting down',1);\r
     for (var i=_s.soundIDs.length; i--;) {\r
       _s._disableObject(_s.sounds[_s.soundIDs[i]]);\r
     }\r
-    _s.initComplete(); // fire "complete", despite fail\r
-    _s._disableObject(_s);\r
+    _s.initComplete(bNoDisable); // fire "complete", despite fail\r
+    // _s._disableObject(_s); // taken out to allow reboot()\r
   };\r
 \r
   this.canPlayURL = function(sURL) {\r
@@ -469,7 +495,7 @@ function SoundManager(smURL,smID) {
   this.onload = function() {\r
     // window.onload() equivalent for SM2, ready to create sounds etc.\r
     // this is a stub - you can override this in your own external script, eg. soundManager.onload = function() {}\r
-    soundManager._wD('<em>Warning</em>: soundManager.onload() is undefined.',2);\r
+    soundManager._wD('Warning: soundManager.onload() is undefined.',2);\r
   };\r
 \r
   this.onerror = function() {\r
@@ -480,9 +506,37 @@ function SoundManager(smURL,smID) {
 \r
   this._idCheck = this.getSoundById;\r
 \r
+  this._complain = function(sMsg,oCaller) {\r
+    // Try to create meaningful custom errors, w/stack trace to the "offending" line\r
+    var sPre = 'Error: ';\r
+    if (!oCaller) {\r
+      return new Error(sPre+sMsg);\r
+    }\r
+    var e = new Error(''); // make a mistake.\r
+    var stackMsg = null;\r
+    if (e.stack) {\r
+      // potentially dangerous: Try to return a meaningful stacktrace where provided (Mozilla)\r
+         try {\r
+           var splitChar = '@';\r
+           var stackTmp = e.stack.split(splitChar);\r
+           stackMsg = stackTmp[4]; // try to return only the relevant bit, skipping internal SM2 shiz\r
+         } catch(ee) {\r
+           // oops.\r
+           stackMsg = e.stack;\r
+         }\r
+       }\r
+       if (typeof console != 'undefined' && typeof console.trace != 'undefined') {\r
+         console.trace();\r
+       }\r
+       var errorDesc = sPre+sMsg+'. \nCaller: '+oCaller.toString()+(e.stack?' \nTop of stacktrace: '+stackMsg:(e.message?' \nMessage: '+e.message:''));\r
+       // See JS error/debug/console output for real error source, stack trace / message detail where possible.\r
+       return new Error(errorDesc);\r
+  };\r
+\r
   var _doNothing = function() {\r
     return false;\r
   };\r
+\r
   _doNothing._protected = true;\r
 \r
   this._disableObject = function(o) {\r
@@ -494,11 +548,14 @@ function SoundManager(smURL,smID) {
     oProp = null;\r
   };\r
 \r
-  this._failSafely = function() {\r
-    // exception handler for "object doesn't support this property or method" or general failure\r
-    if (!_s._disabled) {\r
+  this._failSafely = function(bNoDisable) {\r
+    // general failure exception handler\r
+    if (typeof bNoDisable == 'undefined') {\r
+      bNoDisable = false;\r
+    }\r
+    if (!_s._disabled || bNoDisable) {\r
       _s._wD('soundManager: Failed to initialise.',2);\r
-      _s.disable();\r
+      _s.disable(bNoDisable);\r
     }\r
   };\r
   \r
@@ -540,15 +597,25 @@ function SoundManager(smURL,smID) {
     smURL = _s.url;\r
 \r
     var specialCase = null;\r
-    if (_s.useHighPerformance && _s.useHighPerformance != 'always' && navigator.platform.match(/win32/i) && navigator.userAgent.match(/firefox/i)) {\r
-      specialCase = 'Note: disabling highPerformance, known issues with this browser/OS combo.';\r
+\r
+    if (_s.useHighPerformance && _s.useMovieStar && _s.defaultOptions.useVideo === true) {\r
+      specialCase = 'soundManager note: disabling highPerformance, not applicable with movieStar mode + useVideo';\r
       _s.useHighPerformance = false;\r
     }\r
 \r
-    if (_s.useHighPerformance && _s.useMovieStar) {\r
-         specialCase = 'Note: disabling highPerformance, not applicable with movieStar mode on';\r
-         _s.useHighPerformance = false;\r
-       }\r
+    _s.wmode = (!_s.wmode && _s.useHighPerformance && !_s.useMovieStar?'transparent':_s.wmode);\r
+\r
+    if (_s.wmode !== null && _s.flashLoadTimeout !== 0 && !_s.useHighPerformance && !_s.isIE && navigator.platform.match(/win32/i)) {\r
+         _s.specialWmodeCase = true;\r
+      // extra-special case: movie doesn't load until scrolled into view when using wmode = anything but 'window' here\r
+      // does not apply when using high performance (position:fixed means on-screen), OR infinite flash load timeout\r
+      _s._wD('soundManager note: Removing wmode, preventing off-screen SWF loading issue');\r
+      _s.wmode = null;\r
+    }\r
+\r
+    if (_s.flashVersion == 8) {\r
+      _s.allowFullScreen = false;\r
+    }\r
 \r
     var oEmbed = {\r
       name: smID,\r
@@ -560,42 +627,37 @@ function SoundManager(smURL,smID) {
       allowScriptAccess: 'always',\r
       bgcolor: _s.bgColor,\r
       pluginspage: 'http://www.macromedia.com/go/getflashplayer',\r
-      type: 'application/x-shockwave-flash'\r
+      type: 'application/x-shockwave-flash',\r
+      wmode: _s.wmode,\r
+      allowfullscreen: (_s.allowFullScreen?'true':'false')\r
     };\r
 \r
+    if (!_s.wmode) {\r
+         delete oEmbed.wmode; // don't write empty attribute\r
+    }\r
+\r
     var oObject = {\r
       id: smID,\r
       data: smURL,\r
       type: 'application/x-shockwave-flash',\r
       width: '100%',\r
-      height: '100%'\r
-    };\r
-\r
-    var oObjectParams = {\r
-      movie: smURL,\r
-      AllowScriptAccess: 'always',\r
-      quality: 'high',\r
-      bgcolor: _s.bgColor\r
+      height: '100%',\r
+      wmode: _s.wmode\r
     };\r
 \r
-    if (_s.useHighPerformance && !_s.useMovieStar) {\r
-      oEmbed.wmode = 'transparent';\r
-      oObjectParams.wmode = 'transparent';\r
-    }\r
-\r
     var oMovie = null;\r
     var tmp = null;\r
 \r
     if (_s.isIE) {\r
       // IE is "special".\r
       oMovie = document.createElement('div');\r
-      var movieHTML = '<object id="'+smID+'" data="'+smURL+'" type="application/x-shockwave-flash" width="100%" height="100%"><param name="movie" value="'+smURL+'" /><param name="AllowScriptAccess" value="always" /><param name="quality" value="high" />'+(_s.useHighPerformance && !_s.useMovieStar?'<param name="wmode" value="transparent" /> ':'')+'<param name="bgcolor" value="'+_s.bgColor+'" /><!-- --></object>';\r
+      var movieHTML = '<object id="'+smID+'" data="'+smURL+'" type="application/x-shockwave-flash" width="100%" height="100%"><param name="movie" value="'+smURL+'" /><param name="AllowScriptAccess" value="always" /><param name="quality" value="high" />'+(_s.wmode?'<param name="wmode" value="'+_s.wmode+'" /> ':'')+'<param name="bgcolor" value="'+_s.bgColor+'" /><param name="allowFullScreen" value="'+(_s.allowFullScreen?'true':'false')+'" /><!-- --></object>';\r
     } else {\r
       oMovie = document.createElement('embed');\r
       for (tmp in oEmbed) {\r
            if (oEmbed.hasOwnProperty(tmp)) {\r
           oMovie.setAttribute(tmp,oEmbed[tmp]);\r
-               }\r
+           }\r
       }\r
     }\r
 \r
@@ -627,18 +689,16 @@ function SoundManager(smURL,smID) {
     }\r
 \r
     for (tmp in oToggle) {\r
-         if (oToggle.hasOwnProperty(tmp)) {\r
-        oD.style[tmp] = oToggle[tmp];\r
-         }\r
+       if (oToggle.hasOwnProperty(tmp)) {\r
+          oD.style[tmp] = oToggle[tmp];\r
+       }\r
     }\r
 \r
-    var appXHTML = 'soundManager._createMovie(): appendChild/innerHTML set failed. May be app/xhtml+xml DOM-related.';\r
-\r
     var oTarget = _s._getDocument();\r
 \r
     if (oTarget) {\r
        \r
-      _s.oMC = document.getElementById('sm2-container')?document.getElementById('sm2-container'):document.createElement('div');\r
+      _s.oMC = _$('sm2-container')?_$('sm2-container'):document.createElement('div');\r
 \r
       if (!_s.oMC.id) {\r
         _s.oMC.id = 'sm2-container';\r
@@ -652,16 +712,16 @@ function SoundManager(smURL,smID) {
                    width: '8px',\r
             height: '8px', // must be at least 6px for flash to run fast. odd? yes.\r
             bottom: '0px',\r
-            left: '0px',\r
-               zIndex:-1 // sit behind everything else\r
+            left: '0px'\r
+           // zIndex:-1 // sit behind everything else - potentially dangerous/buggy?\r
           };\r
         } else {\r
           s = {\r
             position: 'absolute',\r
-                   width: '1px',\r
+           width: '1px',\r
             height: '1px',\r
-            bottom: '0px',\r
-            left: '0px'\r
+            top: '-999px',\r
+            left: '-999px'\r
           };\r
         }\r
         var x = null;\r
@@ -682,7 +742,7 @@ function SoundManager(smURL,smID) {
           }\r
           _s._appendSuccess = true;\r
         } catch(e) {\r
-          throw new Error(appXHTML);\r
+          throw new Error(_s.strings.appXHTML);\r
         }\r
       } else {\r
         // it's already in the document.\r
@@ -695,18 +755,18 @@ function SoundManager(smURL,smID) {
         _s._appendSuccess = true;\r
       }\r
 \r
-      if (!document.getElementById(_s.debugID) && ((!_s._hasConsole||!_s.useConsole)||(_s.useConsole && _s._hasConsole && !_s.consoleOnly))) {\r
+      if (!_$(_s.debugID) && ((!_s._hasConsole||!_s.useConsole)||(_s.useConsole && _s._hasConsole && !_s.consoleOnly))) {\r
         var oDebug = document.createElement('div');\r
         oDebug.id = _s.debugID;\r
         oDebug.style.display = (_s.debugMode?'block':'none');\r
-        if (_s.debugMode) {\r
+        if (_s.debugMode && !_$(oD.id)) {\r
           try {\r
             oTarget.appendChild(oD);\r
           } catch(e2) {\r
-            throw new Error(appXHTML);\r
+            throw new Error(_s.strings.appXHTML);\r
           }\r
+          oTarget.appendChild(oDebug);\r
         }\r
-        oTarget.appendChild(oDebug);\r
       }\r
       oTarget = null;\r
     }\r
@@ -715,8 +775,8 @@ function SoundManager(smURL,smID) {
       _s._wD(specialCase);\r
     }\r
 \r
-    _s._wD('-- SoundManager 2 '+_s.version+(_s.useMovieStar?', MovieStar mode':'')+(_s.useHighPerformance?', high performance mode':'')+' --',1);\r
-    _s._wD('soundManager._createMovie(): Trying to load '+smURL+(!_s._overHTTP && _s.altURL?'(alternate URL)':''),1);\r
+    _s._wD('-- SoundManager 2 '+_s.version+(_s.useMovieStar?', MovieStar mode':'')+(_s.useHighPerformance?', high performance mode':'')+(_s.wmode?', wmode: '+_s.wmode:'')+' --',1);\r
+    _s._wD('soundManager._createMovie(): Trying to load '+smURL+(!_s._overHTTP && _s.altURL?' (alternate URL)':''),1);\r
   };\r
 \r
   // aliased to this._wD()\r
@@ -730,21 +790,24 @@ function SoundManager(smURL,smID) {
     if (_s._hasConsole && _s.useConsole) {\r
       var sMethod = _s._debugLevels[sType];\r
       if (typeof console[sMethod] != 'undefined') {\r
-        console[sMethod].apply(console,[sText]); // apply() fix for firebug 1.3, so "this" == console\r
+           console[sMethod](sText);\r
       } else {\r
         console.log(sText);\r
       }\r
       if (_s.useConsoleOnly) {\r
-           return true;\r
-         }\r
+       return true;\r
+      }\r
     }\r
     var sDID = 'soundmanager-debug';\r
     try {\r
-      var o = document.getElementById(sDID);\r
+      var o = _$(sDID);\r
       if (!o) {\r
                return false;\r
          }\r
       var oItem = document.createElement('div');\r
+      if (++_s._wdCount%2===0) {\r
+           oItem.className = 'sm2-alt';\r
+      }\r
       // sText = sText.replace(/\n/g,'<br />');\r
       if (typeof sType == 'undefined') {\r
         sType = 0;\r
@@ -768,6 +831,8 @@ function SoundManager(smURL,smID) {
     o = null;\r
   };\r
   this._writeDebug._protected = true;\r
+  this._wdCount = 0;\r
+  this._wdCount._protected = true;\r
   this._wD = this._writeDebug;\r
 \r
   this._wDAlert = function(sText) { alert(sText); };\r
@@ -777,8 +842,8 @@ function SoundManager(smURL,smID) {
   }\r
 \r
   this._toggleDebug = function() {\r
-    var o = document.getElementById(_s.debugID);\r
-    var oT = document.getElementById(_s.debugID+'-toggle');\r
+    var o = _$(_s.debugID);\r
+    var oT = _$(_s.debugID+'-toggle');\r
     if (!o) {\r
          return false;\r
        }\r
@@ -844,17 +909,30 @@ function SoundManager(smURL,smID) {
   this._initMovie = function() {\r
     // attempt to get, or create, movie\r
     if (_s.o) {\r
-         return false; // pre-init may have fired this function before window.onload(), may already exist\r
-       }\r
-    _s.o = _s.getMovie(_s.id); // try to get flash movie (inline markup)\r
+         return false; // may already exist\r
+    }\r
+    _s.o = _s.getMovie(_s.id); // (inline markup)\r
     if (!_s.o) {\r
-      // try to create\r
-      _s._createMovie(_s.id,_s.url);\r
+      if (!_s.oRemoved) {\r
+        // try to create\r
+        _s._createMovie(_s.id,_s.url);\r
+      } else {\r
+        // try to re-append removed movie after reboot()\r
+        if (!_s.isIE) {\r
+          _s.oMC.appendChild(_s.oRemoved);\r
+        } else {\r
+          _s.oMC.innerHTML = _s.oRemovedHTML;\r
+        }\r
+        _s.oRemoved = null;\r
+        _s._didAppend = true;\r
+      }\r
       _s.o = _s.getMovie(_s.id);\r
     }\r
     if (_s.o) {\r
       _s._wD('soundManager._initMovie(): Got '+_s.o.nodeName+' element ('+(_s._didAppend?'created via JS':'static HTML')+')',1);\r
-      _s._wD('soundManager._initMovie(): Waiting for ExternalInterface call from Flash..');\r
+      if (_s.flashLoadTimeout>0) {\r
+        _s._wD('soundManager._initMovie(): Waiting for ExternalInterface call from Flash..');\r
+      }\r
     }\r
   };\r
 \r
@@ -864,25 +942,29 @@ function SoundManager(smURL,smID) {
        }\r
     _s._waitingForEI = true;\r
     if (_s._tryInitOnFocus && !_s._isFocused) {\r
-      _s._wD('soundManager: Special case: Flash may not have started due to non-focused tab (Safari is lame), and/or focus cannot be detected. Waiting for focus-related event..');\r
+      _s._wD('soundManager: Special case: Waiting for focus-related event..');\r
       return false;\r
     }\r
-    if (!_s._didInit) {\r
-      _s._wD('soundManager: Getting impatient, still waiting for Flash.. ;)');\r
-    }\r
-    setTimeout(function() {\r
+    if (_s.flashLoadTimeout>0) {\r
       if (!_s._didInit) {\r
-        _s._wD('soundManager: No Flash response within reasonable time after document load.\nPossible causes: Flash version under 8, no support, or Flash security denying JS-Flash communication.',2);\r
-        if (!_s._overHTTP) {\r
+        _s._wD('soundManager: Getting impatient, still waiting for Flash.. ;)');\r
+      }\r
+      setTimeout(function() {\r
+        if (!_s._didInit) {\r
+          _s._wD('soundManager: No Flash response within reasonable time after document load.\nPossible causes: Loading '+_s.movieURL+' failed, Flash version under '+_s.flashVersion+', no support, flash blocked or JS-Flash security error.',2);\r
+          if (!_s._overHTTP) {\r
           _s._wD('soundManager: Loading this page from local/network file system (not over HTTP?) Flash security likely restricting JS-Flash access. Consider adding current URL to "trusted locations" in the Flash player security settings manager at '+flashCPLink+', or simply serve this content over HTTP.',2);\r
         }\r
         _s._debugTS('flashtojs',false,': Timed out'+(_s._overHTTP)?' (Check flash security)':' (No plugin/missing SWF?)');\r
       }\r
       // if still not initialized and no other options, give up\r
       if (!_s._didInit && _s._okToDisable) {\r
-               _s._failSafely();\r
-         }\r
-    },750);\r
+       _s._failSafely(true); // don't disable, for reboot()\r
+      }\r
+    },_s.flashLoadTimeout);\r
+    } else if (!_s.didInit) {\r
+      _s._wD('soundManager: Waiting indefinitely for Flash...');\r
+    }\r
   };\r
 \r
   this.handleFocus = function() {\r
@@ -907,13 +989,13 @@ function SoundManager(smURL,smID) {
     }\r
   };\r
 \r
-  this.initComplete = function() {\r
+  this.initComplete = function(bNoDisable) {\r
     if (_s._didInit) {\r
          return false;\r
        }\r
     _s._didInit = true;\r
     _s._wD('-- SoundManager 2 '+(_s._disabled?'failed to load':'loaded')+' ('+(_s._disabled?'security/load error':'OK')+') --',1);\r
-    if (_s._disabled) {\r
+    if (_s._disabled || bNoDisable) {\r
       _s._wD('soundManager.initComplete(): calling soundManager.onerror()',1);\r
       _s._debugTS('onload',false);\r
       _s.onerror.apply(window);\r
@@ -973,7 +1055,7 @@ function SoundManager(smURL,smID) {
       _s._debugTS('jstoflash',true);\r
     } catch(e) {\r
          _s._debugTS('jstoflash',false);\r
-      _s._failSafely();\r
+      _s._failSafely(true); // don't disable, for reboot()\r
       _s.initComplete();\r
       return false;\r
     }\r
@@ -981,7 +1063,7 @@ function SoundManager(smURL,smID) {
   };\r
 \r
   this.beginDelayedInit = function() {\r
-    _s._wD('soundManager.beginDelayedInit(): Document loaded');\r
+    _s._wD('soundManager.beginDelayedInit()');\r
     _s._windowLoaded = true;\r
     setTimeout(_s.waitForExternalInterface,500);\r
     setTimeout(_s.beginInit,20);\r
@@ -1015,12 +1097,14 @@ function SoundManager(smURL,smID) {
     _s._debugTS('flashtojs',true);\r
     _s.swfLoaded = true;\r
     _s._tryInitOnFocus = false;\r
+\r
     if (_s.isIE) {\r
       // IE needs a timeout OR delay until window.onload - may need TODO: investigating\r
       setTimeout(_s.init,100);\r
     } else {\r
       _s.init();\r
     }\r
+\r
   };\r
 \r
   this._setSandboxType = function(sandboxType) {\r
@@ -1041,6 +1125,46 @@ function SoundManager(smURL,smID) {
     }\r
   };\r
 \r
+  this.reboot = function() {\r
+    // attempt to reset and init SM2\r
+    _s._wD('soundManager.reboot()');\r
+    if (_s.soundIDs.length) {\r
+      _s._wD('Destroying '+_s.soundIDs.length+' SMSound objects...');\r
+    }\r
+    for (var i=_s.soundIDs.length; i--;) {\r
+      _s.sounds[_s.soundIDs[i]].destruct();\r
+    }\r
+    // trash ze flash\r
+    try {\r
+      if (_s.isIE) {\r
+        _s.oRemovedHTML = _s.o.innerHTML;\r
+      }\r
+      _s.oRemoved = _s.o.parentNode.removeChild(_s.o);\r
+      _s._wD('Flash movie removed.');\r
+    } catch(e) {\r
+      // uh-oh.\r
+      _s._wD('Warning: Failed to remove flash movie.',2);\r
+    }\r
+    _s.enabled = false;\r
+    _s._didInit = false;\r
+    _s._waitingForEI = false;\r
+    _s._initPending = false;\r
+    _s._didInit = false;\r
+    _s._didAppend = false;\r
+    _s._appendSuccess = false;\r
+    _s._didInit = false;\r
+    _s._disabled = false;\r
+    _s._waitingforEI = true;\r
+    _s.swfLoaded = false;\r
+    _s.soundIDs = {};\r
+    _s.sounds = [];\r
+    _s.o = null;\r
+    _s._wD('soundManager: Rebooting...');\r
+    window.setTimeout(function() {\r
+      soundManager.beginDelayedInit();\r
+    },20);\r
+  };\r
+\r
   this.destruct = function() {\r
     _s._wD('soundManager.destruct()');\r
     _s.disable(true);\r
@@ -1060,6 +1184,8 @@ function SoundManager(smURL,smID) {
   this.pan = this.options.pan;\r
   this.volume = this.options.volume;\r
 \r
+  this._lastURL = null;\r
+\r
   this._debug = function() {\r
     if (_s.debugMode) {\r
     var stuff = null;\r
@@ -1107,13 +1233,17 @@ function SoundManager(smURL,smID) {
     _t.muted = false;\r
     _t.didBeforeFinish = false;\r
     _t.didJustBeforeFinish = false;\r
+    _t.isBuffering = false;\r
     _t.instanceOptions = {};\r
     _t.instanceCount = 0;\r
     _t.peakData = {\r
       left: 0,\r
       right: 0\r
     };\r
-    _t.waveformData = [];\r
+    _t.waveformData = {\r
+         left: [],\r
+         right: []\r
+    };\r
     _t.eqData = [];\r
   };\r
 \r
@@ -1129,15 +1259,27 @@ function SoundManager(smURL,smID) {
       oOptions = _t.options;\r
       _t._iO = oOptions;\r
       _t.instanceOptions = _t._iO;\r
+\r
+      // console.log('typeof oOptions: '+(typeof oOptions)+', lastURL: '+_t._lastURL+', _t.url: '+_t.url);\r
+\r
+      if (_t._lastURL && _t._lastURL != _t.url) {\r
+        _s._wD('SMSound.load(): Using manually-assigned URL');\r
+        _t._iO.url = _t.url;\r
+        _t.url = null;\r
+      }\r
     } \r
+\r
     if (typeof _t._iO.url == 'undefined') {\r
       _t._iO.url = _t.url;\r
     }\r
+\r
     _s._wD('soundManager.load(): '+_t._iO.url,1);\r
     if (_t._iO.url == _t.url && _t.readyState !== 0 && _t.readyState != 2) {\r
       _s._wD('soundManager.load(): current URL already assigned.',1);\r
       return false;\r
     }\r
+    _t.url = _t._iO.url;\r
+    _t._lastURL = _t._iO.url;\r
     _t.loaded = false;\r
     _t.readyState = 1;\r
     _t.playState = 0; // (oOptions.autoPlay?1:0); // if autoPlay, assume "playing" is true (no way to detect when it actually starts in Flash unless onPlay is watched?)\r
@@ -1219,7 +1361,7 @@ function SoundManager(smURL,smID) {
       _t.resume();\r
     } else {\r
       _t.playState = 1;\r
-      if (!_t.instanceCount || _s.flashVersion == 9) {\r
+      if (!_t.instanceCount || _s.flashVersion > 8) {\r
                _t.instanceCount++;\r
          }\r
       _t.position = (typeof _t._iO.position != 'undefined' && !isNaN(_t._iO.position)?_t._iO.position:0);\r
@@ -1256,7 +1398,7 @@ function SoundManager(smURL,smID) {
     var offset = Math.min(_t.duration,Math.max(nMsecOffset,0)); // position >= 0 and <= current available (loaded) duration\r
     _t._iO.position = offset;\r
     if (!bNoDebug) {\r
-      _s._wD('SMSound.setPosition('+nMsecOffset+')'+(nMsecOffset != offset?', corrected value: '+offset:''));\r
+      // _s._wD('SMSound.setPosition('+nMsecOffset+')'+(nMsecOffset != offset?', corrected value: '+offset:''));\r
     }\r
     _s.o._setPosition(_t.sID,(_s.flashVersion==9?_t._iO.position:_t._iO.position/1000),(_t.paused||!_t.playState)); // if paused or not playing, will not resume (by playing)\r
   };\r
@@ -1287,7 +1429,7 @@ function SoundManager(smURL,smID) {
 \r
   this.togglePause = function() {\r
     _s._wD('SMSound.togglePause()');\r
-    if (!_t.playState) {\r
+    if (_t.playState === 0) {\r
       _t.play({position:(_s.flashVersion==9?_t.position:_t.position/1000)});\r
       return false;\r
     }\r
@@ -1334,7 +1476,7 @@ function SoundManager(smURL,smID) {
   this.unmute = function() {\r
     _t.muted = false;\r
     var hasIO = typeof _t._iO.volume != 'undefined';\r
-    _s.o._setVolume(_t.sID,hasIO?_t._iO.volume:_t.options.volume,hasIO?false:true);\r
+    _s.o._setVolume(_t.sID,hasIO?_t._iO.volume:_t.options.volume);\r
   };\r
 \r
   // --- "private" methods called by Flash ---\r
@@ -1344,7 +1486,7 @@ function SoundManager(smURL,smID) {
       _t.bytesLoaded = nBytesLoaded;\r
       _t.bytesTotal = nBytesTotal;\r
       _t.duration = Math.floor(nDuration);\r
-      _t.durationEstimate = parseInt((_t.bytesTotal/_t.bytesLoaded)*_t.duration,10); // estimate total time (will only be accurate with CBR MP3s.)\r
+      _t.durationEstimate = parseInt((_t.bytesTotal/_t.bytesLoaded)*_t.duration,10);\r
       if (_t.readyState != 3 && _t._iO.whileloading) {\r
        _t._iO.whileloading.apply(_t);\r
       }\r
@@ -1374,10 +1516,17 @@ function SoundManager(smURL,smID) {
     }\r
   };\r
 \r
-  this._whileplaying = function(nPosition,oPeakData,oWaveformData,oEQData) {\r
+  this._whileplaying = function(nPosition,oPeakData,oWaveformDataLeft,oWaveformDataRight,oEQData) {\r
+\r
     if (isNaN(nPosition) || nPosition === null) {\r
       return false; // Flash may return NaN at times\r
     }\r
+    if (_t.playState === 0 && nPosition > 0) {\r
+      // can happen at the end of a video where nPosition == 33 for some reason, after finishing.???\r
+      // can also happen with a normal stop operation. This resets the position to 0.\r
+      // _s._writeDebug('Note: Not playing, but position = '+nPosition);\r
+      nPosition = 0;   \r
+    }\r
     _t.position = nPosition;\r
        if (_t._iO.usePeakData && typeof oPeakData != 'undefined' && oPeakData) {\r
          _t.peakData = {\r
@@ -1385,21 +1534,22 @@ function SoundManager(smURL,smID) {
           right: oPeakData.rightPeak\r
          };\r
        }\r
-       if (_t._iO.useWaveformData && typeof oWaveformData != 'undefined' && oWaveformData) {\r
-         _t.waveformData = oWaveformData;\r
-         /*\r
-         _t.spectrumData = {\r
-          left: oSpectrumData.left.split(','),\r
-          right: oSpectrumData.right.split(',')\r
-         }\r
-         */\r
+       if (_t._iO.useWaveformData && typeof oWaveformDataLeft != 'undefined' && oWaveformDataLeft) {\r
+         _t.waveformData = {\r
+          left: oWaveformDataLeft.split(','),\r
+          right: oWaveformDataRight.split(',')\r
+         };\r
        }\r
        if (_t._iO.useEQData && typeof oEQData != 'undefined' && oEQData) {\r
          _t.eqData = oEQData;\r
        }\r
     if (_t.playState == 1) {\r
+         // special case/hack: ensure buffering is false (instant load from cache, thus buffering stuck at 1?)\r
+         if (_t.isBuffering) {\r
+               _t._onbufferchange(0);\r
+         }\r
       if (_t._iO.whileplaying) {\r
-       _t._iO.whileplaying.apply(_t); // flash may call after actual finish\r
+           _t._iO.whileplaying.apply(_t); // flash may call after actual finish\r
       }\r
       if (_t.loaded && _t._iO.onbeforefinish && _t._iO.onbeforefinishtime && !_t.didBeforeFinish && _t.duration-_t.position <= _t._iO.onbeforefinishtime) {\r
         _s._wD('duration-position &lt;= onbeforefinishtime: '+_t.duration+' - '+_t.position+' &lt= '+_t._iO.onbeforefinishtime+' ('+(_t.duration-_t.position)+')');\r
@@ -1410,7 +1560,7 @@ function SoundManager(smURL,smID) {
 \r
   this._onload = function(bSuccess) {\r
     bSuccess = (bSuccess==1?true:false);\r
-    _s._wD('SMSound._onload(): "'+_t.sID+'"'+(bSuccess?' loaded.':' failed to load? - '+_t.url));\r
+    _s._wD('SMSound._onload(): "'+_t.sID+'"'+(bSuccess?' loaded.':' failed to load? - '+_t.url),(bSuccess?1:2));\r
     if (!bSuccess) {\r
       if (_s.sandbox.noRemote === true) {\r
         _s._wD('SMSound._onload(): Reminder: Flash security is denying network/internet access',1);\r
@@ -1452,7 +1602,6 @@ function SoundManager(smURL,smID) {
 \r
     // TODO: calling user-defined onfinish() should happen after setPosition(0)\r
     // OR: onfinish() and then setPosition(0) is bad.\r
-\r
     if (_t._iO.onbeforefinishcomplete) {\r
       _t._iO.onbeforefinishcomplete.apply(_t);\r
     }\r
@@ -1474,8 +1623,14 @@ function SoundManager(smURL,smID) {
         }\r
       }\r
     } else {\r
+         if (_t.useVideo) {\r
+           // video has finished\r
+           // may need to reset position for next play call, "rewind"\r
+           // _t.setPosition(0);\r
+         }\r
       // _t.setPosition(0);\r
     }\r
+\r
   };\r
 \r
   this._onmetadata = function(oMetaData) {\r
@@ -1498,8 +1653,51 @@ function SoundManager(smURL,smID) {
     _s._wD('SMSound.onmetadata() complete');\r
   };\r
 \r
+  this._onbufferchange = function(bIsBuffering) {\r
+    if (_t.playState === 0) {\r
+      // ignore if not playing\r
+      return false;\r
+    }\r
+    if (bIsBuffering == _t.isBuffering) {\r
+      // ignore initial "false" default, if matching\r
+         _s._wD('_onbufferchange: ignoring false default / loaded sound');\r
+      return false;\r
+    }\r
+    _t.isBuffering = (bIsBuffering==1?true:false);\r
+    if (_t._iO.onbufferchange) {\r
+      _s._wD('SMSound._onbufferchange(): '+bIsBuffering);\r
+      _t._iO.onbufferchange.apply(_t);\r
+    }\r
+  };\r
+\r
+  this._ondataerror = function(sError) {\r
+       // flash 9 wave/eq data handler\r
+       if (_t.playState > 0) { // hack: called at start, and end from flash at/after onfinish().\r
+         _s._wD('SMSound._ondataerror(): '+sError);\r
+         if (_t._iO.ondataerror) {\r
+           _t._iO.ondataerror.apply(_t);       \r
+         }\r
+       } else {\r
+         // _s._wD('SMSound._ondataerror(): ignoring');\r
+       }\r
+  };\r
+\r
   }; // SMSound()\r
 \r
+  this._onfullscreenchange = function(bFullScreen) {\r
+    _s._wD('onfullscreenchange(): '+bFullScreen);\r
+    _s.isFullScreen = (bFullScreen==1?true:false);\r
+    if (!_s.isFullScreen) {\r
+         // attempt to restore window focus after leaving full-screen\r
+         try {\r
+               window.focus();\r
+               _s._wD('window.focus()');\r
+         } catch(e) {\r
+           // oh well\r
+         }\r
+    }\r
+  };\r
+\r
   // register a few event handlers\r
   if (window.addEventListener) {\r
     window.addEventListener('focus',_s.handleFocus,false);\r
@@ -1525,5 +1723,7 @@ function SoundManager(smURL,smID) {
 \r
 } // SoundManager()\r
 \r
-soundManager = new SoundManager();\r
-\r
+// set var SM2_DEFER = true; in your own script to prevent auto start-up\r
+if (typeof SM2_DEFER == 'undefined' || !SM2_DEFER) {\r
+  soundManager = new SoundManager();\r
+}
\ No newline at end of file
index 98ed98d5eb1088834f49de897b49a6d851160927..8a9711c6a6f3382e8e10a6449f67934533f0cfb7 100644 (file)
Binary files a/static/sound/soundmanager2.swf and b/static/sound/soundmanager2.swf differ
index 14e45788e2deaa32b7daa420dd8b34d48d8025bb..86cefe59360d65207c3fcc368f8972a3dad92110 100644 (file)
Binary files a/static/sound/soundmanager2_flash9.swf and b/static/sound/soundmanager2_flash9.swf differ