Decouple stopWaiting state from play state

This commit is contained in:
Jordan Eldredge 2015-04-13 22:46:33 -07:00
parent f0a8c7a2b3
commit 340d78d83e
2 changed files with 6 additions and 1 deletions

View file

@ -5,6 +5,7 @@ define({
_buffer: null,
_callbacks: {
waiting: function(){},
stopWaiting: function(){},
playing: function(){},
timeupdate: function(){},
visualizerupdate: function(){},
@ -86,6 +87,7 @@ define({
var loadAudioBuffer = function(buffer) {
this._buffer = buffer;
loadedCallback();
this._callbacks.stopWaiting();
if(this.autoPlay) {
this.play(0);
}

View file

@ -76,9 +76,12 @@ return {
window.dispatchEvent(self.events.startWaiting);
});
this.media.addEventListener('stopWaiting', function() {
window.dispatchEvent(self.events.stopWaiting);
});
this.media.addEventListener('playing', function() {
self.setState('play');
window.dispatchEvent(self.events.stopWaiting);
});
this.fileInput.onchange = function(e){