Fix error handling and crash in case of unsupported codecs (fixes #10)
This commit is contained in:
parent
90b73796a5
commit
6b1d613d0e
|
@ -97,7 +97,7 @@ class GlobalBindings {
|
|||
|
||||
this.client = client
|
||||
// Prepare for connection errors
|
||||
client.on('error', function (err) {
|
||||
client.on('error', (err) => {
|
||||
log('Connection error:', err)
|
||||
this.resetClient()
|
||||
})
|
||||
|
@ -279,7 +279,7 @@ class GlobalBindings {
|
|||
this.client.disconnect()
|
||||
}
|
||||
this.client = null
|
||||
this.thisUser(null).root(null).selected(null)
|
||||
this.selected(null).root(null).thisUser(null)
|
||||
}
|
||||
|
||||
this.connected = () => this.thisUser() != null
|
||||
|
@ -502,6 +502,9 @@ var resampler = new Resampler({
|
|||
|
||||
var voiceStream
|
||||
resampler.pipe(chunker(4 * 480)).on('data', function (data) {
|
||||
if (!ui.client) {
|
||||
voiceStream = null
|
||||
}
|
||||
if (!voiceStream && ui.client) {
|
||||
voiceStream = ui.client.createVoiceStream()
|
||||
}
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
"libsamplerate.js": "^1.0.0",
|
||||
"mumble-client-codecs-browser": "^1.0.1",
|
||||
"mumble-client-websocket": "^1.0.0",
|
||||
"mumble-client": "^1.1.0",
|
||||
"web-audio-buffer-queue": "^1.0.0"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue