File tree 1 file changed +9
-2
lines changed 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 1473
1473
// Remove the source or disconnect.
1474
1474
if ( ! self . _webAudio ) {
1475
1475
// Set the source to 0-second silence to stop any downloading.
1476
- sounds [ i ] . _node . src = 'data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA' ;
1477
1476
1478
1477
// Remove any event listeners.
1479
1478
sounds [ i ] . _node . removeEventListener ( 'error' , sounds [ i ] . _errorFn , false ) ;
1654
1653
*/
1655
1654
_ended : function ( sound ) {
1656
1655
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
+
1657
1664
var sprite = sound . _sprite ;
1658
1665
1659
1666
// Should this sound loop?
1979
1986
self . _parent . _emit ( 'loaderror' , self . _id , self . _node . error ? self . _node . error . code : 0 ) ;
1980
1987
1981
1988
// Clear the event listener.
1982
- self . _node . removeEventListener ( 'error' , self . _errorListener , false ) ;
1989
+ self . _node . removeEventListener ( 'error' , self . _errorFn , false ) ;
1983
1990
} ,
1984
1991
1985
1992
/**
You can’t perform that action at this time.
0 commit comments