bugfix and linting

* use 'const' on constraints which never change
* also re-enable constraints ater mic was re-enabled (after mute/unmute)
This commit is contained in:
TabascoEye 2021-01-30 02:24:36 +01:00 committed by GitHub
parent 31a0d08c76
commit 58b7d85bf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,7 +18,7 @@ let videoConstraint: boolean|MediaTrackConstraints = {
resizeMode: 'crop-and-scale', resizeMode: 'crop-and-scale',
aspectRatio: 1.777777778 aspectRatio: 1.777777778
}; };
let audioConstraint: boolean|MediaTrackConstraints = { const audioConstraint: boolean|MediaTrackConstraints = {
//TODO: make these values configurable in the game settings menu and store them in localstorage //TODO: make these values configurable in the game settings menu and store them in localstorage
autoGainControl: false, autoGainControl: false,
echoCancellation: true, echoCancellation: true,
@ -243,7 +243,7 @@ export class MediaManager {
} }
public enableMicrophone() { public enableMicrophone() {
this.constraintsMedia.audio = true; this.constraintsMedia.audio = audioConstraint;
this.getCamera().then((stream) => { this.getCamera().then((stream) => {
//TODO show error message tooltip upper of camera button //TODO show error message tooltip upper of camera button