Skip to content
Merged

Dev #14

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
82d74d8
update samples to adapt to DBR JS 9.0.0;
Cube-J Mar 18, 2022
e289a5f
update vue sample to adapt DBR JS 9.0.0
Cube-J Mar 18, 2022
eb93342
update vue3 sample to adapt to DBR JS 9.0.0
Cube-J Mar 18, 2022
65b16c8
update nextjs sample to adapt to DBR JS 9.0.0
Cube-J Mar 18, 2022
149a266
update nuxtjs sample to adapt to DBR JS 9.0.0
Cube-J Mar 21, 2022
559ab03
update electron sample to adapt DBR JS 9.0.0
Cube-J Mar 21, 2022
6fcd369
fixed
lim-kim930 Mar 21, 2022
e0a4d83
update code to adapt to DBR JS 9.0.0
Cube-J Mar 21, 2022
3341d05
Merge branch '_dev' of https://github.com/Dynamsoft/barcode-reader-ja…
Cube-J Mar 21, 2022
e79162a
Update 3.read-video-with-external-control.html
Cube-J Mar 21, 2022
c6176a0
fix camrea selected bug
lim-kim930 Mar 21, 2022
e003bf8
update code to adapt to DBR JS 9.0.0
Cube-J Mar 21, 2022
cb44402
Merge branch '_dev' of https://github.com/Dynamsoft/barcode-reader-ja…
Cube-J Mar 21, 2022
487f2e9
update code to adapt to DBR JS 9.0.0
Cube-J Mar 21, 2022
550e3de
fix no results bug
lim-kim930 Mar 21, 2022
05ba5ec
change LICENSE ALERT - README
lim-kim930 Mar 22, 2022
bdf00f9
rename 'destroy' to 'destroyContext'; remove 'bPlaySoundOnSuccessfulR…
Cube-J Mar 22, 2022
08be81f
Merge branch '_dev' of https://github.com/Dynamsoft/barcode-reader-ja…
Cube-J Mar 22, 2022
c97ecd7
update
Cube-J Mar 23, 2022
245fcea
remove webpack sample; update index.html;
Cube-J Mar 23, 2022
4cfe79f
Update 2.read-a-drivers-license.html
Cube-J Mar 23, 2022
274b43f
update version to 9.0.0
Cube-J Mar 24, 2022
9d1179c
remove a comment;
Cube-J Mar 24, 2022
4d27292
Update README.md
Cube-J Mar 24, 2022
0f72efb
fix
Cube-J Mar 24, 2022
6a42760
Merge branch 'master' into _dev
Cube-J Mar 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions 1.hello-world/1.minimum-code.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,20 @@
<body>
<h1 style="font-size: 1.5em;">Read Barcodes from a Camera</h1>
<button id="btn-show-scanner">Show Barcode Scanner</button>
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/dbr.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.0.0/dist/dbr.js"></script>
<script>
/** LICENSE ALERT - README
*
* The library requires a license to work.
* If the license is not specified, a free public trial license will be used by default which is the case in this sample.
* Note that network connection is required for the public license to work.
* For more info, please check https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=8.8.7&utm_source=github#specify-the-license or contact support@dynamsoft.com.
/** LICENSE ALERT - README
* To use the library, you need to first specify a license key using the API "license" as shown below.
*/

/* When using your own license, uncomment the following line and specify your license. */
Dynamsoft.DBR.BarcodeReader.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';

// Dynamsoft.DBR.BarcodeReader.license = "YOUR-ORGANIZATION-ID or YOUR-HANDSHAKECODE or AN-OFFLINE-LICENSE or ANY-OTHER-TYPE-OF-SUPPORTED-LICENSE-STRING";

/** LICENSE ALERT - THE END */
/**
* You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=github&product=dbr&package=js to get your own trial license good for 30 days.
* Note that if you downloaded this sample from Dynamsoft while logged in, the above license key may already be your own 30-day trial license.
* For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.0.0&utm_source=github#specify-the-license or contact support@dynamsoft.com.
* LICENSE ALERT - THE END
*/

let pScanner = null;
document.getElementById('btn-show-scanner').onclick = async function() {
Expand All @@ -43,11 +42,11 @@ <h1 style="font-size: 1.5em;">Read Barcodes from a Camera</h1>
}
};
/*
* onUnduplicatdRead is triggered only when a 'new' barcode is found.
* onUniqueRead is triggered only when a 'new' barcode is found.
* The amount of time that the library 'remembers' a barcode is defined by
* "duplicateForgetTime" in "ScanSettings". By default it is set to 3000 ms.
*/
scanner.onUnduplicatedRead = (txt, result) => {
scanner.onUniqueRead = (txt, result) => {
alert(txt);
console.log("Unique Code Found: ", result);
}
Expand Down
23 changes: 11 additions & 12 deletions 1.hello-world/10.read-video-pwa/helloworld-pwa.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,20 @@
<body>
<h1 style="font-size: 1.5em;">Hello World for PWA</h1>
<button id='readBarcode'>Read Barcode via Camera</button>
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/dbr.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.0.0/dist/dbr.js"></script>
<script>
/** LICENSE ALERT - README
*
* The library requires a license to work.
* If the license is not specified, a free public trial license will be used by default which is the case in this sample.
* Note that network connection is required for the public license to work.
* For more info, please check https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=8.8.7&utm_source=github#specify-the-license or contact support@dynamsoft.com.
/** LICENSE ALERT - README
* To use the library, you need to first specify a license key using the API "license" as shown below.
*/

/* When using your own license, uncomment the following line and specify your license. */

// Dynamsoft.DBR.BarcodeReader.license = "YOUR-ORGANIZATION-ID or YOUR-HANDSHAKECODE or AN-OFFLINE-LICENSE or ANY-OTHER-TYPE-OF-SUPPORTED-LICENSE-STRING";
Dynamsoft.DBR.BarcodeReader.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';

/** LICENSE ALERT - THE END */
/**
* You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=github&product=dbr&package=js to get your own trial license good for 30 days.
* Note that if you downloaded this sample from Dynamsoft while logged in, the above license key may already be your own 30-day trial license.
* For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.0.0&utm_source=github#specify-the-license or contact support@dynamsoft.com.
* LICENSE ALERT - THE END
*/

let pScanner = null;
let latestResult = null;
Expand All @@ -45,7 +44,7 @@ <h1 style="font-size: 1.5em;">Hello World for PWA</h1>
console.log(result.barcodeFormatString + ": " + result.barcodeText);
}
};
scanner.onUnduplicatedRead = (txt, result) => {
scanner.onUniqueRead = (txt, result) => {
latestResult = txt;
alert(txt, result);
}
Expand Down
25 changes: 12 additions & 13 deletions 1.hello-world/11.read-video-requirejs.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,24 @@ <h1 style="font-size: 1.5em;">Hello World for RequireJS</h1>
<button id="readBarcode">show scanner</button>
<script src="https://cdn.jsdelivr.net/npm/requirejs@2.3.6/require.js"></script>
<script>
requirejs(['https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/dbr.js'], function({
requirejs(['https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.0.0/dist/dbr.js'], function({
BarcodeReader,
BarcodeScanner
}) {
/** LICENSE ALERT - README
*
* The library requires a license to work.
* If the license is not specified, a free public trial license will be used by default which is the case in this sample.
* Note that network connection is required for the public license to work.
* For more info, please check https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=8.8.7&utm_source=github#specify-the-license or contact support@dynamsoft.com.
/** LICENSE ALERT - README
* To use the library, you need to first specify a license key using the API "license" as shown below.
*/

/* When using your own license, uncomment the following line and specify your license. */

// BarcodeReader.license = "YOUR-ORGANIZATION-ID or YOUR-HANDSHAKECODE or AN-OFFLINE-LICENSE or ANY-OTHER-TYPE-OF-SUPPORTED-LICENSE-STRING";
BarcodeReader.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';

/** LICENSE ALERT - THE END */
/**
* You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=github&product=dbr&package=js to get your own trial license good for 30 days.
* Note that if you downloaded this sample from Dynamsoft while logged in, the above license key may already be your own 30-day trial license.
* For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.0.0&utm_source=github#specify-the-license or contact support@dynamsoft.com.
* LICENSE ALERT - THE END
*/

BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/";
BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.0.0/dist/";
let pScanner = null;
document.getElementById('readBarcode').onclick = async function() {
try {
Expand All @@ -42,7 +41,7 @@ <h1 style="font-size: 1.5em;">Hello World for RequireJS</h1>
console.log(result.barcodeFormatString + ": " + result.barcodeText);
}
};
scanner.onUnduplicatedRead = (txt, result) => {
scanner.onUniqueRead = (txt, result) => {
alert(txt);
console.log("Unique Code Found: ", result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,21 @@
<h1 style="font-size: 1.5em;">Read Barcodes from a Camera</h1>
<button id="btn-show-scanner">Show Barcode Scanner</button>
<script type="module">
import { BarcodeReader, BarcodeScanner } from 'https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/dbr.mjs';
/** LICENSE ALERT - README
*
* The library requires a license to work.
* If the license is not specified, a free public trial license will be used by default which is the case in this sample.
* Note that network connection is required for the public license to work.
* For more info, please check https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=8.8.7&utm_source=github#specify-the-license or contact support@dynamsoft.com.
import { BarcodeReader, BarcodeScanner } from 'https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.0.0/dist/dbr.mjs';
/** LICENSE ALERT - README
* To use the library, you need to first specify a license key using the API "license" as shown below.
*/

/* When using your own license, uncomment the following line and specify your license. */

// BarcodeReader.license = "YOUR-ORGANIZATION-ID or YOUR-HANDSHAKECODE or AN-OFFLINE-LICENSE or ANY-OTHER-TYPE-OF-SUPPORTED-LICENSE-STRING";

/** LICENSE ALERT - THE END */

// DBR.productKeys = "PRODUCT-KEYS";
BarcodeReader.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';

/**
* You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=github&product=dbr&package=js to get your own trial license good for 30 days.
* Note that if you downloaded this sample from Dynamsoft while logged in, the above license key may already be your own 30-day trial license.
* For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.0.0&utm_source=github#specify-the-license or contact support@dynamsoft.com.
* LICENSE ALERT - THE END
*/

BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/";
BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.0.0/dist/";

let pScanner = null;
document.getElementById('btn-show-scanner').addEventListener('click', async () => {
Expand All @@ -51,7 +48,7 @@ <h1 style="font-size: 1.5em;">Read Barcodes from a Camera</h1>
* The amount of time that the library 'remembers' a barcode is defined by
* "duplicateForgetTime" in "ScanSettings". By default it is set to 3000 ms.
*/
scanner.onUnduplicatedRead = (txt, result) => {
scanner.onUniqueRead = (txt, result) => {
alert(txt);
console.log("Unique Code Found: ", result);
}
Expand Down
17 changes: 0 additions & 17 deletions 1.hello-world/12.read-video-webpack/index.html

This file was deleted.

17 changes: 0 additions & 17 deletions 1.hello-world/12.read-video-webpack/package.json

This file was deleted.

40 changes: 0 additions & 40 deletions 1.hello-world/12.read-video-webpack/src/index.js

This file was deleted.

10 changes: 0 additions & 10 deletions 1.hello-world/12.read-video-webpack/webpack.config.js

This file was deleted.

23 changes: 11 additions & 12 deletions 1.hello-world/2.read-an-image.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,20 @@ <h1 style="font-size: 1.5em;">Read Barcode from Images</h1>
.sp-resultText { color: #cE5E04 }
#div-cvs-container canvas { border: solid 1px gray; }
</style>
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/dbr.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.0.0/dist/dbr.js"></script>
<script>
/** LICENSE ALERT - README
*
* The library requires a license to work.
* If the license is not specified, a free public trial license will be used by default which is the case in this sample.
* Note that network connection is required for the public license to work.
* For more info, please check https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=8.8.7&utm_source=github#specify-the-license or contact support@dynamsoft.com.
/** LICENSE ALERT - README
* To use the library, you need to first specify a license key using the API "license" as shown below.
*/

/* When using your own license, uncomment the following line and specify your license. */
Dynamsoft.DBR.BarcodeReader.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';

// Dynamsoft.DBR.BarcodeReader.license = "YOUR-ORGANIZATION-ID or YOUR-HANDSHAKECODE or AN-OFFLINE-LICENSE or ANY-OTHER-TYPE-OF-SUPPORTED-LICENSE-STRING";

/** LICENSE ALERT - THE END */
/**
* You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=github&product=dbr&package=js to get your own trial license good for 30 days.
* Note that if you downloaded this sample from Dynamsoft while logged in, the above license key may already be your own 30-day trial license.
* For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.0.0&utm_source=github#specify-the-license or contact support@dynamsoft.com.
* LICENSE ALERT - THE END
*/

// Load the library on page load to speed things up.
(async() => {
Expand Down Expand Up @@ -74,7 +73,7 @@ <h1 style="font-size: 1.5em;">Read Barcode from Images</h1>

// show image
divCvsContainer.innerHTML = '';
divCvsContainer.appendChild(reader.oriCanvas);
divCvsContainer.appendChild(reader.getOriginalImageInACanvas());

// show results
divResults.appendChild(createEl('h3', file.name + ": "));
Expand Down
4 changes: 2 additions & 2 deletions 1.hello-world/3.read-video-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@angular/platform-browser": "~11.2.5",
"@angular/platform-browser-dynamic": "~11.2.5",
"@angular/router": "~11.2.5",
"dynamsoft-javascript-barcode": "8.8.7",
"dynamsoft-javascript-barcode": "9.0.0",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"zone.js": "~0.11.3"
Expand All @@ -43,4 +43,4 @@
"tslint": "~6.1.0",
"typescript": "~4.1.5"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
.component-barcode-scanner{width:100%;height:100%;min-width:640px;min-height:480px;background:#eee;position:relative;resize:both;}
.dbrScanner-bg-loading{animation:1s linear infinite dbrScanner-rotate;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
.dbrScanner-bg-camera{width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
.dbrScanner-video{width:100%;height:100%;position:absolute;left:0;top:0;}
.dbrScanner-cvs-drawarea{width:100%;height:100%;position:absolute;left:0;top:0;}
.dbrScanner-cvs-scanarea{width:100%;height:100%;position:absolute;left:0;top:0;}
.dbrScanner-scanlight{width:100%;height:3%;position:absolute;animation:3s infinite dbrScanner-scanlight;border-radius:50%;box-shadow:0px 0px 2vw 1px #00e5ff;background:#fff;}
.dbrScanner-sel-camera{margin:0 auto;position:absolute;left:0;top:0;}
.dbrScanner-sel-resolution{position:absolute;left:0;top:20px;}
.dbrScanner-msg-poweredby{position:absolute;left:50%;bottom:10%;transform:translateX(-50%);}
.dbrScanner-msg-poweredby svg {height:max(3vmin,17px);fill:#FFFFFF;}
@keyframes dbrScanner-rotate{from{transform:rotate(0turn);}to{transform:rotate(1turn);}}
@keyframes dbrScanner-scanlight{from{top:0;}to{top:97%;}}
.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-camera{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;}
.dce-scanlight{width:100%;height:3%;position:absolute;animation:3s infinite dce-scanlight;border-radius:50%;box-shadow:0px 0px 2vw 1px #00e5ff;background:#fff;}
.div-select-container{position:absolute;left:0;top:0;}
.dce-sel-camera{display:block;}
.dce-sel-resolution{display:block;margin-top:5px;}
.dbr-msg-poweredby{position:absolute;left:50%;bottom:10%;transform:translateX(-50%);}
.dbr-msg-poweredby svg {height:max(3vmin,17px);fill:#FFFFFF;}
@keyframes dce-rotate{from{transform:rotate(0turn);}to{transform:rotate(1turn);}}
@keyframes dce-scanlight{from{top:0;}to{top:97%;}}
Loading