Skip to content

Commit c6b3e9e

Browse files
author
Joel Steres
committed
Update inProgressCount prior to onError callback in loadBuffer
1 parent 17149a3 commit c6b3e9e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/webaudiox.loadbuffer.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var WebAudiox = WebAudiox || {}
22

33
/**
44
* Helper to load a buffer
5-
*
5+
*
66
* @param {AudioContext} context the WebAudio API context
77
* @param {String} url the url of the sound to load
88
* @param {Function} onLoad callback to notify when the buffer is loaded and decoded
@@ -25,14 +25,14 @@ WebAudiox.loadBuffer = function(context, url, onLoad, onError){
2525
// counter inProgress request
2626
WebAudiox.loadBuffer.inProgressCount--
2727
// notify the callback
28-
onLoad(buffer)
29-
// notify
28+
onLoad(buffer)
29+
// notif
3030
WebAudiox.loadBuffer.onLoad(context, url, buffer)
3131
}, function(){
32-
// notify the callback
33-
onError()
3432
// counter inProgress request
3533
WebAudiox.loadBuffer.inProgressCount--
34+
// notify the callback
35+
onError()
3636
})
3737
}
3838
request.send()

0 commit comments

Comments
 (0)