Fixed #46: better handling of HTTP errors when fetching audio file

This commit is contained in:
Eliot Berriot 2017-12-15 22:03:15 +01:00
parent a4e31cdb9d
commit 13eddbfc21
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
3 changed files with 12 additions and 3 deletions

View file

@ -140,7 +140,6 @@ class Queue {
} else {
index = index || this.tracks.length
}
console.log('INDEEEEEX', index)
tracks.forEach((t) => {
self.append(t, index, true)
index += 1
@ -243,7 +242,11 @@ class Queue {
rate: 1,
loop: false,
volume: this.state.volume,
onEnded: this.handleAudioEnded.bind(this)
onEnded: this.handleAudioEnded.bind(this),
onError: function (src) {
self.errored = true
self.next()
}
})
this.audio = audio
audio.updateHook('playState', function (e) {