diff --git a/front/src/WebRtc/MediaManager.ts b/front/src/WebRtc/MediaManager.ts index 9da4aa59..82e8b8cf 100644 --- a/front/src/WebRtc/MediaManager.ts +++ b/front/src/WebRtc/MediaManager.ts @@ -14,6 +14,12 @@ let videoConstraint: boolean|MediaTrackConstraints = { resizeMode: 'crop-and-scale', aspectRatio: 1.777777778 }; +const audioConstraint: boolean|MediaTrackConstraints = { + //TODO: make these values configurable in the game settings menu and store them in localstorage + autoGainControl: false, + echoCancellation: true, + noiseSuppression: false +}; export type UpdatedLocalStreamCallback = (media: MediaStream|null) => void; export type StartScreenSharingCallback = (media: MediaStream) => void; @@ -36,7 +42,7 @@ export class MediaManager { webrtcInAudio: HTMLAudioElement; private webrtcOutAudio: HTMLAudioElement; constraintsMedia : MediaStreamConstraints = { - audio: true, + audio: audioConstraint, video: videoConstraint }; updatedLocalStreamCallBacks : Set = new Set(); @@ -234,7 +240,7 @@ export class MediaManager { } public enableMicrophone() { - this.constraintsMedia.audio = true; + this.constraintsMedia.audio = audioConstraint; this.getCamera().then((stream) => { //TODO show error message tooltip upper of camera button