Skip to content

Commit

Permalink
510 + 606 + 592- IE bugs. Unsupported mime issues, IE not supporting …
Browse files Browse the repository at this point in the history
…base64 audio nor Wav files, Audio clipping before ending
  • Loading branch information
fabioelia committed Mar 16, 2017
1 parent 9592fcb commit 39ac41c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/howler.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1479,7 +1479,6 @@
// Remove the source or disconnect.
if (!self._webAudio) {
// Set the source to 0-second silence to stop any downloading.
sounds[i]._node.src = 'data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA';

// Remove any event listeners.
sounds[i]._node.removeEventListener('error', sounds[i]._errorFn, false);
Expand Down Expand Up @@ -1653,6 +1652,14 @@
*/
_ended: function(sound) {
var self = this;
// If we are using IE and there was network latency we may be clipping
// audio before it completes playing. Lets check the node to make sure it
// believes it has completed, before ending the playback.
if (!self._webAudio && !self._node.ended) {
setTimeout(self._ended.bind(self, sound), 100);
return self;
}

var sprite = sound._sprite;

// Should this sound loop?
Expand Down Expand Up @@ -1980,7 +1987,7 @@
self._parent._emit('loaderror', self._id, self._node.error ? self._node.error.code : 0);

// Clear the event listener.
self._node.removeEventListener('error', self._errorListener, false);
self._node.removeEventListener('error', self._errorFn, false);
},

/**
Expand Down

0 comments on commit 39ac41c

Please sign in to comment.