Added mic not allowed error

This commit is contained in:
WolverinDEV 2019-05-20 20:02:47 +02:00
parent 47c43ea428
commit 8515a85649

View file

@ -316,6 +316,14 @@ namespace audio {
}, stream => resolve(stream), error => reject(error));
});
} catch(error) {
if(error instanceof DOMException) {
if(error.code == 0 || error.name == "NotAllowedError") {
console.warn(tr("Browser does not allow mirophone access"));
this._state = InputState.PAUSED;
createErrorModal(tr("Failed to create microphone"), tr("Microphone recording failed. Please allow TeaWeb access to your microphone")).open();
return;
}
}
console.warn(tr("Failed to initialize recording stream (%o)"), error);
throw tr("record stream initialisation failed");
}