You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My expectation is that v-if results in component-destruction when the boolean it tests becomes false.
In particular, I would expect the logic in StreamBarcodeReader.beforeDestroy to be called when v-if
condition becomes false:
beforeDestroy() {
this.codeReader.reset();
},
I believe this sort of happens: namely, it appears the StreamBarcodeReader component in fact is destroyed, but that the reset() does not result in my webcam being turned off.
Can you make sure that the webcam is turned off when StreamBarcodeReader component is destroyed?
BTW, I am on macOS Big Sur (11.6) and Chrome 94.x.
The text was updated successfully, but these errors were encountered:
Hi, I had this same problem.
I looked into the files and saw the reset() method is in beforeUnmount() hook. but there is no such hook as beforeUnmount. changed it to beforeDestroy() and it got fixed i will send a pull request .
methods: { onDecode(text) { this.code = text; console.log(Decode text from QR code is ${text}); }, onLoaded() { console.log(Ready to start scanning barcodes`);
},
stopBarcodeScanner() {
// Suponiendo que el componente StreamBarcodeReader tiene un método stop()
// que detiene el stream del lector de códigos de barras
this.$refs.scanner.codeReader.stream
.getTracks()
.forEach(function (track) {
track.stop();
});
},
},
I've set up a simple vueJS (3.x) component for barcode-scanning:
My expectation is that
v-if
results in component-destruction when the boolean it tests becomes false.In particular, I would expect the logic in
StreamBarcodeReader.beforeDestroy
to be called whenv-if
condition becomes false:
I believe this sort of happens: namely, it appears the StreamBarcodeReader component in fact is destroyed, but that the
reset()
does not result in my webcam being turned off.Can you make sure that the webcam is turned off when StreamBarcodeReader component is destroyed?
BTW, I am on macOS Big Sur (11.6) and Chrome 94.x.
The text was updated successfully, but these errors were encountered: