diff --git a/1.hello-world/1.hello-world.html b/1.hello-world/1.hello-world.html index 0a07f920c..9b6208d3d 100644 --- a/1.hello-world/1.hello-world.html +++ b/1.hello-world/1.hello-world.html @@ -37,7 +37,8 @@ scanner.onFrameRead = results => { console.log("Barcodes on one frame:"); for (let result of results) { - console.log(result.barcodeFormatString + ": " + result.barcodeText); + const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2; + console.log(format + ": " + result.barcodeText); } }; /** diff --git a/1.hello-world/10.read-video-pwa/helloworld-pwa.html b/1.hello-world/10.read-video-pwa/helloworld-pwa.html index fb6766582..9f63cc67b 100644 --- a/1.hello-world/10.read-video-pwa/helloworld-pwa.html +++ b/1.hello-world/10.read-video-pwa/helloworld-pwa.html @@ -56,7 +56,8 @@

Hello World for PWA

scanner.onFrameRead = results => { console.log("Barcodes on one frame:"); for (let result of results) { - console.log(result.barcodeFormatString + ": " + result.barcodeText); + const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2; + console.log(format + ": " + result.barcodeText); } }; scanner.onUniqueRead = (txt, result) => { diff --git a/1.hello-world/11.read-video-requirejs.html b/1.hello-world/11.read-video-requirejs.html index 8d4d5c4c0..3b9fa50e5 100644 --- a/1.hello-world/11.read-video-requirejs.html +++ b/1.hello-world/11.read-video-requirejs.html @@ -38,7 +38,8 @@

Hello World for RequireJS

scanner.onFrameRead = results => { console.log("Barcodes on one frame:"); for (let result of results) { - console.log(result.barcodeFormatString + ": " + result.barcodeText); + const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2; + console.log(format + ": " + result.barcodeText); } }; scanner.onUniqueRead = (txt, result) => { diff --git a/1.hello-world/12.read-video-es6.html b/1.hello-world/12.read-video-es6.html index f4c59a3bf..17e10d903 100644 --- a/1.hello-world/12.read-video-es6.html +++ b/1.hello-world/12.read-video-es6.html @@ -40,7 +40,8 @@

Hello World for ES6

scanner.onFrameRead = results => { console.log("Barcodes on one frame:"); for (let result of results) { - console.log(result.barcodeFormatString + ": " + result.barcodeText); + const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2; + console.log(format + ": " + result.barcodeText); } }; /* diff --git a/1.hello-world/13.read-video-react-ts/src/components/VideoDecode/VideoDecode.css b/1.hello-world/13.read-video-react-ts/src/components/VideoDecode/VideoDecode.css index c41cd2f27..3bac7c0eb 100644 --- a/1.hello-world/13.read-video-react-ts/src/components/VideoDecode/VideoDecode.css +++ b/1.hello-world/13.read-video-react-ts/src/components/VideoDecode/VideoDecode.css @@ -1,5 +1,5 @@ .component-barcode-scanner{width:100%;height:100%;/* min-width:640px; */min-height:480px;background:#eee;position:relative;resize:both;} -.dce-bg-loading{animation:1s linear infinite dce-rotate;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;} +.dce-bg-loading{display:none;animation:1s linear infinite dce-rotate;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;} .dce-bg-camera{display:none;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;} .dce-video-container{position:absolute;left:0;top:0;width:100%;height:100%;} .dce-scanarea{width:100%;height:100%;position:absolute;left:0;top:0;} diff --git a/1.hello-world/2.read-an-image.html b/1.hello-world/2.read-an-image.html index 36ce465a2..fc9dff2f8 100644 --- a/1.hello-world/2.read-an-image.html +++ b/1.hello-world/2.read-an-image.html @@ -95,9 +95,10 @@

Read Barcode from Images

divResults.appendChild(createEl('p', "No Barcode Found!")); } for (let result of results) { - iptReadonlyLastResult.value = result.barcodeFormatString + ": " + result.barcodeText; // show last txt result + const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2; + iptReadonlyLastResult.value = format + ": " + result.barcodeText; // show last txt result const p = document.createElement('p'); - p.appendChild(createEl('span', result.barcodeFormatString + ": ")); + p.appendChild(createEl('span', format + ": ")); p.appendChild(createEl('span', result.barcodeText, "sp-resultText")); divResults.appendChild(p); if (result.barcodeText.indexOf("Attention(exceptionCode") != -1) { diff --git a/1.hello-world/3.read-video-angular/src/app/barcode-scanner/barcode-scanner.component.css b/1.hello-world/3.read-video-angular/src/app/barcode-scanner/barcode-scanner.component.css index b7a3b2e49..8e7f05bc4 100644 --- a/1.hello-world/3.read-video-angular/src/app/barcode-scanner/barcode-scanner.component.css +++ b/1.hello-world/3.read-video-angular/src/app/barcode-scanner/barcode-scanner.component.css @@ -1,5 +1,5 @@ .component-barcode-scanner{width:100%;height:100%;/* min-width:640px; */min-height:480px;background:#eee;position:relative;resize:both;} -.dce-bg-loading{animation:1s linear infinite dce-rotate;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;} +.dce-bg-loading{display:none;animation:1s linear infinite dce-rotate;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;} .dce-bg-camera{display:none;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;} .dce-video-container{position:absolute;left:0;top:0;width:100%;height:100%;} .dce-scanarea{width:100%;height:100%;position:absolute;left:0;top:0;} diff --git a/1.hello-world/4.read-video-react/src/components/VideoDecode/VideoDecode.css b/1.hello-world/4.read-video-react/src/components/VideoDecode/VideoDecode.css index c41cd2f27..3bac7c0eb 100644 --- a/1.hello-world/4.read-video-react/src/components/VideoDecode/VideoDecode.css +++ b/1.hello-world/4.read-video-react/src/components/VideoDecode/VideoDecode.css @@ -1,5 +1,5 @@ .component-barcode-scanner{width:100%;height:100%;/* min-width:640px; */min-height:480px;background:#eee;position:relative;resize:both;} -.dce-bg-loading{animation:1s linear infinite dce-rotate;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;} +.dce-bg-loading{display:none;animation:1s linear infinite dce-rotate;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;} .dce-bg-camera{display:none;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;} .dce-video-container{position:absolute;left:0;top:0;width:100%;height:100%;} .dce-scanarea{width:100%;height:100%;position:absolute;left:0;top:0;} diff --git a/1.hello-world/5.read-video-vue/src/components/VideoDecode.vue b/1.hello-world/5.read-video-vue/src/components/VideoDecode.vue index 4affda6b4..62eddc666 100644 --- a/1.hello-world/5.read-video-vue/src/components/VideoDecode.vue +++ b/1.hello-world/5.read-video-vue/src/components/VideoDecode.vue @@ -117,6 +117,7 @@ export default { } .dce-bg-loading { + display: none; animation: 1s linear infinite dce-rotate; width: 40%; height: 40%; diff --git a/1.hello-world/6.read-video-vue3/src/components/VideoDecode.vue b/1.hello-world/6.read-video-vue3/src/components/VideoDecode.vue index b71dcc84f..584715ad0 100644 --- a/1.hello-world/6.read-video-vue3/src/components/VideoDecode.vue +++ b/1.hello-world/6.read-video-vue3/src/components/VideoDecode.vue @@ -121,6 +121,7 @@ export default { } .dce-bg-loading { + display: none; animation: 1s linear infinite dce-rotate; width: 40%; height: 40%; diff --git a/1.hello-world/7.read-video-nextjs/styles/BarcodeScanner.css b/1.hello-world/7.read-video-nextjs/styles/BarcodeScanner.css index c41cd2f27..3bac7c0eb 100644 --- a/1.hello-world/7.read-video-nextjs/styles/BarcodeScanner.css +++ b/1.hello-world/7.read-video-nextjs/styles/BarcodeScanner.css @@ -1,5 +1,5 @@ .component-barcode-scanner{width:100%;height:100%;/* min-width:640px; */min-height:480px;background:#eee;position:relative;resize:both;} -.dce-bg-loading{animation:1s linear infinite dce-rotate;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;} +.dce-bg-loading{display:none;animation:1s linear infinite dce-rotate;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;} .dce-bg-camera{display:none;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;} .dce-video-container{position:absolute;left:0;top:0;width:100%;height:100%;} .dce-scanarea{width:100%;height:100%;position:absolute;left:0;top:0;} diff --git a/1.hello-world/8.read-video-nuxtjs/components/VideoDecode.vue b/1.hello-world/8.read-video-nuxtjs/components/VideoDecode.vue index 23d8de946..506a60b6e 100644 --- a/1.hello-world/8.read-video-nuxtjs/components/VideoDecode.vue +++ b/1.hello-world/8.read-video-nuxtjs/components/VideoDecode.vue @@ -117,6 +117,7 @@ export default { } .dce-bg-loading { + display: none; animation: 1s linear infinite dce-rotate; width: 40%; height: 40%; diff --git a/2.ui-tweaking/1.read-video-show-result.html b/2.ui-tweaking/1.read-video-show-result.html index 8a90d8cbd..4d42af1d7 100644 --- a/2.ui-tweaking/1.read-video-show-result.html +++ b/2.ui-tweaking/1.read-video-show-result.html @@ -69,7 +69,8 @@

Use the Default Built-in UI

scanner.onFrameRead = (_results) => { for (let result of _results) { let newElements = []; - newElements.push(createASpan(result.barcodeFormatString + ": ")); + const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2; + newElements.push(createASpan(format + ": ")); newElements.push(createASpan(result.barcodeText, "resultText")); newElements.push(document.createElement('br')); if (result.barcodeText.indexOf("Attention(exceptionCode") != -1) { @@ -83,7 +84,8 @@

Use the Default Built-in UI

} }; scanner.onUniqueRead = (txt, result) => { - document.getElementById('result').value = result.barcodeFormatString + ": " + txt; + const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2; + document.getElementById('result').value = format + ": " + txt; document.getElementById('result').focus(); setTimeout(() => { document.getElementById('result').blur(); diff --git a/2.ui-tweaking/2.read-video-no-extra-control.html b/2.ui-tweaking/2.read-video-no-extra-control.html index 426136a85..245a8ae9e 100644 --- a/2.ui-tweaking/2.read-video-no-extra-control.html +++ b/2.ui-tweaking/2.read-video-no-extra-control.html @@ -61,7 +61,8 @@

Hide UI Controls

try { let scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance()); scanner.onUniqueRead = (txt, result) => { - document.getElementById('result').value = result.barcodeFormatString + ": " + txt; + const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2; + document.getElementById('result').value = format + ": " + txt; document.getElementById('result').focus(); setTimeout(() => { document.getElementById('result').blur(); diff --git a/2.ui-tweaking/3.read-video-with-external-control.html b/2.ui-tweaking/3.read-video-with-external-control.html index 65c324205..4082470c2 100644 --- a/2.ui-tweaking/3.read-video-with-external-control.html +++ b/2.ui-tweaking/3.read-video-with-external-control.html @@ -123,7 +123,8 @@

Customized UI

let scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance()); await scanner.setUIElement(document.getElementById('div-ui-container')); scanner.onUniqueRead = (txt, result) => { - document.getElementById('result').value = result.barcodeFormatString + ": " + txt; + const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2; + document.getElementById('result').value = format + ": " + txt; document.getElementById('result').focus(); setTimeout(() => { document.getElementById('result').blur(); diff --git a/2.ui-tweaking/4.difference-video-size.html b/2.ui-tweaking/4.difference-video-size.html index d21ede15f..ef591a2c7 100644 --- a/2.ui-tweaking/4.difference-video-size.html +++ b/2.ui-tweaking/4.difference-video-size.html @@ -86,7 +86,8 @@

Enlarge the Video Stream

let scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance()); await scanner.setUIElement(document.getElementById('div-ui-container')); scanner.onUniqueRead = (txt, result) => { - document.getElementById('result').value = result.barcodeFormatString + ": " + txt; + const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2; + document.getElementById('result').value = format + ": " + txt; if (fitPage.hidden) exitFullPage(); document.getElementById('result').focus(); diff --git a/2.ui-tweaking/5.read-video-with-custom-default-ui.html b/2.ui-tweaking/5.read-video-with-custom-default-ui.html index fa7e15046..2fad2d5c6 100644 --- a/2.ui-tweaking/5.read-video-with-custom-default-ui.html +++ b/2.ui-tweaking/5.read-video-with-custom-default-ui.html @@ -90,7 +90,8 @@

Customized Default UI

let scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance()); document.getElementById('UIElement').appendChild(scanner.getUIElement()); scanner.onUniqueRead = (txt, result) => { - document.getElementById('result').value = result.barcodeFormatString + ": " + txt; + const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2; + document.getElementById('result').value = format + ": " + txt; document.getElementById('result').focus(); setTimeout(() => { document.getElementById('result').blur(); diff --git a/3.settings/initScanner.js b/3.settings/initScanner.js index 2a42a43ca..28c0f9c39 100644 --- a/3.settings/initScanner.js +++ b/3.settings/initScanner.js @@ -78,7 +78,8 @@ async function startReading() { let scanner = await pScanner; scanner.onFrameRead = (_results) => { for (let result of _results) { - resultBox.value = result.barcodeFormatString + ": " + result.barcodeText; + const format = result.barcodeFormat ? result.barcodeFormatString : result.barcodeFormatString_2; + resultBox.value = format + ": " + result.barcodeText; } }; await scanner.show();