File tree 1 file changed +8
-9
lines changed
1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -166,23 +166,22 @@ export default {
166
166
167
167
function startBarcodeDetection () {
168
168
// Get video element
169
- const videoElement = document .querySelector (
169
+ const video = document .querySelector (
170
170
' #dce-video-container > video'
171
171
);
172
172
const {BarcodeDetector } = globalThis ;
173
173
// Check if BarcodeDetector is supported
174
174
if (! BarcodeDetector) {
175
175
alert (' Barcode Detector is not supported in this browser.' );
176
176
return ;
177
- } else {
178
- const barcodeDetector = new BarcodeDetector ({
179
- formats: formatsToSupport
180
- });
181
- // Start the detection loop
182
- videoElement .requestVideoFrameCallback (() =>
183
- emitScanResult ({barcodeDetector, video: videoElement})
184
- );
185
177
}
178
+ const barcodeDetector = new BarcodeDetector ({
179
+ formats: formatsToSupport
180
+ });
181
+ // Start the detection loop
182
+ video .requestVideoFrameCallback (
183
+ () => emitScanResult ({barcodeDetector, video})
184
+ );
186
185
}
187
186
188
187
// Update camera zoom
You can’t perform that action at this time.
0 commit comments