Permalink
Browse files

Fix for case when HTMLAudioSoundInstance is created before loading ha…

…s completed
  • Loading branch information...
OJay Robinson
OJay Robinson committed May 29, 2015
1 parent 128a394 commit 58ff5c0dca1ca12adb7417fa4755f0a2a96b520c
Showing with 1 addition and 3 deletions.
  1. +0 −2 src/soundjs/htmlaudio/HTMLAudioSoundInstance.js
  2. +1 −1 src/soundjs/htmlaudio/HTMLAudioTagPool.js
@@ -268,11 +268,9 @@ this.createjs = this.createjs || {};
}
};
/* This should never change
p._setDurationFromSource = function () {
this._duration = createjs.HTMLAudioTagPool.getDuration(this.src);
};
*/
createjs.HTMLAudioSoundInstance = createjs.promote(HTMLAudioSoundInstance, "AbstractSoundInstance");
}());
@@ -143,7 +143,7 @@ this.createjs = this.createjs || {};
*/
s.getDuration= function (src) {
var t = s._tags[src];
if (t == null) {return 0;}
if (t == null || !t.duration) {return 0;} // OJR duration is NaN if loading has not completed
return t.duration * 1000;
};

0 comments on commit 58ff5c0

Please sign in to comment.