Преглед изворни кода

兼容旧版本chrome摄像头api

Michael Wang пре 5 година
родитељ
комит
61b38d7be4
1 измењених фајлова са 6 додато и 1 уклоњено
  1. 6 1
      src/components/FaceRecognition/FaceRecognition.vue

+ 6 - 1
src/components/FaceRecognition/FaceRecognition.vue

@@ -125,7 +125,12 @@ export default {
           if (stream) {
           if (stream) {
             {
             {
               const vt0 = stream.getVideoTracks()[0];
               const vt0 = stream.getVideoTracks()[0];
-              if (vt0.getCapabilities && vt0.getCapabilities) {
+              if (
+                vt0 &&
+                vt0.getCapabilities &&
+                vt0.getConstraints &&
+                vt0.getSettings
+              ) {
                 console.log({
                 console.log({
                   getCapabilities: vt0.getCapabilities && vt0.getCapabilities(),
                   getCapabilities: vt0.getCapabilities && vt0.getCapabilities(),
                   getConstraints: vt0.getConstraints && vt0.getConstraints(),
                   getConstraints: vt0.getConstraints && vt0.getConstraints(),