From 950a94bbf97b1d7fe253cedb348d7e8e8f0047fe Mon Sep 17 00:00:00 2001 From: seoko97 Date: Fri, 6 Dec 2024 03:20:54 +0900 Subject: [PATCH 1/2] refactor: simplify media stream constraints --- apps/web/src/utils/stream.ts | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/apps/web/src/utils/stream.ts b/apps/web/src/utils/stream.ts index 948f743e..460f31e0 100644 --- a/apps/web/src/utils/stream.ts +++ b/apps/web/src/utils/stream.ts @@ -6,43 +6,21 @@ const DEFAULT_AUDIO_CONSTRAINTS: MediaTrackConstraints = { autoGainControl: true, }; -const DEFAULT_VIDEO_CONSTRAINTS: MediaTrackConstraints = { - width: { ideal: 1280, min: 640, max: 1920 }, - height: { ideal: 720, min: 360, max: 1080 }, - frameRate: { max: 30, ideal: 15, min: 15 }, - aspectRatio: { ideal: 16 / 9 }, -}; - -const DEFAULT_SCREEN_CONSTRAINTS: MediaTrackConstraints = { - width: { max: 1920, ideal: 1280 }, - height: { max: 1080, ideal: 720 }, - frameRate: { max: 30, ideal: 15 }, -}; - const getCameraStream = async (options: MediaTrackConstraints = {}) => { return navigator.mediaDevices.getUserMedia({ - video: { - ...DEFAULT_VIDEO_CONSTRAINTS, - ...options, - }, + video: { ...options }, }); }; const getMicStream = async (options: MediaTrackConstraints = {}) => { return navigator.mediaDevices.getUserMedia({ - audio: { - ...DEFAULT_AUDIO_CONSTRAINTS, - ...options, - }, + audio: { ...DEFAULT_AUDIO_CONSTRAINTS, ...options }, }); }; const getScreenStream = async (options: MediaTrackConstraints = {}) => { return navigator.mediaDevices.getDisplayMedia({ - video: { - ...DEFAULT_SCREEN_CONSTRAINTS, - ...options, - }, + video: { ...options }, }); }; From 45c63cbf1ecaf483e7ba1351e732a28c84cac891 Mon Sep 17 00:00:00 2001 From: seoko97 Date: Fri, 6 Dec 2024 03:21:11 +0900 Subject: [PATCH 2/2] =?UTF-8?q?refactor:=20=EC=82=AC=EC=9A=A9=ED=95=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8A=94=20=EC=BD=94=EB=8D=B1=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/media/src/mediasoup/config.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/apps/media/src/mediasoup/config.ts b/apps/media/src/mediasoup/config.ts index 0d27a8f5..44b50e22 100644 --- a/apps/media/src/mediasoup/config.ts +++ b/apps/media/src/mediasoup/config.ts @@ -29,15 +29,6 @@ export class MediasoupConfig { useinbandfec: 1, }, }, - { - kind: 'video', - mimeType: 'video/H264', - clockRate: 90000, - parameters: { - 'packetization-mode': 1, - 'profile-level-id': '42e01f', - }, - }, { kind: 'video', mimeType: 'video/VP8',