Selaa lähdekoodia

摄像头比例与裁剪

Michael Wang 5 vuotta sitten
vanhempi
commit
1714e42c92

+ 3 - 2
src/components/FaceRecognition/FaceRecognition.vue

@@ -107,8 +107,9 @@ export default {
             video: {
               facingMode: "user",
               aspectRatio: 4 / 3,
-              // width: 400,
-              // height: this.showRecognizeButton ? 300 : 250
+              resizeMode: "crop-and-scale",
+              width: 400,
+              height: 300,
             },
           });
           if (stream) {

+ 3 - 2
src/features/OnlineExam/CheckComputer.vue

@@ -858,8 +858,9 @@ export default {
           const stream = await navigator.mediaDevices.getUserMedia({
             video: {
               facingMode: "user",
-              // width: 400,
-              // height: this.showRecognizeButton ? 300 : 250
+              resizeMode: "crop-and-scale",
+              width: 400,
+              height: 300,
             },
           });
           if (stream) {