Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added namespace support to core libs.

Not committed on earlier update.
  • Loading branch information...
commit dd78e384a59a4301e3bfd07f831da7da77666bfe 1 parent 59c35a9
Lanny McNie lannymcnie authored
2  dev/com/gskinner/soundjs/FlashAudioPlugin.as
View
@@ -1 +1 @@
-package com.gskinner.soundjs {
+package com.gskinner.soundjs {
BIN  docs/SoundJS_docs-NEXT.zip
View
Binary file not shown
38 lib/soundjs-NEXT.min.js
View
@@ -11,23 +11,23 @@
**/
(function(h){function b(){throw"SoundJS cannot be instantiated";}function f(a,b){this.init(a,b)}function d(){}b.DELIMITER="|";b.AUDIO_TIMEOUT=8E3;b.INTERRUPT_ANY="any";b.INTERRUPT_EARLY="early";b.INTERRUPT_LATE="late";b.INTERRUPT_NONE="none";b.PLAY_INITED="playInited";b.PLAY_SUCCEEDED="playSucceeded";b.PLAY_INTERRUPTED="playInterrupted";b.PLAY_FINISHED="playFinished";b.PLAY_FAILED="playFailed";b.activePlugin=null;b.muted=false;b.pluginsRegistered=false;b.masterVolume=1;b.muted=false;b.instances=[];
b.instanceHash={};b.idHash=null;b.defaultSoundInstance=null;b.getPreloadHandlers=function(){return{callback:b.proxy(b.initLoad,b),types:["sound"],extensions:["mp3","ogg","wav"]}};b.registerPlugins=function(a){b.pluginsRegistered=true;for(var g=0,c=a.length;g<c;g++){var e=a[g];if(e!=null&&e.isSupported())return b.activePlugin=new e,true}return false};b.registerPlugin=function(a){b.pluginsRegistered=true;return a.isSupported()?(b.activePlugin=new a,true):false};b.isReady=function(){return b.activePlugin!=
-null};b.getCapabilities=function(){return b.activePlugin?b.activePlugin.capabilities:null};b.getCapability=function(a){return b.activePlugin==null?null:b.activePlugin.capabilities[a]};b.initLoad=function(a,g,c,e){if(!b.checkPlugin(true))return false;a=b.parsePath(a,g,c,e);if(a==null)return false;if(c!=null){if(b.idHash==null)b.idHash={};b.idHash[c]=a.src}f.create(a.src,e);c=b.activePlugin.register(a.src,e);if(c!=null){if(c.tag!=null)a.tag=c.tag;else if(c.src)a.src=c.src;if(c.completeHandler!=null)a.handler=
-c.completeHandler}return a};b.parsePath=function(a,g,c,e){for(var a=a.split(b.DELIMITER),g={type:g||"sound",id:c,data:e,handler:b.handleSoundReady},c=false,e=b.getCapabilities(),i=0,d=a.length;i<d;i++){var f=a[i],h=f.lastIndexOf("."),j=f.substr(h+1).toLowerCase(),h=f.substr(0,h).split("/").pop();switch(j){case "mp3":e.mp3&&(c=true);break;case "ogg":e.ogg&&(c=true);break;case "wav":e.wav&&(c=true)}if(c)return g.name=h,g.src=f,g.extension=j,g}return null};b.play=function(a,g,c,e,i,f,d){if(!b.checkPlugin(true))return b.defaultSoundInstance;
-a=b.getSrcFromId(a);a=b.activePlugin.create(a);a.mute(b.muted);b.playInstance(a,g,c,e,i,f,d)||a.playFailed();return a};b.playInstance=function(a,g,c,e,i,f,d){g=g||b.INTERRUPT_NONE;c==null&&(c=0);e==null&&(e=0);i==null&&(i=0);f==null&&(f=1);d==null&&(d=0);if(c==0){if(!b.beginPlaying(a,g,e,i,f,d))return false}else setTimeout(function(){b.beginPlaying(a,g,e,i,f,d)},c);this.instances.push(a);this.instanceHash[a.uniqueId]=a;return true};b.beginPlaying=function(a,b,c,e,d,h){if(!f.add(a,b))return false;
-return!a.beginPlaying(c,e,d,h)?(this.instances.splice(this.instances.indexOf(a),1),delete this.instanceHash[a.uniqueId],false):true};b.checkPlugin=function(a){return b.activePlugin==null&&(a&&!b.pluginsRegistered&&b.registerPlugin(b.HTMLAudioPlugin),b.activePlugin==null)?false:true};b.getSrcFromId=function(a){return b.idHash==null||b.idHash[a]==null?a:b.idHash[a]};b.setVolume=function(a,g){if(Number(a)==null)return false;a=Math.max(0,Math.min(1,a));return b.tellAllInstances("setVolume",g,a)};b.getMasterVolume=
-function(){return b.masterVolume};b.setMasterVolume=function(a){b.masterVolume=a;return b.tellAllInstances("setMasterVolume",null,a)};b.setMute=function(a){this.muted=a;return b.tellAllInstances("mute",null,a)};b.pause=function(a){return b.tellAllInstances("pause",a)};b.resume=function(a){return b.tellAllInstances("resume",a)};b.stop=function(a){return b.tellAllInstances("stop",a)};b.getInstanceById=function(a){return this.instanceHash[a]};b.playFinished=function(a){f.remove(a);this.instances.splice(this.instances.indexOf(a),
-1)};b.tellAllInstances=function(a,b,c){if(this.activePlugin==null)return false;for(var b=this.getSrcFromId(b),e=this.instances.length-1;e>=0;e--){var d=this.instances[e];if(!(b!=null&&d.src!=b))switch(a){case "pause":d.pause();break;case "resume":d.resume();break;case "setVolume":d.setVolume(c);break;case "setMasterVolume":d.setMasterVolume(c);break;case "mute":d.mute(c);break;case "stop":d.stop();break;case "setPan":d.setPan(c)}}return true};b.proxy=function(a,b){return function(){return a.apply(b,
-arguments)}};h.SoundJS=b;f.channels={};f.create=function(a,b){var c=f.get(a);c==null?f.channels[a]=new f(a,b):c.max+=b};f.add=function(a,b){var c=f.get(a.src);return c==null?false:c.add(a,b)};f.remove=function(a){var b=f.get(a.src);if(b==null)return false;b.remove(a);return true};f.get=function(a){return f.channels[a]};f.prototype={src:null,max:null,length:0,init:function(a,b){this.src=a;this.max=b||1;this.instances=[]},get:function(a){return this.instances[a]},add:function(a,b){if(!this.getSlot(b,
-a))return false;this.instances.push(a);this.length++;return true},remove:function(a){a=this.instances.indexOf(a);if(a==-1)return false;this.instances.splice(a,1);this.length--;return true},getSlot:function(a){for(var g,c,e=0,d=this.max||100;e<d;e++){g=this.get(e);if(g==null)return true;else if(a==b.INTERRUPT_NONE)continue;if(e==0)c=g;else if(g.playState==b.PLAY_FINISHED||g==b.PLAY_INTERRUPTED||g==b.PLAY_FAILED)c=g;else if(a==b.INTERRUPT_EARLY&&g.getPosition()<c.getPosition()||a==b.INTERRUPT_LATE&&
-g.getPosition()>c.getPosition())c=g}return c!=null?(c.interrupt(),this.remove(c),true):false},toString:function(){return"[SoundJS SoundChannel]"}};b.defaultSoundInstance=new function(){this.pause=this.resume=this.play=this.beginPlaying=this.cleanUp=this.interrupt=this.stop=this.setMasterVolume=this.setVolume=this.mute=this.setPan=this.getPosition=this.setPosition=this.toString=function(){return false};this.getVolume=this.getPan=this.getDuration=function(){return 0};this.playState=b.PLAY_FAILED};d.init=
-function(){var a=navigator.userAgent;d.isFirefox=a.indexOf("Firefox")>-1;d.isOpera=h.opera!=null;d.isIOS=a.indexOf("iPod")>-1||a.indexOf("iPhone")>-1||a.indexOf("iPad")>-1};d.init();b.BrowserDetect=d})(window);(function(h){function b(){this.init()}function f(a){this.init(a)}function d(a){this.init(a)}b.MAX_INSTANCES=30;b.capabilities=null;b.lastId=0;b.AUDIO_READY="canplaythrough";b.AUDIO_ENDED="ended";b.AUDIO_ERROR="error";b.AUDIO_STALLED="stalled";b.fillChannels=false;b.isSupported=function(){if(SoundJS.BrowserDetect.isIOS)return false;b.generateCapabilities();var a=b.tag;return a==null||a.canPlayType==null?false:true};b.generateCapabilities=function(){if(b.capabilities==null){var a=b.tag=document.createElement("audio");
+null};b.getCapabilities=function(){return b.activePlugin==null?null:b.activePlugin.capabilities};b.getCapability=function(a){return b.activePlugin==null?null:b.activePlugin.capabilities[a]};b.initLoad=function(a,g,c,e){if(!b.checkPlugin(true))return false;a=b.parsePath(a,g,c,e);if(a==null)return false;if(c!=null){if(b.idHash==null)b.idHash={};b.idHash[c]=a.src}f.create(a.src,e);c=b.activePlugin.register(a.src,e);if(c!=null){if(c.tag!=null)a.tag=c.tag;else if(c.src)a.src=c.src;if(c.completeHandler!=
+null)a.handler=c.completeHandler}return a};b.parsePath=function(a,g,c,e){for(var a=a.split(b.DELIMITER),g={type:g||"sound",id:c,data:e,handler:b.handleSoundReady},c=false,e=b.getCapabilities(),i=0,d=a.length;i<d;i++){var f=a[i],h=f.lastIndexOf("."),j=f.substr(h+1).toLowerCase(),h=f.substr(0,h).split("/").pop();switch(j){case "mp3":e.mp3&&(c=true);break;case "ogg":e.ogg&&(c=true);break;case "wav":e.wav&&(c=true)}if(c)return g.name=h,g.src=f,g.extension=j,g}return null};b.play=function(a,g,c,e,i,f,
+d){if(!b.checkPlugin(true))return b.defaultSoundInstance;a=b.getSrcFromId(a);a=b.activePlugin.create(a);a.mute(b.muted);b.playInstance(a,g,c,e,i,f,d)||a.playFailed();return a};b.playInstance=function(a,g,c,e,i,f,d){g=g||b.INTERRUPT_NONE;c==null&&(c=0);e==null&&(e=0);i==null&&(i=0);f==null&&(f=1);d==null&&(d=0);if(c==0){if(!b.beginPlaying(a,g,e,i,f,d))return false}else setTimeout(function(){b.beginPlaying(a,g,e,i,f,d)},c);this.instances.push(a);this.instanceHash[a.uniqueId]=a;return true};b.beginPlaying=
+function(a,b,c,e,d,h){if(!f.add(a,b))return false;return!a.beginPlaying(c,e,d,h)?(this.instances.splice(this.instances.indexOf(a),1),delete this.instanceHash[a.uniqueId],false):true};b.checkPlugin=function(a){return b.activePlugin==null&&(a&&!b.pluginsRegistered&&b.registerPlugin(createjs.HTMLAudioPlugin),b.activePlugin==null)?false:true};b.getSrcFromId=function(a){return b.idHash==null||b.idHash[a]==null?a:b.idHash[a]};b.setVolume=function(a,g){if(Number(a)==null)return false;a=Math.max(0,Math.min(1,
+a));return b.tellAllInstances("setVolume",g,a)};b.getMasterVolume=function(){return b.masterVolume};b.setMasterVolume=function(a){b.masterVolume=a;return b.tellAllInstances("setMasterVolume",null,a)};b.setMute=function(a){this.muted=a;return b.tellAllInstances("mute",null,a)};b.pause=function(a){return b.tellAllInstances("pause",a)};b.resume=function(a){return b.tellAllInstances("resume",a)};b.stop=function(a){return b.tellAllInstances("stop",a)};b.getInstanceById=function(a){return this.instanceHash[a]};
+b.playFinished=function(a){f.remove(a);this.instances.splice(this.instances.indexOf(a),1)};b.tellAllInstances=function(a,b,c){if(this.activePlugin==null)return false;for(var b=this.getSrcFromId(b),e=this.instances.length-1;e>=0;e--){var d=this.instances[e];if(!(b!=null&&d.src!=b))switch(a){case "pause":d.pause();break;case "resume":d.resume();break;case "setVolume":d.setVolume(c);break;case "setMasterVolume":d.setMasterVolume(c);break;case "mute":d.mute(c);break;case "stop":d.stop();break;case "setPan":d.setPan(c)}}return true};
+b.proxy=function(a,b){return function(){return a.apply(b,arguments)}};h.SoundJS=b;f.channels={};f.create=function(a,b){var c=f.get(a);c==null?f.channels[a]=new f(a,b):c.max+=b};f.add=function(a,b){var c=f.get(a.src);return c==null?false:c.add(a,b)};f.remove=function(a){var b=f.get(a.src);if(b==null)return false;b.remove(a);return true};f.get=function(a){return f.channels[a]};f.prototype={src:null,max:null,length:0,init:function(a,b){this.src=a;this.max=b||1;this.instances=[]},get:function(a){return this.instances[a]},
+add:function(a,b){if(!this.getSlot(b,a))return false;this.instances.push(a);this.length++;return true},remove:function(a){a=this.instances.indexOf(a);if(a==-1)return false;this.instances.splice(a,1);this.length--;return true},getSlot:function(a){for(var g,c,e=0,d=this.max||100;e<d;e++){g=this.get(e);if(g==null)return true;else if(a==b.INTERRUPT_NONE)continue;if(e==0)c=g;else if(g.playState==b.PLAY_FINISHED||g==b.PLAY_INTERRUPTED||g==b.PLAY_FAILED)c=g;else if(a==b.INTERRUPT_EARLY&&g.getPosition()<
+c.getPosition()||a==b.INTERRUPT_LATE&&g.getPosition()>c.getPosition())c=g}return c!=null?(c.interrupt(),this.remove(c),true):false},toString:function(){return"[SoundJS SoundChannel]"}};b.defaultSoundInstance=new function(){this.isDefault=true;this.pause=this.resume=this.play=this.beginPlaying=this.cleanUp=this.interrupt=this.stop=this.setMasterVolume=this.setVolume=this.mute=this.setPan=this.getPosition=this.setPosition=this.playFailed=function(){return false};this.getVolume=this.getPan=this.getDuration=
+function(){return 0};this.playState=b.PLAY_FAILED;this.toString=function(){return"[SoundJS Default Sound Instance]"}};d.init=function(){var a=navigator.userAgent;d.isFirefox=a.indexOf("Firefox")>-1;d.isOpera=window.opera!=null;d.isIOS=a.indexOf("iPod")>-1||a.indexOf("iPhone")>-1||a.indexOf("iPad")>-1};d.init();h.SoundJS.BrowserDetect=d})(createjs||(createjs={}));var createjs;(function(h){function b(){this.init()}function f(a){this.init(a)}function d(a){this.init(a)}b.MAX_INSTANCES=30;b.capabilities=null;b.lastId=0;b.AUDIO_READY="canplaythrough";b.AUDIO_ENDED="ended";b.AUDIO_ERROR="error";b.AUDIO_STALLED="stalled";b.fillChannels=false;b.isSupported=function(){if(createjs.SoundJS.BrowserDetect.isIOS)return false;b.generateCapabilities();var a=b.tag;return a==null||a.canPlayType==null?false:true};b.generateCapabilities=function(){if(b.capabilities==null){var a=b.tag=document.createElement("audio");
b.capabilities={panning:false,volume:true,mp3:a.canPlayType("audio/mp3")!="no"&&a.canPlayType("audio/mp3")!="",ogg:a.canPlayType("audio/ogg")!="no"&&a.canPlayType("audio/ogg")!="",mpeg:a.canPlayType("audio/mpeg")!="no"&&a.canPlayType("audio/mpeg")!="",wav:a.canPlayType("audio/wav")!="no"&&a.canPlayType("audio/wav")!="",channels:b.MAX_INSTANCES}}};b.prototype={capabilities:null,FT:0.0010,channels:null,init:function(){this.capabilities=b.capabilities;this.channels={}},register:function(a,b){for(var c=
-d.get(a),e,f=0,h=b||1;f<h;f++)e=this.createTag(a),c.add(e);return{tag:e}},createTag:function(a){var b=document.createElement("audio");b.preload=false;b.src=a;return b},create:function(a){a=new f(a);a.owner=this;return a},toString:function(){return"[HTMLAudioPlugin]"}};h.SoundJS.HTMLAudioPlugin=b;f.prototype={src:null,uniqueId:-1,playState:null,owner:null,loaded:false,lastInterrupt:SoundJS.INTERRUPT_NONE,offset:0,delay:0,volume:1,pan:0,remainingLoops:0,delayTimeout:-1,tag:null,muted:false,paused:false,
-onComplete:null,onLoop:null,onReady:null,onPlayFailed:null,onPlayInterrupted:null,endedHandler:null,readyHandler:null,stalledHandler:null,init:function(a){this.uniqueId=b.lastId++;this.src=a;this.endedHandler=SoundJS.proxy(this.handleSoundComplete,this);this.readyHandler=SoundJS.proxy(this.handleSoundReady,this);this.stalledHandler=SoundJS.proxy(this.handleSoundStalled,this)},cleanUp:function(){var a=this.tag;if(a!=null){a.pause();try{a.currentTime=0}catch(g){}a.removeEventListener(b.AUDIO_ENDED,
-this.endedHandler,false);a.removeEventListener(b.AUDIO_READY,this.readyHandler,false);d.setInstance(this.src,a);this.tag=null}SoundJS.playFinished(this)},interrupt:function(){if(this.tag!=null){this.playState=SoundJS.PLAY_INTERRUPTED;if(this.onPlayInterrupted)this.onPlayInterrupted(this);this.cleanUp();this.paused=false}},play:function(a,b,c,e,d,f){this.cleanUp();SoundJS.playInstance(this,a,b,c,e,d,f)},beginPlaying:function(a,g,c){var e=this.tag=d.getInstance(this.src);if(e==null)return this.playFailed(),
--1;e.addEventListener(b.AUDIO_ENDED,this.endedHandler,false);this.offset=a;this.volume=c;this.updateVolume();this.remainingLoops=g;e.readyState!==4?(e.addEventListener(b.AUDIO_READY,this.readyHandler,false),e.addEventListener(b.AUDIO_STALLED,this.stalledHandler,false),e.load()):this.handleSoundReady(null);return 1},handleSoundStalled:function(){if(this.onPlayFailed!=null)this.onPlayFailed(this);this.cleanUp()},handleSoundReady:function(){this.playState=SoundJS.PLAY_SUCCEEDED;this.paused=false;this.tag.removeEventListener(b.AUDIO_READY,
-this.readyHandler,false);this.offset>=this.getDuration()?this.playFailed():(this.tag.currentTime=this.offset*0.0010,this.tag.play())},pause:function(){this.paused=true;return this.tag!=null?(this.tag.pause(),false):true},resume:function(){this.paused=false;return this.tag!=null?(this.tag.play(),false):true},stop:function(){this.pause();this.playState=SoundJS.PLAY_FINISHED;this.cleanUp();return true},setMasterVolume:function(){this.updateVolume();return true},setVolume:function(a){this.volume=a;this.updateVolume();
-return true},updateVolume:function(){return this.tag!=null?(this.tag.volume=this.muted?0:this.volume*SoundJS.masterVolume,true):false},getVolume:function(){return this.volume},mute:function(a){this.muted=a;this.updateVolume();return true},setPan:function(){return false},getPan:function(){return 0},getPosition:function(){return this.tag==null?0:this.tag.currentTime*1E3},setPosition:function(a){if(this.tag==null)return false;try{this.tag.currentTime=a*0.0010}catch(b){return false}return true},getDuration:function(){return this.tag==
-null?0:this.tag.duration*1E3},handleSoundComplete:function(){if(this.remainingLoops!=0){this.remainingLoops--;try{this.tag.currentTime=0}catch(a){}this.tag.play();if(this.onLoop!=null)this.onLoop(this)}else{this.playState=SoundJS.PLAY_FINISHED;if(this.onComplete!=null)this.onComplete(this);this.cleanUp()}},playFailed:function(){this.playState=SoundJS.PLAY_FAILED;if(this.onPlayFailed!=null)this.onPlayFailed(this);this.cleanUp()},toString:function(){return"[HTMLAudio SoundInstance]"}};d.channels={};
-d.get=function(a){var b=d.channels[a];b==null&&(b=d.channels[a]=new d(a));return b};d.getInstance=function(a){a=d.channels[a];return a==null?null:a.get()};d.setInstance=function(a,b){var c=d.channels[a];return c==null?null:c.set(b)};d.prototype={src:null,length:0,available:0,tags:null,init:function(a){this.src=a;this.tags=[]},add:function(a){this.tags.push(a);this.length++;this.available=this.tags.length},get:function(){if(this.tags.length==0)return null;this.available=this.tags.length;var a=this.tags.pop();
-document.body.appendChild(a);return a},set:function(a){this.tags.indexOf(a)==-1&&this.tags.push(a);document.body.removeChild(a);this.available=this.tags.length},toString:function(){return"[HTMLAudioPlugin TagChannel]"}}})(window);
+d.get(a),e,f=0,h=b||1;f<h;f++)e=this.createTag(a),c.add(e);return{tag:e}},createTag:function(a){var b=document.createElement("audio");b.preload=false;b.src=a;return b},create:function(a){a=new f(a);a.owner=this;return a},toString:function(){return"[HTMLAudioPlugin]"}};h.HTMLAudioPlugin=b;f.prototype={src:null,uniqueId:-1,playState:null,owner:null,loaded:false,lastInterrupt:createjs.SoundJS.INTERRUPT_NONE,offset:0,delay:0,volume:1,pan:0,remainingLoops:0,delayTimeout:-1,tag:null,muted:false,paused:false,
+onComplete:null,onLoop:null,onReady:null,onPlayFailed:null,onPlayInterrupted:null,endedHandler:null,readyHandler:null,stalledHandler:null,init:function(a){this.uniqueId=h.HTMLAudioPlugin.lastId++;this.src=a;this.endedHandler=createjs.SoundJS.proxy(this.handleSoundComplete,this);this.readyHandler=createjs.SoundJS.proxy(this.handleSoundReady,this);this.stalledHandler=createjs.SoundJS.proxy(this.handleSoundStalled,this)},cleanUp:function(){var a=this.tag;if(a!=null){a.pause();try{a.currentTime=0}catch(b){}a.removeEventListener(h.HTMLAudioPlugin.AUDIO_ENDED,
+this.endedHandler,false);a.removeEventListener(h.HTMLAudioPlugin.AUDIO_READY,this.readyHandler,false);d.setInstance(this.src,a);this.tag=null}createjs.SoundJS.playFinished(this)},interrupt:function(){if(this.tag!=null){this.playState=createjs.SoundJS.PLAY_INTERRUPTED;if(this.onPlayInterrupted)this.onPlayInterrupted(this);this.cleanUp();this.paused=false}},play:function(a,b,c,e,d,f){this.cleanUp();createjs.SoundJS.playInstance(this,a,b,c,e,d,f)},beginPlaying:function(a,b,c){var e=this.tag=d.getInstance(this.src);
+if(e==null)return this.playFailed(),-1;e.addEventListener(h.HTMLAudioPlugin.AUDIO_ENDED,this.endedHandler,false);this.offset=a;this.volume=c;this.updateVolume();this.remainingLoops=b;e.readyState!==4?(e.addEventListener(h.HTMLAudioPlugin.AUDIO_READY,this.readyHandler,false),e.addEventListener(h.HTMLAudioPlugin.AUDIO_STALLED,this.stalledHandler,false),e.load()):this.handleSoundReady(null);return 1},handleSoundStalled:function(){if(this.onPlayFailed!=null)this.onPlayFailed(this);this.cleanUp()},handleSoundReady:function(){this.playState=
+createjs.SoundJS.PLAY_SUCCEEDED;this.paused=false;this.tag.removeEventListener(h.HTMLAudioPlugin.AUDIO_READY,this.readyHandler,false);this.offset>=this.getDuration()?this.playFailed():(this.tag.currentTime=this.offset*0.0010,this.tag.play())},pause:function(){this.paused=true;return this.tag!=null?(this.tag.pause(),false):true},resume:function(){this.paused=false;return this.tag!=null?(this.tag.play(),false):true},stop:function(){this.pause();this.playState=createjs.SoundJS.PLAY_FINISHED;this.cleanUp();
+return true},setMasterVolume:function(){this.updateVolume();return true},setVolume:function(a){this.volume=a;this.updateVolume();return true},updateVolume:function(){return this.tag!=null?(this.tag.volume=this.muted?0:this.volume*createjs.SoundJS.masterVolume,true):false},getVolume:function(){return this.volume},mute:function(a){this.muted=a;this.updateVolume();return true},setPan:function(){return false},getPan:function(){return 0},getPosition:function(){return this.tag==null?0:this.tag.currentTime*
+1E3},setPosition:function(a){if(this.tag==null)return false;try{this.tag.currentTime=a*0.0010}catch(b){return false}return true},getDuration:function(){return this.tag==null?0:this.tag.duration*1E3},handleSoundComplete:function(){if(this.remainingLoops!=0){this.remainingLoops--;try{this.tag.currentTime=0}catch(a){}this.tag.play();if(this.onLoop!=null)this.onLoop(this)}else{this.playState=createjs.SoundJS.PLAY_FINISHED;if(this.onComplete!=null)this.onComplete(this);this.cleanUp()}},playFailed:function(){this.playState=
+createjs.SoundJS.PLAY_FAILED;if(this.onPlayFailed!=null)this.onPlayFailed(this);this.cleanUp()},toString:function(){return"[HTMLAudioPlugin SoundInstance]"}};d.channels={};d.get=function(a){var b=d.channels[a];b==null&&(b=d.channels[a]=new d(a));return b};d.getInstance=function(a){a=d.channels[a];return a==null?null:a.get()};d.setInstance=function(a,b){var c=d.channels[a];return c==null?null:c.set(b)};d.prototype={src:null,length:0,available:0,tags:null,init:function(a){this.src=a;this.tags=[]},add:function(a){this.tags.push(a);
+this.length++;this.available=this.tags.length},get:function(){if(this.tags.length==0)return null;this.available=this.tags.length;var a=this.tags.pop();document.body.appendChild(a);return a},set:function(a){this.tags.indexOf(a)==-1&&this.tags.push(a);document.body.removeChild(a);this.available=this.tags.length},toString:function(){return"[HTMLAudioPlugin TagChannel]"}}})(createjs||(createjs={}));
82 lib/soundjs.flashplugin-0.2.0.min.js
View
@@ -1,41 +1,41 @@
-/**
-* SoundJS FlashPlugin
-* Visit http://createjs.com/ for documentation, updates and examples.
-*
-* Contains SWFObject (http://code.google.com/p/swfobject/)
-*
-* Copyright (c) 2011 gskinner.com, inc.
-*
-* Distributed under the terms of the MIT license.
-* http://www.opensource.org/licenses/mit-license.html
-*
-* This notice shall be included in all copies or substantial portions of the Software.
-**/
-var swfobject=function(){function n(){if(!x){try{var b=e.getElementsByTagName("body")[0].appendChild(e.createElement("span"));b.parentNode.removeChild(b)}catch(c){return}x=!0;for(var b=C.length,k=0;k<b;k++)C[k]()}}function h(b){x?b():C[C.length]=b}function z(b){if(typeof p.addEventListener!=l)p.addEventListener("load",b,!1);else if(typeof e.addEventListener!=l)e.addEventListener("load",b,!1);else if(typeof p.attachEvent!=l)U(p,"onload",b);else if(typeof p.onload=="function"){var c=p.onload;p.onload=
-function(){c();b()}}else p.onload=b}function D(){var b=e.getElementsByTagName("body")[0],c=e.createElement(t);c.setAttribute("type",E);var k=b.appendChild(c);if(k){var q=0;(function(){if(typeof k.GetVariable!=l){var g=k.GetVariable("$version");if(g)g=g.split(" ")[1].split(","),f.pv=[parseInt(g[0],10),parseInt(g[1],10),parseInt(g[2],10)]}else if(q<10){q++;setTimeout(arguments.callee,10);return}b.removeChild(c);k=null;a()})()}else a()}function a(){var b=u.length;if(b>0)for(var c=0;c<b;c++){var k=u[c].id,
-a=u[c].callbackFn,g={success:!1,id:k};if(f.pv[0]>0){var e=o(k);if(e)if(F(u[c].swfVersion)&&!(f.wk&&f.wk<312)){if(y(k,!0),a)g.success=!0,g.ref=d(k),a(g)}else if(u[c].expressInstall&&j()){g={};g.data=u[c].expressInstall;g.width=e.getAttribute("width")||"0";g.height=e.getAttribute("height")||"0";if(e.getAttribute("class"))g.styleclass=e.getAttribute("class");if(e.getAttribute("align"))g.align=e.getAttribute("align");for(var i={},e=e.getElementsByTagName("param"),V=e.length,m=0;m<V;m++)e[m].getAttribute("name").toLowerCase()!=
-"movie"&&(i[e[m].getAttribute("name")]=e[m].getAttribute("value"));J(g,i,k,a)}else v(e),a&&a(g)}else if(y(k,!0),a){if((k=d(k))&&typeof k.SetVariable!=l)g.success=!0,g.ref=k;a(g)}}}function d(b){var c=null;if((b=o(b))&&b.nodeName=="OBJECT")typeof b.SetVariable!=l?c=b:(b=b.getElementsByTagName(t)[0])&&(c=b);return c}function j(){return!G&&F("6.0.65")&&(f.win||f.mac)&&!(f.wk&&f.wk<312)}function J(b,c,k,a){G=!0;K=a||null;N={success:!1,id:k};var g=o(k);if(g){g.nodeName=="OBJECT"?(B=r(g),H=null):(B=g,H=
-k);b.id=O;if(typeof b.width==l||!/%$/.test(b.width)&&parseInt(b.width,10)<310)b.width="310";if(typeof b.height==l||!/%$/.test(b.height)&&parseInt(b.height,10)<137)b.height="137";e.title=e.title.slice(0,47)+" - Flash Player Installation";a=f.ie&&f.win?"ActiveX":"PlugIn";a="MMredirectURL="+encodeURI(window.location).toString().replace(/&/g,"%26")+"&MMplayerType="+a+"&MMdoctitle="+e.title;typeof c.flashvars!=l?c.flashvars+="&"+a:c.flashvars=a;if(f.ie&&f.win&&g.readyState!=4)a=e.createElement("div"),
-k+="SWFObjectNew",a.setAttribute("id",k),g.parentNode.insertBefore(a,g),g.style.display="none",function(){g.readyState==4?g.parentNode.removeChild(g):setTimeout(arguments.callee,10)}();L(b,c,k)}}function v(b){if(f.ie&&f.win&&b.readyState!=4){var c=e.createElement("div");b.parentNode.insertBefore(c,b);c.parentNode.replaceChild(r(b),c);b.style.display="none";(function(){b.readyState==4?b.parentNode.removeChild(b):setTimeout(arguments.callee,10)})()}else b.parentNode.replaceChild(r(b),b)}function r(b){var c=
-e.createElement("div");if(f.win&&f.ie)c.innerHTML=b.innerHTML;else if(b=b.getElementsByTagName(t)[0])if(b=b.childNodes)for(var a=b.length,q=0;q<a;q++)!(b[q].nodeType==1&&b[q].nodeName=="PARAM")&&b[q].nodeType!=8&&c.appendChild(b[q].cloneNode(!0));return c}function L(b,c,a){var q,g=o(a);if(f.wk&&f.wk<312)return q;if(g){if(typeof b.id==l)b.id=a;if(f.ie&&f.win){var d="",i;for(i in b)if(b[i]!=Object.prototype[i])i.toLowerCase()=="data"?c.movie=b[i]:i.toLowerCase()=="styleclass"?d+=' class="'+b[i]+'"':
-i.toLowerCase()!="classid"&&(d+=" "+i+'="'+b[i]+'"');i="";for(var j in c)c[j]!=Object.prototype[j]&&(i+='<param name="'+j+'" value="'+c[j]+'" />');g.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+d+">"+i+"</object>";I[I.length]=b.id;q=o(b.id)}else{j=e.createElement(t);j.setAttribute("type",E);for(var m in b)b[m]!=Object.prototype[m]&&(m.toLowerCase()=="styleclass"?j.setAttribute("class",b[m]):m.toLowerCase()!="classid"&&j.setAttribute(m,b[m]));for(d in c)c[d]!=Object.prototype[d]&&
-d.toLowerCase()!="movie"&&(b=j,i=d,m=c[d],a=e.createElement("param"),a.setAttribute("name",i),a.setAttribute("value",m),b.appendChild(a));g.parentNode.replaceChild(j,g);q=j}}return q}function P(b){var c=o(b);if(c&&c.nodeName=="OBJECT")f.ie&&f.win?(c.style.display="none",function(){if(c.readyState==4){var a=o(b);if(a){for(var e in a)typeof a[e]=="function"&&(a[e]=null);a.parentNode.removeChild(a)}}else setTimeout(arguments.callee,10)}()):c.parentNode.removeChild(c)}function o(b){var c=null;try{c=e.getElementById(b)}catch(a){}return c}
-function U(b,c,a){b.attachEvent(c,a);A[A.length]=[b,c,a]}function F(b){var c=f.pv,b=b.split(".");b[0]=parseInt(b[0],10);b[1]=parseInt(b[1],10)||0;b[2]=parseInt(b[2],10)||0;return c[0]>b[0]||c[0]==b[0]&&c[1]>b[1]||c[0]==b[0]&&c[1]==b[1]&&c[2]>=b[2]?!0:!1}function Q(b,c,a,d){if(!f.ie||!f.mac){var g=e.getElementsByTagName("head")[0];if(g){a=a&&typeof a=="string"?a:"screen";d&&(M=s=null);if(!s||M!=a)d=e.createElement("style"),d.setAttribute("type","text/css"),d.setAttribute("media",a),s=g.appendChild(d),
-f.ie&&f.win&&typeof e.styleSheets!=l&&e.styleSheets.length>0&&(s=e.styleSheets[e.styleSheets.length-1]),M=a;f.ie&&f.win?s&&typeof s.addRule==t&&s.addRule(b,c):s&&typeof e.createTextNode!=l&&s.appendChild(e.createTextNode(b+" {"+c+"}"))}}}function y(b,a){if(R){var e=a?"visible":"hidden";x&&o(b)?o(b).style.visibility=e:Q("#"+b,"visibility:"+e)}}function S(b){return/[\\\"<>\.;]/.exec(b)!=null&&typeof encodeURIComponent!=l?encodeURIComponent(b):b}var l="undefined",t="object",E="application/x-shockwave-flash",
-O="SWFObjectExprInst",p=window,e=document,w=navigator,T=!1,C=[function(){T?D():a()}],u=[],I=[],A=[],B,H,K,N,x=!1,G=!1,s,M,R=!0,f=function(){var b=typeof e.getElementById!=l&&typeof e.getElementsByTagName!=l&&typeof e.createElement!=l,a=w.userAgent.toLowerCase(),k=w.platform.toLowerCase(),f=k?/win/.test(k):/win/.test(a),k=k?/mac/.test(k):/mac/.test(a),a=/webkit/.test(a)?parseFloat(a.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):!1,g=!+"\u000b1",d=[0,0,0],i=null;if(typeof w.plugins!=l&&typeof w.plugins["Shockwave Flash"]==
-t){if((i=w.plugins["Shockwave Flash"].description)&&!(typeof w.mimeTypes!=l&&w.mimeTypes[E]&&!w.mimeTypes[E].enabledPlugin))T=!0,g=!1,i=i.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),d[0]=parseInt(i.replace(/^(.*)\..*$/,"$1"),10),d[1]=parseInt(i.replace(/^.*\.(.*)\s.*$/,"$1"),10),d[2]=/[a-zA-Z]/.test(i)?parseInt(i.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}else if(typeof p.ActiveXObject!=l)try{var j=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(j&&(i=j.GetVariable("$version")))g=!0,i=i.split(" ")[1].split(","),
-d=[parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10)]}catch(m){}return{w3:b,pv:d,wk:a,ie:g,win:f,mac:k}}();(function(){f.w3&&((typeof e.readyState!=l&&e.readyState=="complete"||typeof e.readyState==l&&(e.getElementsByTagName("body")[0]||e.body))&&n(),x||(typeof e.addEventListener!=l&&e.addEventListener("DOMContentLoaded",n,!1),f.ie&&f.win&&(e.attachEvent("onreadystatechange",function(){e.readyState=="complete"&&(e.detachEvent("onreadystatechange",arguments.callee),n())}),p==top&&function(){if(!x){try{e.documentElement.doScroll("left")}catch(b){setTimeout(arguments.callee,
-0);return}n()}}()),f.wk&&function(){x||(/loaded|complete/.test(e.readyState)?n():setTimeout(arguments.callee,0))}(),z(n)))})();(function(){f.ie&&f.win&&window.attachEvent("onunload",function(){for(var b=A.length,a=0;a<b;a++)A[a][0].detachEvent(A[a][1],A[a][2]);b=I.length;for(a=0;a<b;a++)P(I[a]);for(var e in f)f[e]=null;f=null;for(var d in swfobject)swfobject[d]=null;swfobject=null})})();return{registerObject:function(b,a,e,d){if(f.w3&&b&&a){var g={};g.id=b;g.swfVersion=a;g.expressInstall=e;g.callbackFn=
-d;u[u.length]=g;y(b,!1)}else d&&d({success:!1,id:b})},getObjectById:function(b){if(f.w3)return d(b)},embedSWF:function(b,a,e,d,g,v,i,p,m,o){var r={success:!1,id:a};f.w3&&!(f.wk&&f.wk<312)&&b&&a&&e&&d&&g?(y(a,!1),h(function(){e+="";d+="";var f={};if(m&&typeof m===t)for(var h in m)f[h]=m[h];f.data=b;f.width=e;f.height=d;h={};if(p&&typeof p===t)for(var s in p)h[s]=p[s];if(i&&typeof i===t)for(var n in i)typeof h.flashvars!=l?h.flashvars+="&"+n+"="+i[n]:h.flashvars=n+"="+i[n];if(F(g))s=L(f,h,a),f.id==
-a&&y(a,!0),r.success=!0,r.ref=s;else if(v&&j()){f.data=v;J(f,h,a,o);return}else y(a,!0);o&&o(r)})):o&&o(r)},switchOffAutoHideShow:function(){R=!1},ua:f,getFlashPlayerVersion:function(){return{major:f.pv[0],minor:f.pv[1],release:f.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(a,c,e){if(f.w3)return L(a,c,e)},showExpressInstall:function(a,c,e,d){f.w3&&j()&&J(a,c,e,d)},removeSWF:function(a){f.w3&&P(a)},createCSS:function(a,c,e,d){f.w3&&Q(a,c,e,d)},addDomLoadEvent:h,addLoadEvent:z,getQueryParamValue:function(a){var c=
-e.location.search||e.location.hash;if(c){/\?/.test(c)&&(c=c.split("?")[1]);if(a==null)return S(c);for(var c=c.split("&"),d=0;d<c.length;d++)if(c[d].substring(0,c[d].indexOf("="))==a)return S(c[d].substring(c[d].indexOf("=")+1))}return""},expressInstallCallback:function(){if(G){var a=o(O);if(a&&B){a.parentNode.replaceChild(B,a);if(H&&(y(H,!0),f.ie&&f.win))B.style.display="block";K&&K(N)}G=!1}}}}();(function(n){function h(){this.init()}function z(a,d){this.init(a,d)}function D(a,d){this.init(a,d)}h.capabilities=null;h.BASE_PATH="src/soundjs";h.lastId=0;h.isSupported=function(){if(SoundJS.BrowserDetect.isIOS)return!1;h.generateCapabilities();return swfobject==null?!1:swfobject.hasFlashPlayerVersion("9.0.0")};h.generateCapabilities=function(){if(h.capabilities==null)h.capabilities={panning:!0,volume:!0,mp3:!0,ogg:!1,mpeg:!0,wav:!0,channels:255}};h.prototype={CONTAINER_ID:"flashAudioContainer",
-capabilities:null,container:null,flash:null,flashReady:!1,flashInstances:null,flashPreloadInstances:null,queuedInstances:null,init:function(){this.capabilities=h.capabilities;this.flashInstances={};this.flashPreloadInstances={};this.queuedInstances=[];var a=this.container=document.createElement("div");a.id=this.CONTAINER_ID;a.appendChild(document.createTextNode("Default Content Here"));document.body.appendChild(a);swfobject.embedSWF(h.BASE_PATH+"FlashAudioPlugin.swf",this.CONTAINER_ID,"1","1","9.0.0",
-null,null,null,null,SoundJS.proxy(this.handleSWFReady,this))},handleSWFReady:function(a){this.flash=a.ref;this.loadTimeout=setTimeout(function(){SoundJS.proxy(this.handleTimeout,this)},2E3)},handleFlashReady:function(){this.flashReady=!0;for(var a=0,d=this.queuedInstances.length;a<d;a++)this.flash.register(this.queuedInstances[a]);this.queuedInstances=null;for(var j in this.flashPreloadInstances)this.flashPreloadInstances[j].initialize(this.flash);for(j in this.flashInstances)this.flashInstances[j].initialize(this.flash)},
-handleTimeout:function(){},register:function(a){this.flashReady?this.flash.register(a):this.queuedInstances.push(a);return{tag:new D(a,this.flash)}},create:function(a){try{var d=new z(a,this.flash);d.owner=this;return d}catch(j){}return null},registerPreloadInstance:function(a,d){this.flashPreloadInstances[a]=d},unregisterPreloadInstance:function(a){delete this.flashPreloadInstances[a]},registerSoundInstance:function(a,d){this.flashInstances[a]=d},unregisterSoundInstance:function(a){delete this.flashInstances[a]},
-handleSoundEvent:function(a,d){var j=this.flashInstances[a];if(j!=null){for(var h=[],v=2,r=arguments.length;v<r;v++)h.push(arguments[v]);try{if(h.length==0)j[d]();else j[d].apply(j,h)}catch(n){}}},handlePreloadEvent:function(a,d){var j=this.flashPreloadInstances[a];if(j!=null){for(var h=[],n=2,r=arguments.length;n<r;n++)h.push(arguments[n]);try{if(h.length==0)j[d]();else j[d].apply(j,h)}catch(z){}}},handleEvent:function(a){switch(a){case "ready":clearTimeout(this.loadTimeout),this.handleFlashReady()}},
-handleErrorEvent:function(){},toString:function(){return"[FlashPlugin]"}};n.SoundJS.FlashPlugin=h;z.prototype={src:null,uniqueId:-1,capabilities:null,flash:null,flashId:null,loop:0,volume:1,pan:0,muted:!1,paused:!1,onComplete:null,onLoop:null,onReady:null,onPlayFailed:null,onPlayInterrupted:null,init:function(a,d){this.uniqueId=h.lastId++;this.src=a;this.flash=d},initialize:function(a){this.flash=a},interrupt:function(){this.playState=SoundJS.PLAY_INTERRUPTED;if(this.onPlayInterrupted!=null)this.onPlayInterrupted(this);
-this.flash.interrupt(this.flashId);this.cleanUp()},cleanUp:function(){this.owner.unregisterSoundInstance(this.flashId);SoundJS.playFinished(this)},play:function(a,d,j,h,n,r){SoundJS.playInstance(this,a,d,j,h,n,r)},beginPlaying:function(a,d,j,h){this.loop=d;this.paused=!1;this.flashId=this.flash.playSound(this.src,a,d,j,h);if(this.flashId==null){if(this.onPlayFailed!=null)this.onPlayFailed(this);this.cleanUp();return-1}this.playState=SoundJS.PLAY_SUCCEEDED;this.owner.registerSoundInstance(this.flashId,
-this);return 1},pause:function(){this.paused=!0;return this.flash.pauseSound(this.flashId)},resume:function(){this.paused=!1;return this.flash.resumeSound(this.flashId)},stop:function(){this.playState=SoundJS.PLAY_FINISHED;this.paused=!1;var a=this.flash.stopSound(this.flashId);this.cleanUp();return a},setVolume:function(a){this.volume=a;return this.flash.setVolume(this.flashId,a)},getVolume:function(){return this.volume},mute:function(a){return(this.muted=a)?this.flash.muteSound(this.flashId):this.flash.unmuteSound(this.flashId)},
-getPan:function(){return this.pan},setPan:function(a){this.pan=a;return this.flash.setPan(this.flashId,a)},getPosition:function(){return this.flash.getPosition(this.flashId)},setPosition:function(a){return this.flash.setPosition(this.flashId,a)},getDuration:function(){return this.flash.getDuration(this.flashId)},handleSoundFinished:function(){this.playState=SoundJS.PLAY_FINISHED;if(this.onComplete!=null)this.onComplete(this);this.cleanUp()},handleLoop:function(){if(this.onLoop!=null)this.onLoop(this)},
-toString:function(){return"[FlashPlugin SoundInstance]"}};D.prototype={flash:null,src:null,flashId:null,progress:-1,readyState:0,loading:!1,onloaded:null,onprogress:null,onError:null,init:function(a,d){this.src=a;this.flash=d},initialize:function(a){this.flash=a;this.loading&&this.load(this.src)},load:function(a){if(this.flash==null)return loading=!0,!1;this.flashId=this.flash.preload(a);this.owner.registerPreloadInstance(this.flashId,this);return!0},handleProgress:function(a,d){this.progress=a/d;
-if(this.onprogress!=null)this.onprogress({loaded:a,total:d,progress:this.progress})},handleComplete:function(){this.progress=1;this.readyState=4;if(this.onloaded!=null)this.onloaded()},handleError:function(a){if(this.onerror!=null)this.onerror(a)},toString:function(){return"[FlashPlugin SoundLoader]"}}})(window);
+/**
+* SoundJS FlashPlugin
+* Visit http://createjs.com/ for documentation, updates and examples.
+*
+* Contains SWFObject (http://code.google.com/p/swfobject/)
+*
+* Copyright (c) 2011 gskinner.com, inc.
+*
+* Distributed under the terms of the MIT license.
+* http://www.opensource.org/licenses/mit-license.html
+*
+* This notice shall be included in all copies or substantial portions of the Software.
+**/
+var swfobject=function(){function n(){if(!x){try{var b=e.getElementsByTagName("body")[0].appendChild(e.createElement("span"));b.parentNode.removeChild(b)}catch(c){return}x=!0;for(var b=C.length,k=0;k<b;k++)C[k]()}}function h(b){x?b():C[C.length]=b}function z(b){if(typeof p.addEventListener!=l)p.addEventListener("load",b,!1);else if(typeof e.addEventListener!=l)e.addEventListener("load",b,!1);else if(typeof p.attachEvent!=l)U(p,"onload",b);else if(typeof p.onload=="function"){var c=p.onload;p.onload=
+function(){c();b()}}else p.onload=b}function D(){var b=e.getElementsByTagName("body")[0],c=e.createElement(t);c.setAttribute("type",E);var k=b.appendChild(c);if(k){var q=0;(function(){if(typeof k.GetVariable!=l){var g=k.GetVariable("$version");if(g)g=g.split(" ")[1].split(","),f.pv=[parseInt(g[0],10),parseInt(g[1],10),parseInt(g[2],10)]}else if(q<10){q++;setTimeout(arguments.callee,10);return}b.removeChild(c);k=null;a()})()}else a()}function a(){var b=u.length;if(b>0)for(var c=0;c<b;c++){var k=u[c].id,
+a=u[c].callbackFn,g={success:!1,id:k};if(f.pv[0]>0){var e=o(k);if(e)if(F(u[c].swfVersion)&&!(f.wk&&f.wk<312)){if(y(k,!0),a)g.success=!0,g.ref=d(k),a(g)}else if(u[c].expressInstall&&j()){g={};g.data=u[c].expressInstall;g.width=e.getAttribute("width")||"0";g.height=e.getAttribute("height")||"0";if(e.getAttribute("class"))g.styleclass=e.getAttribute("class");if(e.getAttribute("align"))g.align=e.getAttribute("align");for(var i={},e=e.getElementsByTagName("param"),V=e.length,m=0;m<V;m++)e[m].getAttribute("name").toLowerCase()!=
+"movie"&&(i[e[m].getAttribute("name")]=e[m].getAttribute("value"));J(g,i,k,a)}else v(e),a&&a(g)}else if(y(k,!0),a){if((k=d(k))&&typeof k.SetVariable!=l)g.success=!0,g.ref=k;a(g)}}}function d(b){var c=null;if((b=o(b))&&b.nodeName=="OBJECT")typeof b.SetVariable!=l?c=b:(b=b.getElementsByTagName(t)[0])&&(c=b);return c}function j(){return!G&&F("6.0.65")&&(f.win||f.mac)&&!(f.wk&&f.wk<312)}function J(b,c,k,a){G=!0;K=a||null;N={success:!1,id:k};var g=o(k);if(g){g.nodeName=="OBJECT"?(B=r(g),H=null):(B=g,H=
+k);b.id=O;if(typeof b.width==l||!/%$/.test(b.width)&&parseInt(b.width,10)<310)b.width="310";if(typeof b.height==l||!/%$/.test(b.height)&&parseInt(b.height,10)<137)b.height="137";e.title=e.title.slice(0,47)+" - Flash Player Installation";a=f.ie&&f.win?"ActiveX":"PlugIn";a="MMredirectURL="+encodeURI(window.location).toString().replace(/&/g,"%26")+"&MMplayerType="+a+"&MMdoctitle="+e.title;typeof c.flashvars!=l?c.flashvars+="&"+a:c.flashvars=a;if(f.ie&&f.win&&g.readyState!=4)a=e.createElement("div"),
+k+="SWFObjectNew",a.setAttribute("id",k),g.parentNode.insertBefore(a,g),g.style.display="none",function(){g.readyState==4?g.parentNode.removeChild(g):setTimeout(arguments.callee,10)}();L(b,c,k)}}function v(b){if(f.ie&&f.win&&b.readyState!=4){var c=e.createElement("div");b.parentNode.insertBefore(c,b);c.parentNode.replaceChild(r(b),c);b.style.display="none";(function(){b.readyState==4?b.parentNode.removeChild(b):setTimeout(arguments.callee,10)})()}else b.parentNode.replaceChild(r(b),b)}function r(b){var c=
+e.createElement("div");if(f.win&&f.ie)c.innerHTML=b.innerHTML;else if(b=b.getElementsByTagName(t)[0])if(b=b.childNodes)for(var a=b.length,q=0;q<a;q++)!(b[q].nodeType==1&&b[q].nodeName=="PARAM")&&b[q].nodeType!=8&&c.appendChild(b[q].cloneNode(!0));return c}function L(b,c,a){var q,g=o(a);if(f.wk&&f.wk<312)return q;if(g){if(typeof b.id==l)b.id=a;if(f.ie&&f.win){var d="",i;for(i in b)if(b[i]!=Object.prototype[i])i.toLowerCase()=="data"?c.movie=b[i]:i.toLowerCase()=="styleclass"?d+=' class="'+b[i]+'"':
+i.toLowerCase()!="classid"&&(d+=" "+i+'="'+b[i]+'"');i="";for(var j in c)c[j]!=Object.prototype[j]&&(i+='<param name="'+j+'" value="'+c[j]+'" />');g.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+d+">"+i+"</object>";I[I.length]=b.id;q=o(b.id)}else{j=e.createElement(t);j.setAttribute("type",E);for(var m in b)b[m]!=Object.prototype[m]&&(m.toLowerCase()=="styleclass"?j.setAttribute("class",b[m]):m.toLowerCase()!="classid"&&j.setAttribute(m,b[m]));for(d in c)c[d]!=Object.prototype[d]&&
+d.toLowerCase()!="movie"&&(b=j,i=d,m=c[d],a=e.createElement("param"),a.setAttribute("name",i),a.setAttribute("value",m),b.appendChild(a));g.parentNode.replaceChild(j,g);q=j}}return q}function P(b){var c=o(b);if(c&&c.nodeName=="OBJECT")f.ie&&f.win?(c.style.display="none",function(){if(c.readyState==4){var a=o(b);if(a){for(var e in a)typeof a[e]=="function"&&(a[e]=null);a.parentNode.removeChild(a)}}else setTimeout(arguments.callee,10)}()):c.parentNode.removeChild(c)}function o(b){var c=null;try{c=e.getElementById(b)}catch(a){}return c}
+function U(b,c,a){b.attachEvent(c,a);A[A.length]=[b,c,a]}function F(b){var c=f.pv,b=b.split(".");b[0]=parseInt(b[0],10);b[1]=parseInt(b[1],10)||0;b[2]=parseInt(b[2],10)||0;return c[0]>b[0]||c[0]==b[0]&&c[1]>b[1]||c[0]==b[0]&&c[1]==b[1]&&c[2]>=b[2]?!0:!1}function Q(b,c,a,d){if(!f.ie||!f.mac){var g=e.getElementsByTagName("head")[0];if(g){a=a&&typeof a=="string"?a:"screen";d&&(M=s=null);if(!s||M!=a)d=e.createElement("style"),d.setAttribute("type","text/css"),d.setAttribute("media",a),s=g.appendChild(d),
+f.ie&&f.win&&typeof e.styleSheets!=l&&e.styleSheets.length>0&&(s=e.styleSheets[e.styleSheets.length-1]),M=a;f.ie&&f.win?s&&typeof s.addRule==t&&s.addRule(b,c):s&&typeof e.createTextNode!=l&&s.appendChild(e.createTextNode(b+" {"+c+"}"))}}}function y(b,a){if(R){var e=a?"visible":"hidden";x&&o(b)?o(b).style.visibility=e:Q("#"+b,"visibility:"+e)}}function S(b){return/[\\\"<>\.;]/.exec(b)!=null&&typeof encodeURIComponent!=l?encodeURIComponent(b):b}var l="undefined",t="object",E="application/x-shockwave-flash",
+O="SWFObjectExprInst",p=window,e=document,w=navigator,T=!1,C=[function(){T?D():a()}],u=[],I=[],A=[],B,H,K,N,x=!1,G=!1,s,M,R=!0,f=function(){var b=typeof e.getElementById!=l&&typeof e.getElementsByTagName!=l&&typeof e.createElement!=l,a=w.userAgent.toLowerCase(),k=w.platform.toLowerCase(),f=k?/win/.test(k):/win/.test(a),k=k?/mac/.test(k):/mac/.test(a),a=/webkit/.test(a)?parseFloat(a.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):!1,g=!+"\u000b1",d=[0,0,0],i=null;if(typeof w.plugins!=l&&typeof w.plugins["Shockwave Flash"]==
+t){if((i=w.plugins["Shockwave Flash"].description)&&!(typeof w.mimeTypes!=l&&w.mimeTypes[E]&&!w.mimeTypes[E].enabledPlugin))T=!0,g=!1,i=i.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),d[0]=parseInt(i.replace(/^(.*)\..*$/,"$1"),10),d[1]=parseInt(i.replace(/^.*\.(.*)\s.*$/,"$1"),10),d[2]=/[a-zA-Z]/.test(i)?parseInt(i.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}else if(typeof p.ActiveXObject!=l)try{var j=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(j&&(i=j.GetVariable("$version")))g=!0,i=i.split(" ")[1].split(","),
+d=[parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10)]}catch(m){}return{w3:b,pv:d,wk:a,ie:g,win:f,mac:k}}();(function(){f.w3&&((typeof e.readyState!=l&&e.readyState=="complete"||typeof e.readyState==l&&(e.getElementsByTagName("body")[0]||e.body))&&n(),x||(typeof e.addEventListener!=l&&e.addEventListener("DOMContentLoaded",n,!1),f.ie&&f.win&&(e.attachEvent("onreadystatechange",function(){e.readyState=="complete"&&(e.detachEvent("onreadystatechange",arguments.callee),n())}),p==top&&function(){if(!x){try{e.documentElement.doScroll("left")}catch(b){setTimeout(arguments.callee,
+0);return}n()}}()),f.wk&&function(){x||(/loaded|complete/.test(e.readyState)?n():setTimeout(arguments.callee,0))}(),z(n)))})();(function(){f.ie&&f.win&&window.attachEvent("onunload",function(){for(var b=A.length,a=0;a<b;a++)A[a][0].detachEvent(A[a][1],A[a][2]);b=I.length;for(a=0;a<b;a++)P(I[a]);for(var e in f)f[e]=null;f=null;for(var d in swfobject)swfobject[d]=null;swfobject=null})})();return{registerObject:function(b,a,e,d){if(f.w3&&b&&a){var g={};g.id=b;g.swfVersion=a;g.expressInstall=e;g.callbackFn=
+d;u[u.length]=g;y(b,!1)}else d&&d({success:!1,id:b})},getObjectById:function(b){if(f.w3)return d(b)},embedSWF:function(b,a,e,d,g,v,i,p,m,o){var r={success:!1,id:a};f.w3&&!(f.wk&&f.wk<312)&&b&&a&&e&&d&&g?(y(a,!1),h(function(){e+="";d+="";var f={};if(m&&typeof m===t)for(var h in m)f[h]=m[h];f.data=b;f.width=e;f.height=d;h={};if(p&&typeof p===t)for(var s in p)h[s]=p[s];if(i&&typeof i===t)for(var n in i)typeof h.flashvars!=l?h.flashvars+="&"+n+"="+i[n]:h.flashvars=n+"="+i[n];if(F(g))s=L(f,h,a),f.id==
+a&&y(a,!0),r.success=!0,r.ref=s;else if(v&&j()){f.data=v;J(f,h,a,o);return}else y(a,!0);o&&o(r)})):o&&o(r)},switchOffAutoHideShow:function(){R=!1},ua:f,getFlashPlayerVersion:function(){return{major:f.pv[0],minor:f.pv[1],release:f.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(a,c,e){if(f.w3)return L(a,c,e)},showExpressInstall:function(a,c,e,d){f.w3&&j()&&J(a,c,e,d)},removeSWF:function(a){f.w3&&P(a)},createCSS:function(a,c,e,d){f.w3&&Q(a,c,e,d)},addDomLoadEvent:h,addLoadEvent:z,getQueryParamValue:function(a){var c=
+e.location.search||e.location.hash;if(c){/\?/.test(c)&&(c=c.split("?")[1]);if(a==null)return S(c);for(var c=c.split("&"),d=0;d<c.length;d++)if(c[d].substring(0,c[d].indexOf("="))==a)return S(c[d].substring(c[d].indexOf("=")+1))}return""},expressInstallCallback:function(){if(G){var a=o(O);if(a&&B){a.parentNode.replaceChild(B,a);if(H&&(y(H,!0),f.ie&&f.win))B.style.display="block";K&&K(N)}G=!1}}}}();(function(n){function h(){this.init()}function z(a,d){this.init(a,d)}function D(a,d){this.init(a,d)}h.capabilities=null;h.BASE_PATH="src/soundjs/";h.lastId=0;h.isSupported=function(){if(createjs.SoundJS.BrowserDetect.isIOS)return!1;h.generateCapabilities();return swfobject==null?!1:swfobject.hasFlashPlayerVersion("9.0.0")};h.generateCapabilities=function(){if(h.capabilities==null)h.capabilities={panning:!0,volume:!0,mp3:!0,ogg:!1,mpeg:!0,wav:!0,channels:255}};h.prototype={CONTAINER_ID:"flashAudioContainer",
+capabilities:null,container:null,flash:null,flashReady:!1,flashInstances:null,flashPreloadInstances:null,queuedInstances:null,init:function(){this.capabilities=h.capabilities;this.flashInstances={};this.flashPreloadInstances={};this.queuedInstances=[];var a=this.container=document.createElement("div");a.id=this.CONTAINER_ID;a.appendChild(document.createTextNode("Default Content Here"));document.body.appendChild(a);swfobject.embedSWF(h.BASE_PATH+"FlashAudioPlugin.swf",this.CONTAINER_ID,"1","1","9.0.0",
+null,null,null,null,createjs.SoundJS.proxy(this.handleSWFReady,this))},handleSWFReady:function(a){this.flash=a.ref;this.loadTimeout=setTimeout(function(){createjs.SoundJS.proxy(this.handleTimeout,this)},2E3)},handleFlashReady:function(){this.flashReady=!0;for(var a=0,d=this.queuedInstances.length;a<d;a++)this.flash.register(this.queuedInstances[a]);this.queuedInstances=null;for(var j in this.flashPreloadInstances)this.flashPreloadInstances[j].initialize(this.flash);for(j in this.flashInstances)this.flashInstances[j].initialize(this.flash)},
+handleTimeout:function(){},register:function(a){this.flashReady?this.flash.register(a):this.queuedInstances.push(a);return{tag:new D(a,this.flash)}},create:function(a){try{var d=new z(a,this.flash);d.owner=this;return d}catch(j){}return null},registerPreloadInstance:function(a,d){this.flashPreloadInstances[a]=d},unregisterPreloadInstance:function(a){delete this.flashPreloadInstances[a]},registerSoundInstance:function(a,d){this.flashInstances[a]=d},unregisterSoundInstance:function(a){delete this.flashInstances[a]},
+handleSoundEvent:function(a,d){var j=this.flashInstances[a];if(j!=null){for(var h=[],v=2,r=arguments.length;v<r;v++)h.push(arguments[v]);try{if(h.length==0)j[d]();else j[d].apply(j,h)}catch(n){}}},handlePreloadEvent:function(a,d){var j=this.flashPreloadInstances[a];if(j!=null){for(var h=[],n=2,r=arguments.length;n<r;n++)h.push(arguments[n]);try{if(h.length==0)j[d]();else j[d].apply(j,h)}catch(z){}}},handleEvent:function(a){switch(a){case "ready":clearTimeout(this.loadTimeout),this.handleFlashReady()}},
+handleErrorEvent:function(){},toString:function(){return"[FlashPlugin]"}};n.FlashPlugin=h;z.prototype={src:null,uniqueId:-1,capabilities:null,flash:null,flashId:null,loop:0,volume:1,pan:0,muted:!1,paused:!1,onComplete:null,onLoop:null,onReady:null,onPlayFailed:null,onPlayInterrupted:null,init:function(a,d){this.uniqueId=h.lastId++;this.src=a;this.flash=d},initialize:function(a){this.flash=a},interrupt:function(){this.playState=createjs.SoundJS.PLAY_INTERRUPTED;if(this.onPlayInterrupted!=null)this.onPlayInterrupted(this);
+this.flash.interrupt(this.flashId);this.cleanUp()},cleanUp:function(){this.owner.unregisterSoundInstance(this.flashId);createjs.SoundJS.playFinished(this)},play:function(a,d,j,h,n,r){createjs.SoundJS.playInstance(this,a,d,j,h,n,r)},beginPlaying:function(a,d,j,h){this.loop=d;this.paused=!1;this.flashId=this.flash.playSound(this.src,a,d,j,h);if(this.flashId==null){if(this.onPlayFailed!=null)this.onPlayFailed(this);this.cleanUp();return!1}this.playState=createjs.SoundJS.PLAY_SUCCEEDED;this.owner.registerSoundInstance(this.flashId,
+this);return!0},playFailed:function(){this.playState=createjs.SoundJS.PLAY_FAILED;if(this.onPlayFailed!=null)this.onPlayFailed(this);this.cleanUp()},pause:function(){this.paused=!0;return this.flash.pauseSound(this.flashId)},resume:function(){this.paused=!1;return this.flash.resumeSound(this.flashId)},stop:function(){this.playState=createjs.SoundJS.PLAY_FINISHED;this.paused=!1;var a=this.flash.stopSound(this.flashId);this.cleanUp();return a},setVolume:function(a){this.volume=a;return this.flash.setVolume(this.flashId,
+a)},getVolume:function(){return this.volume},mute:function(a){return(this.muted=a)?this.flash.muteSound(this.flashId):this.flash.unmuteSound(this.flashId)},getPan:function(){return this.pan},setPan:function(a){this.pan=a;return this.flash.setPan(this.flashId,a)},getPosition:function(){return this.flash.getPosition(this.flashId)},setPosition:function(a){return this.flash.setPosition(this.flashId,a)},getDuration:function(){return this.flash.getDuration(this.flashId)},handleSoundFinished:function(){this.playState=
+createjs.SoundJS.PLAY_FINISHED;if(this.onComplete!=null)this.onComplete(this);this.cleanUp()},handleLoop:function(){if(this.onLoop!=null)this.onLoop(this)},toString:function(){return"[FlashPlugin SoundInstance]"}};D.prototype={flash:null,src:null,flashId:null,progress:-1,readyState:0,loading:!1,onloaded:null,onprogress:null,onError:null,init:function(a,d){this.src=a;this.flash=d},initialize:function(a){this.flash=a;this.loading&&this.load(this.src)},load:function(a){if(this.flash==null)return loading=
+!0,!1;this.flashId=this.flash.preload(a);this.owner.registerPreloadInstance(this.flashId,this);return!0},handleProgress:function(a,d){this.progress=a/d;if(this.onprogress!=null)this.onprogress({loaded:a,total:d,progress:this.progress})},handleComplete:function(){this.progress=1;this.readyState=4;if(this.onloaded!=null)this.onloaded()},handleError:function(a){if(this.onerror!=null)this.onerror(a)},toString:function(){return"[FlashPlugin SoundLoader]"}}})(createjs||(createjs={}));var createjs;
BIN  src/soundjs/FlashAudioPlugin.swf
View
Binary file not shown
58 src/soundjs/FlashPlugin.js
View
@@ -30,7 +30,7 @@
/**
* @module SoundJS
*/
-(function(window) {
+(function(ns) {
/**
* Play sounds using a Flash instance. This plugin requires swfObject.as
@@ -43,6 +43,8 @@
this.init();
}
+ var s = FlashPlugin;
+
/**
* The capabilities of the plugin.
* @property capabilities
@@ -50,7 +52,7 @@
* @default null
* @static
*/
- FlashPlugin.capabilities = null;
+ s.capabilities = null;
/**
* The path relative to the HTML page that the FlashAudioPlugin.swf resides.
@@ -60,10 +62,10 @@
* @default src/soundjs
* @static
*/
- FlashPlugin.BASE_PATH = "src/soundjs";
+ s.BASE_PATH = "src/soundjs/";
// Protected static
- FlashPlugin.lastId = 0;
+ s.lastId = 0;
/**
* Determine if the plugin can be used.
@@ -71,9 +73,9 @@
* @return {Boolean} If the plugin can be initialized.
* @static
*/
- FlashPlugin.isSupported = function() {
- if (SoundJS.BrowserDetect.isIOS) { return false; }
- FlashPlugin.generateCapabilities();
+ s.isSupported = function() {
+ if (createjs.SoundJS.BrowserDetect.isIOS) { return false; }
+ s.generateCapabilities();
if (swfobject == null) {
return false;
}
@@ -86,9 +88,9 @@
* @method generateCapabiities
* @static
*/
- FlashPlugin.generateCapabilities = function() {
- if (FlashPlugin.capabilities != null) { return; }
- var c = FlashPlugin.capabilities = {
+ s.generateCapabilities = function() {
+ if (s.capabilities != null) { return; }
+ var c = s.capabilities = {
panning: true,
volume: true,
mp3: true,
@@ -101,7 +103,7 @@
};
- var p = FlashPlugin.prototype = {
+ var p = s.prototype = {
CONTAINER_ID: "flashAudioContainer",
capabilities: null,
@@ -116,7 +118,7 @@
init: function() {
- this.capabilities = FlashPlugin.capabilities;
+ this.capabilities = s.capabilities;
this.flashInstances = {};
this.flashPreloadInstances = {};
@@ -129,9 +131,9 @@
document.body.appendChild(c);
// Embed SWF
- var val = swfobject.embedSWF(FlashPlugin.BASE_PATH + "FlashAudioPlugin.swf", this.CONTAINER_ID, "1", "1",//550", "400",
+ var val = swfobject.embedSWF(s.BASE_PATH + "FlashAudioPlugin.swf", this.CONTAINER_ID, "1", "1",//550", "400",
"9.0.0",null,null,null,null,
- SoundJS.proxy(this.handleSWFReady, this)
+ createjs.SoundJS.proxy(this.handleSWFReady, this)
);
//TODO: Internal detection instead of swfobject
@@ -141,9 +143,8 @@
this.flash = e.ref;
//TODO: Confirm that any instances that are asked to be preloaded before this are queued until Flash is ready.
- //TODO: Wait for a pre-determined time (2 sec?) and dispatch error, since we aren't loaded.
this.loadTimeout = setTimeout(function() {
- SoundJS.proxy(this.handleTimeout, this);
+ createjs.SoundJS.proxy(this.handleTimeout, this);
}, 2000);
},
@@ -274,7 +275,7 @@
}
- window.SoundJS.FlashPlugin = FlashPlugin;
+ ns.FlashPlugin = FlashPlugin;
/**
@@ -361,7 +362,7 @@
onPlayInterrupted: null,
init: function(src, flash) {
- this.uniqueId = FlashPlugin.lastId++;
+ this.uniqueId = s.lastId++;
this.src = src;
this.flash = flash;
},
@@ -373,7 +374,7 @@
// Public API
interrupt: function() {
- this.playState = SoundJS.PLAY_INTERRUPTED;
+ this.playState = createjs.SoundJS.PLAY_INTERRUPTED;
if (this.onPlayInterrupted != null) { this.onPlayInterrupted(this); }
this.flash.interrupt(this.flashId);
this.cleanUp();
@@ -381,7 +382,7 @@
cleanUp: function() {
this.owner.unregisterSoundInstance(this.flashId);
- SoundJS.playFinished(this);
+ createjs.SoundJS.playFinished(this);
},
/**
@@ -390,7 +391,7 @@
* @private
*/
play: function(interrupt, delay, offset, loop, volume, pan) {
- SoundJS.playInstance(this, interrupt, delay, offset, loop, volume, pan);
+ createjs.SoundJS.playInstance(this, interrupt, delay, offset, loop, volume, pan);
},
beginPlaying: function(offset, loop, volume, pan) {
@@ -403,11 +404,17 @@
this.cleanUp();
return false;
}
- this.playState = SoundJS.PLAY_SUCCEEDED;
+ this.playState = createjs.SoundJS.PLAY_SUCCEEDED;
this.owner.registerSoundInstance(this.flashId, this);
return true;
},
+ playFailed: function() {
+ this.playState = createjs.SoundJS.PLAY_FAILED;
+ if (this.onPlayFailed != null) { this.onPlayFailed(this); }
+ this.cleanUp();
+ },
+
/**
* Pause the instance.
* @private
@@ -431,7 +438,7 @@
* @private
*/
stop: function() {
- this.playState = SoundJS.PLAY_FINISHED;
+ this.playState = createjs.SoundJS.PLAY_FINISHED;
this.paused = false;
var ok = this.flash.stopSound(this.flashId);
this.cleanUp();
@@ -507,7 +514,7 @@
// Flash callbacks
handleSoundFinished: function() {
- this.playState = SoundJS.PLAY_FINISHED;
+ this.playState = createjs.SoundJS.PLAY_FINISHED;
if (this.onComplete != null) { this.onComplete(this); }
this.cleanUp();
},
@@ -631,4 +638,5 @@
}
-}(window))
+}(createjs||(createjs={})));
+var createjs;
95 src/soundjs/HTMLAudioPlugin.js
View
@@ -30,7 +30,7 @@
/**
* @module SoundJS
*/
-(function(window) {
+(function(ns) {
/**
* Play sounds using HTML <audio> tags in the browser.
@@ -41,6 +41,8 @@
this.init();
}
+ var s = HTMLAudioPlugin;
+
/**
* The maximum number of instances that can be played. This is a browser limitation.
* @property MAX_INSTANCES
@@ -48,7 +50,7 @@
* @default 30
* @static
*/
- HTMLAudioPlugin.MAX_INSTANCES = 30;
+ s.MAX_INSTANCES = 30;
/**
* The capabilities of the plugin.
@@ -57,18 +59,18 @@
* @default null
* @static
*/
- HTMLAudioPlugin.capabilities = null;
+ s.capabilities = null;
- HTMLAudioPlugin.lastId = 0;
+ s.lastId = 0;
// Event constants
- HTMLAudioPlugin.AUDIO_READY = "canplaythrough";
- HTMLAudioPlugin.AUDIO_ENDED = "ended";
- HTMLAudioPlugin.AUDIO_ERROR = "error"; //TODO: Handle error cases
- HTMLAudioPlugin.AUDIO_STALLED = "stalled";
+ s.AUDIO_READY = "canplaythrough";
+ s.AUDIO_ENDED = "ended";
+ s.AUDIO_ERROR = "error"; //TODO: Handle error cases
+ s.AUDIO_STALLED = "stalled";
//TODO: Not used. Chrome can not do this when loading audio from a server.
- HTMLAudioPlugin.fillChannels = false;
+ s.fillChannels = false;
/**
* Determine if the plugin can be used.
@@ -76,11 +78,11 @@
* @return {Boolean} If the plugin can be initialized.
* @static
*/
- HTMLAudioPlugin.isSupported = function() {
- if (SoundJS.BrowserDetect.isIOS) { return false; }
+ s.isSupported = function() {
+ if (createjs.SoundJS.BrowserDetect.isIOS) { return false; }
- HTMLAudioPlugin.generateCapabilities();
- var t = HTMLAudioPlugin.tag;
+ s.generateCapabilities();
+ var t = s.tag;
if (t == null || t.canPlayType == null) { return false; }
return true;
};
@@ -90,29 +92,29 @@
* @method generateCapabiities
* @static
*/
- HTMLAudioPlugin.generateCapabilities = function() {
- if (HTMLAudioPlugin.capabilities != null) { return; }
- var t = HTMLAudioPlugin.tag = document.createElement("audio");
- var c = HTMLAudioPlugin.capabilities = {
+ s.generateCapabilities = function() {
+ if (s.capabilities != null) { return; }
+ var t = s.tag = document.createElement("audio");
+ var c = s.capabilities = {
panning: false,
volume: true,
mp3: t.canPlayType("audio/mp3") != "no" && t.canPlayType("audio/mp3") != "",
ogg: t.canPlayType("audio/ogg") != "no" && t.canPlayType("audio/ogg") != "",
mpeg: t.canPlayType("audio/mpeg") != "no" && t.canPlayType("audio/mpeg") != "",
wav:t.canPlayType("audio/wav") != "no" && t.canPlayType("audio/wav") != "",
- channels: HTMLAudioPlugin.MAX_INSTANCES
+ channels: s.MAX_INSTANCES
};
// TODO: Other props?
}
- var p = HTMLAudioPlugin.prototype = {
+ var p = s.prototype = {
capabilities: null,
FT: 0.001,
channels: null,
init: function() {
- this.capabilities = HTMLAudioPlugin.capabilities;
+ this.capabilities = s.capabilities;
this.channels = {};
},
@@ -161,7 +163,7 @@
}
- window.SoundJS.HTMLAudioPlugin = HTMLAudioPlugin;
+ ns.HTMLAudioPlugin = HTMLAudioPlugin;
@@ -214,7 +216,7 @@
owner: null,
loaded: false,
- lastInterrupt: SoundJS.INTERRUPT_NONE,
+ lastInterrupt: createjs.SoundJS.INTERRUPT_NONE,
offset: 0,
delay: 0,
volume: 1,
@@ -280,11 +282,11 @@
// Constructor
init: function(src) {
- this.uniqueId = HTMLAudioPlugin.lastId++;
+ this.uniqueId = ns.HTMLAudioPlugin.lastId++;
this.src = src;
- this.endedHandler = SoundJS.proxy(this.handleSoundComplete, this);
- this.readyHandler = SoundJS.proxy(this.handleSoundReady, this);
- this.stalledHandler = SoundJS.proxy(this.handleSoundStalled, this);
+ this.endedHandler = createjs.SoundJS.proxy(this.handleSoundComplete, this);
+ this.readyHandler = createjs.SoundJS.proxy(this.handleSoundReady, this);
+ this.stalledHandler = createjs.SoundJS.proxy(this.handleSoundStalled, this);
},
cleanUp: function() {
@@ -292,17 +294,17 @@
if (tag != null) {
tag.pause();
try { tag.currentTime = 0; } catch (e) {} // Reset Position
- tag.removeEventListener(HTMLAudioPlugin.AUDIO_ENDED, this.endedHandler, false);
- tag.removeEventListener(HTMLAudioPlugin.AUDIO_READY, this.readyHandler, false);
+ tag.removeEventListener(ns.HTMLAudioPlugin.AUDIO_ENDED, this.endedHandler, false);
+ tag.removeEventListener(ns.HTMLAudioPlugin.AUDIO_READY, this.readyHandler, false);
TagChannel.setInstance(this.src, tag);
this.tag = null;
}
- SoundJS.playFinished(this);
+ createjs.SoundJS.playFinished(this);
},
interrupt: function () {
if (this.tag == null) { return; }
- this.playState = SoundJS.PLAY_INTERRUPTED;
+ this.playState = createjs.SoundJS.PLAY_INTERRUPTED;
if (this.onPlayInterrupted) { this.onPlayInterrupted(this); }
this.cleanUp();
this.paused = false;
@@ -322,7 +324,7 @@
*/
play: function(interrupt, delay, offset, loop, volume, pan) {
this.cleanUp();
- SoundJS.playInstance(this, interrupt, delay, offset, loop, volume, pan);
+ createjs.SoundJS.playInstance(this, interrupt, delay, offset, loop, volume, pan);
},
// Called by SoundJS when ready
@@ -330,7 +332,7 @@
var tag = this.tag = TagChannel.getInstance(this.src);
if (tag == null) { this.playFailed(); return -1; }
- tag.addEventListener(HTMLAudioPlugin.AUDIO_ENDED, this.endedHandler, false);
+ tag.addEventListener(ns.HTMLAudioPlugin.AUDIO_ENDED, this.endedHandler, false);
this.offset = offset;
this.volume = volume;
@@ -338,8 +340,8 @@
this.remainingLoops = loop;
if (tag.readyState !== 4) {
- tag.addEventListener(HTMLAudioPlugin.AUDIO_READY, this.readyHandler, false);
- tag.addEventListener(HTMLAudioPlugin.AUDIO_STALLED, this.stalledHandler, false);
+ tag.addEventListener(ns.HTMLAudioPlugin.AUDIO_READY, this.readyHandler, false);
+ tag.addEventListener(ns.HTMLAudioPlugin.AUDIO_STALLED, this.stalledHandler, false);
tag.load();
} else {
this.handleSoundReady(null);
@@ -354,9 +356,9 @@
},
handleSoundReady: function(event) {
- this.playState = SoundJS.PLAY_SUCCEEDED;
+ this.playState = createjs.SoundJS.PLAY_SUCCEEDED;
this.paused = false;
- this.tag.removeEventListener(HTMLAudioPlugin.AUDIO_READY, this.readyHandler, false);
+ this.tag.removeEventListener(ns.HTMLAudioPlugin.AUDIO_READY, this.readyHandler, false);
if(this.offset >= this.getDuration()) {
this.playFailed();
@@ -403,7 +405,7 @@
*/
stop: function() {
this.pause();
- this.playState = SoundJS.PLAY_FINISHED;
+ this.playState = createjs.SoundJS.PLAY_FINISHED;
this.cleanUp();
return true;
},
@@ -428,7 +430,7 @@
updateVolume: function() {
if (this.tag != null) {
- this.tag.volume = this.muted ? 0 : this.volume * SoundJS.masterVolume;
+ this.tag.volume = this.muted ? 0 : this.volume * createjs.SoundJS.masterVolume;
return true;
} else {
return false;
@@ -516,20 +518,20 @@
return;
}
- this.playState = SoundJS.PLAY_FINISHED;
+ this.playState = createjs.SoundJS.PLAY_FINISHED;
if (this.onComplete != null) { this.onComplete(this); }
this.cleanUp();
},
// Play has failed
playFailed: function() {
- this.playState = SoundJS.PLAY_FAILED;
+ this.playState = createjs.SoundJS.PLAY_FAILED;
if (this.onPlayFailed != null) { this.onPlayFailed(this); }
this.cleanUp();
},
toString: function() {
- return "[HTMLAudio SoundInstance]";
+ return "[HTMLAudioPlugin SoundInstance]";
}
}
@@ -553,7 +555,8 @@
* @private
*/
TagChannel.channels = {};
- /** Get a tag channel.
+ /**
+ * Get a tag channel.
* @private
*/
TagChannel.get = function(src) {
@@ -564,7 +567,8 @@
return channel;
}
- /** Get a tag instance. This is a shortcut method.
+ /**
+ * Get a tag instance. This is a shortcut method.
* @private
*/
TagChannel.getInstance = function(src) {
@@ -624,6 +628,5 @@
}
}
-
-
-}(window));
+}(createjs||(createjs={})));
+var createjs;
181 src/soundjs/SoundJS.js
View
@@ -42,7 +42,7 @@
*
* @module SoundJS
*/
-(function(window) {
+(function(ns) {
//TODO: Interface to validate plugins and throw warnings
//TODO: Determine if methods exist on a plugin before calling
@@ -64,6 +64,8 @@
throw "SoundJS cannot be instantiated";
}
+ var s = SoundJS;
+
/**
* Determine how audio is split, when multiple paths are specified in a source.
* @property DELIMITER
@@ -71,7 +73,7 @@
* @default |
* @static
*/
- SoundJS.DELIMITER = "|";
+ s.DELIMITER = "|";
/**
* The duration in milliseconds to determine a timeout.
@@ -80,7 +82,7 @@
* @type Number
* @default 8000
*/
- SoundJS.AUDIO_TIMEOUT = 8000; //TODO: Not fully implemented
+ s.AUDIO_TIMEOUT = 8000; //TODO: Not fully implemented
/**
* The interrupt value to use to interrupt any currently playing instance with the same source.
@@ -89,7 +91,7 @@
* @default any
* @static
*/
- SoundJS.INTERRUPT_ANY = "any";
+ s.INTERRUPT_ANY = "any";
/**
* The interrupt value to use to interrupt the earliest currently playing instance with the same source.
@@ -98,7 +100,7 @@
* @default early
* @static
*/
- SoundJS.INTERRUPT_EARLY = "early";
+ s.INTERRUPT_EARLY = "early";
/**
* The interrupt value to use to interrupt the latest currently playing instance with the same source.
@@ -107,7 +109,7 @@
* @default late
* @static
*/
- SoundJS.INTERRUPT_LATE = "late";
+ s.INTERRUPT_LATE = "late";
/**
* The interrupt value to use to interrupt no currently playing instances with the same source.
@@ -116,7 +118,7 @@
* @default none
* @static
*/
- SoundJS.INTERRUPT_NONE = "none";
+ s.INTERRUPT_NONE = "none";
// Important, implement playState in plugins with these values.
@@ -127,7 +129,7 @@
* @default playInited
* @static
*/
- SoundJS.PLAY_INITED = "playInited";
+ s.PLAY_INITED = "playInited";
/**
* Defines the playState of an instance that is currently playing or paused.
@@ -136,7 +138,7 @@
* @default playSucceeded
* @static
*/
- SoundJS.PLAY_SUCCEEDED = "playSucceeded";
+ s.PLAY_SUCCEEDED = "playSucceeded";
/**
* Defines the playState of an instance that was interrupted by another instance.
@@ -145,7 +147,7 @@
* @default playInterrupted
* @static
*/
- SoundJS.PLAY_INTERRUPTED = "playInterrupted";
+ s.PLAY_INTERRUPTED = "playInterrupted";
/**
* Defines the playState of an instance that completed playback.
@@ -154,7 +156,7 @@
* @default playFinished
* @static
*/
- SoundJS.PLAY_FINISHED = "playFinished";
+ s.PLAY_FINISHED = "playFinished";
/**
* Defines the playState of an instance that failed to play. This is usually caused by a lack of available channels
@@ -164,7 +166,7 @@
* @default playFailed
* @static
*/
- SoundJS.PLAY_FAILED = "playFailed";
+ s.PLAY_FAILED = "playFailed";
/**
* The currently active plugin. If this is null, then no plugin could be initialized.
@@ -174,7 +176,7 @@
* @default null
* @static
*/
- SoundJS.activePlugin = null;
+ s.activePlugin = null;
/**
* SoundJS is currently muted. No audio will play, unless existing instances are unmuted.
@@ -182,17 +184,17 @@
* @type {Boolean}
* @readonly
*/
- SoundJS.muted = false;
+ s.muted = false;
// Private
- SoundJS.pluginsRegistered = false;
- SoundJS.masterVolume = 1;
- SoundJS.muted = false;
- SoundJS.instances = [];
- SoundJS.instanceHash = {};
- SoundJS.idHash = null;
- SoundJS.defaultSoundInstance = null;
+ s.pluginsRegistered = false;
+ s.masterVolume = 1;
+ s.muted = false;
+ s.instances = [];
+ s.instanceHash = {};
+ s.idHash = null;
+ s.defaultSoundInstance = null;
/**
* Get the preload rules to be used by PreloadJS. This function should not be called, except by PreloadJS.
@@ -200,9 +202,9 @@
* @static
* @private
*/
- SoundJS.getPreloadHandlers = function() {
+ s.getPreloadHandlers = function() {
return {
- callback: SoundJS.proxy(SoundJS.initLoad, SoundJS),
+ callback: s.proxy(s.initLoad, s),
types: ["sound"],
extensions: ["mp3", "ogg", "wav"]
}
@@ -215,14 +217,14 @@
* @return {Boolean} Whether a plugin was successfully initialized.
* @static
*/
- SoundJS.registerPlugins = function(plugins) {
- SoundJS.pluginsRegistered = true;
+ s.registerPlugins = function(plugins) {
+ s.pluginsRegistered = true;
for (var i=0, l=plugins.length; i<l; i++) {
var plugin = plugins[i];
if (plugin == null) { continue; } // In case a plugin is not defined.
// Note: Each plugin is passed in as a class reference, but we store the activePlugin as an instances
if (plugin.isSupported()) {
- SoundJS.activePlugin = new plugin();
+ s.activePlugin = new plugin();
//TODO: Check error on initialization?
return true;
}
@@ -239,10 +241,10 @@
* @return {Boolean} Whether the plugin was successfully initialized.
* @static
*/
- SoundJS.registerPlugin = function(plugin) {
- SoundJS.pluginsRegistered = true;
+ s.registerPlugin = function(plugin) {
+ s.pluginsRegistered = true;
if (plugin.isSupported()) {
- SoundJS.activePlugin = new plugin();
+ s.activePlugin = new plugin();
return true;
}
return false;
@@ -254,8 +256,8 @@
* @return {Boolean} If SoundJS has initialized a plugin.
* @static
*/
- SoundJS.isReady = function() {
- return (SoundJS.activePlugin != null);
+ s.isReady = function() {
+ return (s.activePlugin != null);
}
/**
@@ -267,14 +269,16 @@
* <li><b>volume;</b> If the plugin can control audio volume.</li>
* <li><b>mp3:</b> If MP3 audio is supported.</li>
* <li><b>ogg:</b> If OGG audio is supported.</li>
+ * <li><b>wav:</b> If WAV audio is supported.</li>
* <li><b>mpeg:</b> If MPEG audio is supported.</li>
* <li><b>channels:</b> The maximum number of audio channels that can be created.</li>
* @method getCapabilities
* @return {Object} An object containing the capabilities of the active plugin.
* @static
*/
- SoundJS.getCapabilities = function() {
- return SoundJS.activePlugin ? SoundJS.activePlugin.capabilities : null;
+ s.getCapabilities = function() {
+ if (s.activePlugin == null) { return null; }
+ return s.activePlugin.capabilities;
}
/**
@@ -285,9 +289,9 @@
* @return {String | Number | Boolean} The capability value.
* @static
*/
- SoundJS.getCapability = function(key) {
- if (SoundJS.activePlugin == null) { return null; }
- return SoundJS.activePlugin.capabilities[key];
+ s.getCapability = function(key) {
+ if (s.activePlugin == null) { return null; }
+ return s.activePlugin.capabilities[key];
}
/**
@@ -300,19 +304,19 @@
* @return {Object} An object with the modified values that were passed in.
* @private
*/
- SoundJS.initLoad = function(src, type, id, data) {
- if (!SoundJS.checkPlugin(true)) { return false; }
+ s.initLoad = function(src, type, id, data) {
+ if (!s.checkPlugin(true)) { return false; }
- var details = SoundJS.parsePath(src, type, id, data);
+ var details = s.parsePath(src, type, id, data);
if (details == null) { return false; }
if (id != null) {
- if (SoundJS.idHash == null) { SoundJS.idHash = {}; }
- SoundJS.idHash[id] = details.src;
+ if (s.idHash == null) { s.idHash = {}; }
+ s.idHash[id] = details.src;
}
var ok = SoundChannel.create(details.src, data);
- var instance = SoundJS.activePlugin.register(details.src, data);
+ var instance = s.activePlugin.register(details.src, data);
if (instance != null) {
// If the instance returns a tag, return it instead for preloading.
if (instance.tag != null) { details.tag = instance.tag; }
@@ -333,12 +337,12 @@
* @return {Object} A formatted object to load.
* @private
*/
- SoundJS.parsePath = function(value, type, id, data) {
+ s.parsePath = function(value, type, id, data) {
// Assume value is string.
- var sounds = value.split(SoundJS.DELIMITER);
- var ret = {type:type||"sound", id:id, data:data, handler:SoundJS.handleSoundReady};
+ var sounds = value.split(s.DELIMITER);
+ var ret = {type:type||"sound", id:id, data:data, handler:s.handleSoundReady};
var found = false;
- var c = SoundJS.getCapabilities();
+ var c = s.getCapabilities();
for (var i=0, l=sounds.length; i<l; i++) {
var sound = sounds[i];
var point = sound.lastIndexOf(".");
@@ -387,12 +391,12 @@
* @return {SoundInstance} A SoundInstance that can be controlled after it is created.
* @static
*/
- SoundJS.play = function (src, interrupt, delay, offset, loop, volume, pan) {
- if (!SoundJS.checkPlugin(true)) { return SoundJS.defaultSoundInstance; }
- src = SoundJS.getSrcFromId(src);
- var instance = SoundJS.activePlugin.create(src);
- instance.mute(SoundJS.muted);
- var ok = SoundJS.playInstance(instance, interrupt, delay, offset, loop, volume, pan);
+ s.play = function (src, interrupt, delay, offset, loop, volume, pan) {
+ if (!s.checkPlugin(true)) { return s.defaultSoundInstance; }
+ src = s.getSrcFromId(src);
+ var instance = s.activePlugin.create(src);
+ instance.mute(s.muted);
+ var ok = s.playInstance(instance, interrupt, delay, offset, loop, volume, pan);
if (!ok) { instance.playFailed(); }
return instance;
}
@@ -404,8 +408,8 @@
* @return {Boolean} If the sound can start playing.
* @protected
*/
- SoundJS.playInstance = function(instance, interrupt, delay, offset, loop, volume, pan) {
- interrupt = interrupt || SoundJS.INTERRUPT_NONE;
+ s.playInstance = function(instance, interrupt, delay, offset, loop, volume, pan) {
+ interrupt = interrupt || s.INTERRUPT_NONE;
if (delay == null) { delay = 0; }
if (offset == null) { offset = 0; }
if (loop == null) { loop = 0; }
@@ -413,12 +417,12 @@
if (pan == null) { pan = 0; }
if (delay == 0) {
- var ok = SoundJS.beginPlaying(instance, interrupt, offset, loop, volume, pan);
+ var ok = s.beginPlaying(instance, interrupt, offset, loop, volume, pan);
if (!ok) { return false; }
} else {
//Note that we can't pass arguments to proxy OR setTimeout (IE), so just wrap the function call.
setTimeout(function() {
- SoundJS.beginPlaying(instance, interrupt, offset, loop, volume, pan);
+ s.beginPlaying(instance, interrupt, offset, loop, volume, pan);
}, delay); //LM: Can not stop before timeout elapses. Maybe add timeout interval to instance?
}
@@ -433,7 +437,7 @@
* @method beginPlaying
* @protected
*/
- SoundJS.beginPlaying = function(instance, interrupt, offset, loop, volume, pan) {
+ s.beginPlaying = function(instance, interrupt, offset, loop, volume, pan) {
if (!SoundChannel.add(instance, interrupt)) { return false; }
var result = instance.beginPlaying(offset, loop, volume, pan);
if (!result) {
@@ -453,12 +457,12 @@
* @returns If a plugin is initialized. If the browser does not have the capabilities to initialize
* an available plugin, this will be false.
*/
- SoundJS.checkPlugin = function(initializeDefault) {
- if (SoundJS.activePlugin == null) {
- if (initializeDefault && !SoundJS.pluginsRegistered) {
- SoundJS.registerPlugin(SoundJS.HTMLAudioPlugin);
+ s.checkPlugin = function(initializeDefault) {
+ if (s.activePlugin == null) {
+ if (initializeDefault && !s.pluginsRegistered) {
+ s.registerPlugin(createjs.HTMLAudioPlugin);
}
- if (SoundJS.activePlugin == null) {
+ if (s.activePlugin == null) {
return false;
}
}
@@ -473,9 +477,9 @@
* @return {String} The source of the sound.
* @static
*/
- SoundJS.getSrcFromId = function(value) {
- if (SoundJS.idHash == null || SoundJS.idHash[value] == null) { return value; }
- return SoundJS.idHash[value];
+ s.getSrcFromId = function(value) {
+ if (s.idHash == null || s.idHash[value] == null) { return value; }
+ return s.idHash[value];
}
@@ -491,12 +495,12 @@
* @return {Boolean} If the volume was set.
* @static
*/
- SoundJS.setVolume = function(value, id) {
+ s.setVolume = function(value, id) {
// don't deal with null volume
if (Number(value) == null) { return false; }
value = Math.max(0, Math.min(1, value));
- return SoundJS.tellAllInstances("setVolume", id, value);
+ return s.tellAllInstances("setVolume", id, value);
/*SoundJS.activePlugin.setVolume(value, SoundJS.getSrcFromId(id));*/
//return true;
}
@@ -507,7 +511,7 @@
* @return {Number} The master volume
* @static
*/
- SoundJS.getMasterVolume = function() { return SoundJS.masterVolume; }
+ s.getMasterVolume = function() { return s.masterVolume; }
/**
* To set the volume of all instances at once, use the setVolume() method.
* @method setMasterVolume
@@ -515,9 +519,9 @@
* @return {Boolean} If the master volume was set.
* @static
*/
- SoundJS.setMasterVolume = function(value) {
- SoundJS.masterVolume = value;
- return SoundJS.tellAllInstances("setMasterVolume", null, value);
+ s.setMasterVolume = function(value) {
+ s.masterVolume = value;
+ return s.tellAllInstances("setMasterVolume", null, value);
}
/**
@@ -529,9 +533,9 @@
* @return {Boolean} If the mute was set.
* @static
*/
- SoundJS.setMute = function(isMuted) {
+ s.setMute = function(isMuted) {
this.muted = isMuted;
- return SoundJS.tellAllInstances("mute", null, isMuted);
+ return s.tellAllInstances("mute", null, isMuted);
}
/**
@@ -541,8 +545,8 @@
* @return If the audio was paused or not.
* @static
*/
- SoundJS.pause = function(id) {
- return SoundJS.tellAllInstances("pause", id);
+ s.pause = function(id) {
+ return s.tellAllInstances("pause", id);
}
/**
@@ -554,8 +558,8 @@
* @return If the audio was resumed or not
* @static
*/
- SoundJS.resume = function(id) {
- return SoundJS.tellAllInstances("resume", id);
+ s.resume = function(id) {
+ return s.tellAllInstances("resume", id);
}
/**
@@ -565,8 +569,8 @@
* @return If the audio was stopped or not.
* @static
*/
- SoundJS.stop = function(id) {
- return SoundJS.tellAllInstances("stop", id);
+ s.stop = function(id) {
+ return s.tellAllInstances("stop", id);
}
/**
@@ -578,7 +582,7 @@
* @return {SoundInstance} The sound instance with the specified ID.
* @static
*/
- SoundJS.getInstanceById = function(uniqueId) {
+ s.getInstanceById = function(uniqueId) {
return this.instanceHash[uniqueId];
}
@@ -590,7 +594,7 @@
* @param {SoundInstance} instance The instance that finished playback.
* @private
*/
- SoundJS.playFinished = function(instance) {
+ s.playFinished = function(instance) {
SoundChannel.remove(instance);
this.instances.splice(this.instances.indexOf(instance), 1);
// Note: Keep in instance hash.
@@ -601,7 +605,7 @@
* to only sounds matching that id (or source).
* @private
*/
- SoundJS.tellAllInstances = function(command, id, value) {
+ s.tellAllInstances = function(command, id, value) {
if (this.activePlugin == null) { return false; }
var src = this.getSrcFromId(id);
for (var i=this.instances.length-1; i>=0; i--) {
@@ -637,14 +641,14 @@
* @static
* @private
*/
- SoundJS.proxy = function(method, scope) {
+ s.proxy = function(method, scope) {
return function() {
return method.apply(scope, arguments);
}
}
// Put SoundJS on window for Global Access
- window.SoundJS = SoundJS;
+ ns.SoundJS = SoundJS;
@@ -859,9 +863,11 @@
// This is a dummy sound instance, which allows SoundJS to return something so
// developers don't need to check nulls.
function SoundInstance() {
- this.pause = this.resume = this.play = this.beginPlaying = this.cleanUp = this.interrupt = this.stop = this.setMasterVolume = this.setVolume = this.mute = this.setPan = this.getPosition = this.setPosition = this.toString = function() { return false; };
+ this.isDefault = true;
+ this.pause = this.resume = this.play = this.beginPlaying = this.cleanUp = this.interrupt = this.stop = this.setMasterVolume = this.setVolume = this.mute = this.setPan = this.getPosition = this.setPosition = this.playFailed = function() { return false; };
this.getVolume = this.getPan = this.getDuration = function() { return 0; }
this.playState = SoundJS.PLAY_FAILED;
+ this.toString = function() { return "[SoundJS Default Sound Instance]"; }
}
SoundJS.defaultSoundInstance = new SoundInstance();
@@ -880,6 +886,7 @@
BrowserDetect.init();
- SoundJS.BrowserDetect = BrowserDetect;
+ ns.SoundJS.BrowserDetect = BrowserDetect;
-}(window));
+}(createjs||(createjs={})));
+var createjs;
Please sign in to comment.
Something went wrong with that request. Please try again.