Rescale webcam
authorRuben Rodriguez <ruben@gnu.org>
Wed, 10 Mar 2021 20:45:00 +0000 (15:45 -0500)
committerRuben Rodriguez <ruben@gnu.org>
Wed, 10 Mar 2021 20:45:00 +0000 (15:45 -0500)
front/src/WebRtc/MediaManager.ts

index 359eac67a08ce47bb89f240af5c3cf7fe8262229..9e85c6a09256b72bd47cd67617101cf4e1bd834c 100644 (file)
@@ -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;