Permalink
Browse files

Removed log references in source. Updated demos.

Signed-off-by: Lanny McNie <lanny@gskinner.com>
  • Loading branch information...
1 parent fd0845d commit 7b9e626887e97d4e4603f726444e04ff3ac1637f @lannymcnie lannymcnie committed Apr 16, 2012
View
@@ -108,10 +108,7 @@
}
function updateLoading() {
- var states = "/-\|";
- var index = states.indexOf(messageField.text.charAt(8));
- var newIndex = (index == -1 || index == states.length-1) ? 0 : index+1;
- messageField.text = "Loading " + (preload.progress*100|0) + "% " + states.charAt(newIndex);
+ messageField.text = "Loading " + (preload.progress*100|0) + "%"
stage.update();
}
@@ -79,7 +79,6 @@
$("#playBtn").click(function(event){
if (instance.playState == SoundJS.PLAY_FINISHED) {
instance.play();
- console.log("PAUSED?",instance.paused)
$("#playBtn").removeClass("playBtn").addClass("pauseBtn");
trackTime();
return;
@@ -161,7 +161,7 @@
function handleFileLoad(event) {
var list = $("#library").get(0);
var item = event.result;
- list.options.add(new Option((event.id || event.src) + " ("+(event.data||0)+")", event.id));
+ list.options.add(new Option((event.id || event.src) + " ("+(event.data||1)+")", event.id));
}
function handleProgress(event) {}
@@ -408,16 +408,11 @@
<td><div class="offsetSlider" id="offset" data-units="second"></div></td>
<td><label for="offset" id="offsetValue">0 seconds</label></td>
</tr>
- <tr>
+ <tr rowCount="2">
<td><label for="masterVolume" class="nodisable">Master Volume</label></td>
<td> <div class="masterVolumeSlider" id="masterVolume"></div></td>
<td><label for="masterVolume" id="masterVolumeValue">100</label></td>
</tr>
- <tr>
- <td></label></td>
- <td></td>
- <td><br /></td>
- </tr>
</table>
<input id="stopAllSoundsBtn" name="stopAll" type="button" value="Stop All Sounds" />
</form>
Oops, something went wrong.
@@ -24,9 +24,9 @@ b.capabilities={panning:false,volume:true,mp3:a.canPlayType("audio/mp3")!="no"&&
createTag:function(a){var b=document.createElement("audio");b.preload=false;b.src=a;return b},create:function(a){a=new g(a);a.owner=this;return a},toString:function(){return"[HTMLAudioPlugin]"}};h.SoundJS.HTMLAudioPlugin=b;g.prototype={src:null,uniqueId:-1,playState:null,owner:null,loaded:false,paused:false,lastInterrupt:SoundJS.INTERRUPT_NONE,offset:0,delay:0,volume:1,pan:0,muted:false,remainingLoops:0,delayTimeout:-1,tag:null,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(f){}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,g){this.cleanUp();SoundJS.playInstance(this,a,b,c,e,d,g)},beginPlaying:function(a,f,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=f;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(){SoundJS.log("* Audio Stalled");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()?(SoundJS.log("* Out of range",this.offset,this.tag.currentTime),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);
+c;this.updateVolume();this.remainingLoops=f;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);
Oops, something went wrong.

0 comments on commit 7b9e626

Please sign in to comment.