File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -42,13 +42,15 @@ <h1>Hello World (Read an Image)</h1>
4242 // Preload "BarcodeReader" module for reading barcodes. It will save time on the initial decoding by skipping the module loading.
4343 Dynamsoft . Core . CoreModule . loadWasm ( [ "DBR" ] ) ;
4444
45- let pRouter ;
4645 const divResultContainer = document . querySelector (
4746 "#div-result-container"
4847 ) ;
48+
49+ const pRouter = Dynamsoft . CVR . CaptureVisionRouter . createInstance ( ) ;
50+
4951 document . querySelector ( "input" ) . onchange = async ( ) => {
5052 try {
51- const router = await ( pRouter || pRouter = await Dynamsoft . CVR . CaptureVisionRouter . createInstance ( ) ) ;
53+ const router = await pRouter ;
5254 // Decode selected image with 'ReadBarcodes_SpeedFirst' template.
5355 const result = await router . capture (
5456 this . files [ 0 ] ,
You can’t perform that action at this time.
0 commit comments