Commit 6b1d613d authored by Jonas Herzig's avatar Jonas Herzig
Browse files

Fix error handling and crash in case of unsupported codecs (fixes #10)

parent 90b73796
......@@ -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()
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment