소스 검색

摄像头比例与裁剪

Michael Wang 5 년 전
부모
커밋
1714e42c92
2개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 3 2
      src/components/FaceRecognition/FaceRecognition.vue
  2. 3 2
      src/features/OnlineExam/CheckComputer.vue

+ 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) {