|
@@ -71,6 +71,7 @@ export default {
|
|
this.$refs.video.srcObject.getTracks().forEach(function(track) {
|
|
this.$refs.video.srcObject.getTracks().forEach(function(track) {
|
|
track.stop();
|
|
track.stop();
|
|
});
|
|
});
|
|
|
|
+ this.$refs.video.srcObject.srcObject = null;
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
this.openCamera();
|
|
this.openCamera();
|
|
@@ -81,13 +82,14 @@ export default {
|
|
this.openCamera();
|
|
this.openCamera();
|
|
},
|
|
},
|
|
beforeDestroy() {
|
|
beforeDestroy() {
|
|
|
|
+ clearTimeout(this.retrySnapTimeout);
|
|
|
|
+ clearTimeout(this.showSnapResultTimeout);
|
|
if (this.$refs.video.srcObject) {
|
|
if (this.$refs.video.srcObject) {
|
|
this.$refs.video.srcObject.getTracks().forEach(function(track) {
|
|
this.$refs.video.srcObject.getTracks().forEach(function(track) {
|
|
track.stop();
|
|
track.stop();
|
|
});
|
|
});
|
|
|
|
+ this.$refs.video.srcObject.srcObject = null;
|
|
}
|
|
}
|
|
- clearTimeout(this.retrySnapTimeout);
|
|
|
|
- clearTimeout(this.showSnapResultTimeout);
|
|
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
...mapMutations(["toggleSnapNow", "decreaseSnapCount"]),
|
|
...mapMutations(["toggleSnapNow", "decreaseSnapCount"]),
|