Skip to content

Commit 772f7b9

Browse files
authored
Merge pull request #720 from f1v-developers/master
510 + 606 + 592- IE bugs. Unsupported mime issues, IE not supporting …
2 parents 5cfdb52 + 39ac41c commit 772f7b9

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/howler.core.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1473,7 +1473,6 @@
14731473
// Remove the source or disconnect.
14741474
if (!self._webAudio) {
14751475
// Set the source to 0-second silence to stop any downloading.
1476-
sounds[i]._node.src = 'data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA';
14771476

14781477
// Remove any event listeners.
14791478
sounds[i]._node.removeEventListener('error', sounds[i]._errorFn, false);
@@ -1654,6 +1653,14 @@
16541653
*/
16551654
_ended: function(sound) {
16561655
var self = this;
1656+
// If we are using IE and there was network latency we may be clipping
1657+
// audio before it completes playing. Lets check the node to make sure it
1658+
// believes it has completed, before ending the playback.
1659+
if (!self._webAudio && !self._node.ended) {
1660+
setTimeout(self._ended.bind(self, sound), 100);
1661+
return self;
1662+
}
1663+
16571664
var sprite = sound._sprite;
16581665

16591666
// Should this sound loop?
@@ -1979,7 +1986,7 @@
19791986
self._parent._emit('loaderror', self._id, self._node.error ? self._node.error.code : 0);
19801987

19811988
// Clear the event listener.
1982-
self._node.removeEventListener('error', self._errorListener, false);
1989+
self._node.removeEventListener('error', self._errorFn, false);
19831990
},
19841991

19851992
/**

0 commit comments

Comments
 (0)