From a08e577b4c73b3776664ab9ecb4fddae6ef86ead Mon Sep 17 00:00:00 2001 From: Ruben Rodriguez Date: Wed, 10 Mar 2021 15:45:00 -0500 Subject: [PATCH] Rescale webcam --- front/src/WebRtc/MediaManager.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/front/src/WebRtc/MediaManager.ts b/front/src/WebRtc/MediaManager.ts index 359eac6..9e85c6a 100644 --- a/front/src/WebRtc/MediaManager.ts +++ b/front/src/WebRtc/MediaManager.ts @@ -1,7 +1,10 @@ -const videoConstraint: {width : any, height: any, facingMode : string} = { - width: { ideal: 1280 }, - height: { ideal: 720 }, - facingMode: "user" +let videoConstraint: boolean|MediaTrackConstraints = { + width: { min: 320, ideal: 640, max: 640 }, + height: { min: 240, ideal: 360 }, + frameRate: { min: 10, ideal: 15, max: 30 }, + facingMode: "user", + resizeMode: 'crop-and-scale', + aspectRatio: 1.777777778 }; export class MediaManager { localStream: MediaStream|null = null; -- 2.25.1