wuxw лет назад: 6
Родитель
Сommit
95c0cec6c5

+ 1 - 1
WebService/src/main/resources/components/applicationKeyPackage/add-applicationKeyView/addApplicationKey.html

@@ -10,7 +10,7 @@
             <div class="ibox-content">
                 <div class="row">
                     <div class="col-sm-5" style="text-align:center">
-                        <video id="AddApplicationKeyPhoto" style="width: 100%;"></video>
+                        <video id="addApplicationKeyPhoto" style="width: 100%;"></video>
                         <canvas id="AddApplicationKeyCanvas" style="display:none;"></canvas>
                         <div style="margin-top:20px">
                             <button class="btn btn-primary" type="button" v-on:click="_takePhoto()"><span

+ 8 - 8
WebService/src/main/resources/components/applicationKeyPackage/add-applicationKeyView/addApplicationKey.js

@@ -298,17 +298,17 @@
                         video: true,
                         audio: false
                     };
-                    var video = document.getElementById('AddApplicationKeyPhoto');
+                    var addVideo = document.getElementById('addApplicationKeyPhoto');
                     var media = navigator.getUserMedia(constraints, function (stream) {
                         var url = window.URL || window.webkitURL;
                         //video.src = url ? url.createObjectURL(stream) : stream;
                         vc.component.addApplicationKeyInfo.mediaStreamTrack = typeof stream.stop === 'function' ? stream : stream.getTracks()[0];
                         try {
-                            video.src = url ? url.createObjectURL(stream) : stream;
+                            addVideo.src = url ? url.createObjectURL(stream) : stream;
                         } catch (error) {
-                            video.srcObject = stream;
+                            addVideo.srcObject = stream;
                         }
-                        video.play();
+                        addVideo.play();
                         vc.component.addApplicationKeyInfo.videoPlaying = true;
                     }, function (error) {
                         console.log("ERROR");
@@ -321,10 +321,10 @@
             _takePhoto: function () {
                 if (vc.component.addApplicationKeyInfo.videoPlaying) {
                     var canvas = document.getElementById('AddApplicationKeyCanvas');
-                    var video = document.getElementById('AddApplicationKeyPhoto');
-                    canvas.width = video.videoWidth;
-                    canvas.height = video.videoHeight;
-                    canvas.getContext('2d').drawImage(video, 0, 0);
+                    var takeAddVideo = document.getElementById('AddApplicationKeyPhoto');
+                    canvas.width = takeAddVideo.videoWidth;
+                    canvas.height = takeAddVideo.videoHeight;
+                    canvas.getContext('2d').drawImage(takeAddVideo, 0, 0);
                     var data = canvas.toDataURL('image/webp');
                     vc.component.addApplicationKeyInfo.photo = data;
                     //document.getElementById('photo').setAttribute('src', data);

+ 8 - 8
WebService/src/main/resources/components/applicationKeyPackage/edit-applicationKey/editApplicationKey.js

@@ -327,18 +327,18 @@
                         video: true,
                         audio: false
                     };
-                    var video = document.getElementById('editApplicationKeyPhoto');
+                    var editVideo = document.getElementById('editApplicationKeyPhoto');
                     var media = navigator.getUserMedia(constraints, function (stream) {
                         var url = window.URL || window.webkitURL;
                         //video.src = url ? url.createObjectURL(stream) : stream;
 
                         vc.component.editApplicationKeyInfo.mediaStreamTrack = typeof stream.stop === 'function' ? stream : stream.getTracks()[0];
                         try {
-                            video.src = url ? url.createObjectURL(stream) : stream;
+                            editVideo.src = url ? url.createObjectURL(stream) : stream;
                         } catch (error) {
-                            video.srcObject = stream;
+                            editVideo.srcObject = stream;
                         }
-                        video.play();
+                        editVideo.play();
                         vc.component.editApplicationKeyInfo.videoPlaying = true;
                     }, function (error) {
                         console.log("ERROR");
@@ -351,10 +351,10 @@
             _takeEditPhoto: function () {
                 if (vc.component.editApplicationKeyInfo.videoPlaying) {
                     var canvas = document.getElementById('editApplicationKeyCanvas');
-                    var video = document.getElementById('editApplicationKeyPhoto');
-                    canvas.width = video.videoWidth;
-                    canvas.height = video.videoHeight;
-                    canvas.getContext('2d').drawImage(video, 0, 0);
+                    var takeEditVideo = document.getElementById('editApplicationKeyPhoto');
+                    canvas.width = takeEditVideo.videoWidth;
+                    canvas.height = takeEditVideo.videoHeight;
+                    canvas.getContext('2d').drawImage(takeEditVideo, 0, 0);
                     var data = canvas.toDataURL('image/webp');
                     vc.component.editApplicationKeyInfo.photo = data;
                     //document.getElementById('photo').setAttribute('src', data);