1515 < title >
1616 Dynamsoft Barcode Reader Sample - Hello World (Decode via Camera)
1717 </ title >
18- < script src ="
https://npm.scannerproxy.com/cdn/@dynamsoft/[email protected] 20231222173812 /dist/core.js "
> </ script > 19- < script src ="
https://npm.scannerproxy.com/cdn/@dynamsoft/[email protected] 20231222153411 /dist/license.js "
> </ script > 20- < script src ="
https://npm.scannerproxy.com/cdn/@dynamsoft/[email protected] 20231220174819 /dist/utility.js "
> </ script > 21- < script src ="
https://npm.scannerproxy.com/cdn/@dynamsoft/[email protected] 20231222153407 /dist/dbr.js "
> </ script > 22- < script src ="
https://npm.scannerproxy.com/cdn/@dynamsoft/[email protected] 20231222144235 /dist/cvr.js "
> </ script > 23- < script src ="
https://npm.scannerproxy.com/cdn/@dynamsoft/[email protected] 20231222174818 /dist/dce.js "
> </ script > 18+ < script src ="
https://npm.scannerproxy.com/cdn/@dynamsoft/[email protected] 20240103172308 /dist/core.js "
> </ script > 19+ < script src ="
https://npm.scannerproxy.com/cdn/@dynamsoft/[email protected] 20240103111927 /dist/license.js "
> </ script > 20+ < script src ="
https://npm.scannerproxy.com/cdn/@dynamsoft/[email protected] 20240105111526 /dist/utility.js "
> </ script > 21+ < script src ="
https://npm.scannerproxy.com/cdn/@dynamsoft/[email protected] 20240105110155 /dist/dbr.js "
> </ script > 22+ < script src ="
https://npm.scannerproxy.com/cdn/@dynamsoft/[email protected] 20240103180822 /dist/cvr.js "
> </ script > 23+ < script src ="
https://npm.scannerproxy.com/cdn/@dynamsoft/[email protected] 20240103095540 /dist/dce.js "
> </ script > 2424 </ head >
2525
2626 < body >
2727 < h1 > Hello World (Decode via Camera)</ h1 >
2828 < div id ="div-ui-container " style ="width: 100%; height: 80vh "> </ div >
29+ Results:
30+ < br >
31+ < div id ="div-results-container " style ="width: 100%; height: 10vh; overflow: auto; "> </ div >
2932 < script >
3033 if ( location . protocol === "file:" ) {
3134 const message = `The page is opened via file:// and our SDKs may not work properly. Please open the page via https:// or host it on "http://localhost/".` ;
@@ -67,9 +70,15 @@ <h1>Hello World (Decode via Camera)</h1>
6770 // Define a callback for results.
6871 const resultReceiver = new Dynamsoft . CVR . CapturedResultReceiver ( ) ;
6972 resultReceiver . onDecodedBarcodesReceived = ( result ) => {
73+ if ( ! result . barcodesResultItems . length ) return ;
74+
75+ const resultsContainer = document . querySelector ( "#div-results-container" ) ;
76+ resultsContainer . innerHTML = "" ;
77+ console . log ( result ) ;
7078 for ( let item of result . barcodesResultItems ) {
71- console . log ( item . text ) ;
72- alert ( item . text ) ;
79+ // console.log(item.text);
80+ // alert(item.text);
81+ resultsContainer . innerHTML += `${ item . formatString } : ${ item . text } <br>` ;
7382 }
7483 } ;
7584 router . addResultReceiver ( resultReceiver ) ;
@@ -94,6 +103,7 @@ <h1>Hello World (Decode via Camera)</h1>
94103 // Open camera and start scanning single barcode.
95104 await cameraEnhancer . open ( ) ;
96105 await router . startCapturing ( "ReadSingleBarcode" ) ;
106+ // await router.startCapturing("ReadBarcodes_SpeedFirst");
97107 } catch ( ex ) {
98108 let errMsg ;
99109 if ( ex . message ?. includes ( "network connection error" ) ) {
0 commit comments