Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ yarn.lock
!/dist/dbr.d.ts
!/dist/dbr.reference.d.ts
!/dist/dbr.scanner.html
!/dist/lts.license.dialog.html
!/dist/README.md

!/README.md
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ $ npm install dynamsoft-javascript-barcode --save

cdn
```html
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.2.3/dist/dbr.js" data-productKeys="PRODUCT-KEYS"></script>
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.2.5/dist/dbr.js" data-productKeys="PRODUCT-KEYS"></script>
<!-- or -->
<script src="https://unpkg.com/dynamsoft-javascript-barcode@8.2.3/dist/dbr.js" data-productKeys="PRODUCT-KEYS"></script>
<script src="https://unpkg.com/dynamsoft-javascript-barcode@8.2.5/dist/dbr.js" data-productKeys="PRODUCT-KEYS"></script>
```

[Download zip](https://www.dynamsoft.com/barcode-reader/downloads/?utm_source=github&package=js)
Expand All @@ -36,7 +36,7 @@ cdn
Please visit https://www.dynamsoft.com/customer/license/trialLicense/?product=dbr&utm_source=github&package=js to get a valid license and update `PRODUCT-KEYS`:

```html
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.2.3/dist/dbr.js" data-productKeys="PRODUCT-KEYS"></script>
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.2.5/dist/dbr.js" data-productKeys="PRODUCT-KEYS"></script>
```

## Quick Usage
Expand All @@ -45,7 +45,7 @@ Please visit https://www.dynamsoft.com/customer/license/trialLicense/?product=db
<!DOCTYPE html>
<html>
<body>
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.2.3/dist/dbr.js" data-productKeys="PRODUCT-KEYS"></script>
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.2.5/dist/dbr.js" data-productKeys="PRODUCT-KEYS"></script>
<script>
let scanner = null;
(async()=>{
Expand Down Expand Up @@ -216,7 +216,7 @@ Create an HTML file with the following content. Deploy this to your web server a
<html>
<body>
<!-- Please visit https://www.dynamsoft.com/customer/license/trialLicense/?product=dbr&utm_source=github&package=js to get a trial license. -->
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.2.3/dist/dbr.js" data-productKeys="PRODUCT-KEYS"></script>
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.2.5/dist/dbr.js" data-productKeys="PRODUCT-KEYS"></script>
<script>
let scanner = null;
(async()=>{
Expand Down Expand Up @@ -275,13 +275,13 @@ Now, take a look at the sample code. You can find that there is nothing but two
* The following script includes the core library in the application via a [jsDelivr](https://www.jsdelivr.com/) CDN

```javascript
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.2.3/dist/dbr.js" data-productKeys="PRODUCT-KEYS"></script>
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.2.5/dist/dbr.js" data-productKeys="PRODUCT-KEYS"></script>
```

The same can be done with other CDNs like `unpkg`

```javascript
<script src="https://unpkg.com/dynamsoft-javascript-barcode@8.2.3/dist/dbr.js" data-productKeys="PRODUCT-KEYS"></script>
<script src="https://unpkg.com/dynamsoft-javascript-barcode@8.2.5/dist/dbr.js" data-productKeys="PRODUCT-KEYS"></script>
```

> **NOTE**: : Since we do change the library a bit in each release, to make sure your application doesn't get interrupted by automatic updates, use a specific version in your production environment, as shown above. Using a general major version like `@7` is not recommended.
Expand Down Expand Up @@ -440,7 +440,7 @@ The following introduces the 3rd way. Check out the following code on how it's d
<video class="dbrScanner-video" playsinline="true"></video>
</div>
<!-- Please visit https://www.dynamsoft.com/customer/license/trialLicense/?product=dbr&utm_source=github&package=js to get a trial license. -->
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.2.3/dist/dbr.js" data-productKeys="PRODUCT-KEYS"></script>
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.2.5/dist/dbr.js" data-productKeys="PRODUCT-KEYS"></script>
<script>
let scanner = null;
(async()=>{
Expand Down
Binary file removed dist/dbr-8.2.3.full.wasm
Binary file not shown.
Binary file removed dist/dbr-8.2.3.node.wasm
Binary file not shown.
Binary file removed dist/dbr-8.2.3.wasm
Binary file not shown.
109 changes: 0 additions & 109 deletions dist/dbr-8.2.3.worker.js

This file was deleted.

Binary file added dist/dbr-8.2.5.full.wasm
Binary file not shown.
82 changes: 42 additions & 40 deletions dist/dbr-8.2.3.full.wasm.js → dist/dbr-8.2.5.full.wasm.js

Large diffs are not rendered by default.

Binary file added dist/dbr-8.2.5.node.wasm
Binary file not shown.
169 changes: 85 additions & 84 deletions dist/dbr-8.2.3.node.wasm.js → dist/dbr-8.2.5.node.wasm.js

Large diffs are not rendered by default.

Binary file added dist/dbr-8.2.5.wasm
Binary file not shown.
82 changes: 42 additions & 40 deletions dist/dbr-8.2.3.wasm.js → dist/dbr-8.2.5.wasm.js

Large diffs are not rendered by default.

112 changes: 112 additions & 0 deletions dist/dbr-8.2.5.worker.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/dbr.browser.mjs

Large diffs are not rendered by default.

35 changes: 26 additions & 9 deletions dist/dbr.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @website http://www.dynamsoft.com
* @preserve Copyright 2021, Dynamsoft Corporation
* @author Dynamsoft
* @version 8.2.3 (js 20210413)
* @version 8.2.5 (js 20210426)
* @fileoverview Dynamsoft JavaScript Library for Barcode Reader
* More info on DBR JS: https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx
*/
Expand Down Expand Up @@ -368,7 +368,8 @@ export declare class BarcodeReader {
protected static _organizationID: string;
static get organizationID(): string;
/**
* Get or set the Dynamsoft Barcode Reader SDK handshake code. The handshakeCode is an alias of productKeys. Specifically refers to the key that requires network authentication.
* Get or set the Dynamsoft Barcode Reader SDK organizationID. Then if you want to use default handshake of this organization, you can keep handshakeCode empty;
* @see [[handshakeCode]]
*/
static set organizationID(value: string);
/** @ignore */
Expand Down Expand Up @@ -434,6 +435,10 @@ export declare class BarcodeReader {
* @ignore
*/
static _bSendSmallRecordsForDebug: boolean;
/**
* @ignore
*/
static _bNeverShowDialog: boolean;
/**
* Whether to use full feature wasm.
* The api may change in later version.
Expand Down Expand Up @@ -530,18 +535,27 @@ export declare class BarcodeReader {
/** @ignore */
static get lastErrorString(): string;
/** @ignore */
protected _setWarnnedEx: Set<string>;
/** @ignore */
protected _lastErrorCode: number;
/** @ignore */
get lastErrorCode(): number;
/** @ignore */
protected _lastErrorString: string;
/** @ignore */
get lastErrorString(): string;
private static _loadWasmErr;
/**
* Manually load and compile the decoding module. Used for preloading to avoid taking too long for lazy loading.
* @category Initialize and Destroy
*/
static loadWasm(): Promise<void>;
/**
* @param type "warn" or "error"
* @param content
* @returns
*/
protected static showDialog(type: string, content: string): Promise<void>;
protected static createInstanceInWorker(bScanner?: boolean): Promise<number>;
/**
* Create a `BarcodeReader` object.
Expand Down Expand Up @@ -901,7 +915,7 @@ export declare class BarcodeScanner extends BarcodeReader {
* Use `frame` or `true` to play a sound when any barcode is found within a frame.
* Use `unduplicated` to play a sound only when any unique/unduplicated barcode is found within a frame.
* ```js
* // https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#chrome_enterprise_policies
* // A user gesture required. https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#chrome_enterprise_policies
* startPlayButton.addEventListener('click', function() {
* scanner.bPlaySoundOnSuccessfulRead = false;
* scanner.bPlaySoundOnSuccessfulRead = true;
Expand All @@ -915,18 +929,18 @@ export declare class BarcodeScanner extends BarcodeReader {
/**
* Whether to vibrate when the scanner reads a barcode successfully.
* Default value is `false`, which does not vibrate.
* Use `frame` or `true` to play a sound when any barcode is found within a frame.
* Use `unduplicated` to play a sound only when any unique/unduplicated barcode is found within a frame.
* Use `frame` or `true` to vibrate when any barcode is found within a frame.
* Use `unduplicated` to vibrate only when any unique/unduplicated barcode is found within a frame.
* ```js
* // https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#chrome_enterprise_policies
* startPlayButton.addEventListener('click', function() {
* // Can I use? https://caniuse.com/?search=vibrate
* // A user gesture required. https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#chrome_enterprise_policies
* startVibrateButton.addEventListener('click', function() {
* scanner.bVibrateOnSuccessfulRead = false;
* scanner.bVibrateOnSuccessfulRead = true;
* scanner.bVibrateOnSuccessfulRead = "frame";
* scanner.bVibrateOnSuccessfulRead = "unduplicated";
* });
* ```
* refer: `favicon bug` https://bugs.chromium.org/p/chromium/issues/detail?id=1069731&q=favicon&can=2
*/
bVibrateOnSuccessfulRead: (boolean | string);
/**
Expand Down Expand Up @@ -987,8 +1001,11 @@ export declare class BarcodeScanner extends BarcodeReader {
/** @ignore */
decodeBuffer(buffer: Uint8Array | Uint8ClampedArray | ArrayBuffer | Blob, width: number, height: number, stride: number, format: EnumImagePixelFormat, config?: any): Promise<any>;
/**
* ```js
* await scanner.showVideo();
* console.log(await scanner.decodeCurrentFrame());
* ```
* @category Decode
*/
decodeCurrentFrame(): Promise<TextResult[]>;
private clearMapDecodeRecord;
Expand All @@ -997,7 +1014,7 @@ export declare class BarcodeScanner extends BarcodeReader {
private static isRegionNormalPreset;
/**
* Update runtime settings with a given struct, or a string of `speed`, `balance`, `coverage` and `single` to use preset settings for BarcodeScanner.
* We recommend using the speed-optimized `single` preset if scanning only one line at a time. The `single` is only available in `BarcodeScanner`.
* We recommend using the speed-optimized `single` preset if scanning only one barcode at a time. The `single` is only available in `BarcodeScanner`.
* The default settings for BarcodeScanner is `single`.
* ```js
* await scanner.updateRuntimeSettings('balance');
Expand Down
4 changes: 2 additions & 2 deletions dist/dbr.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/dbr.mjs

Large diffs are not rendered by default.

35 changes: 26 additions & 9 deletions dist/dbr.reference.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @website http://www.dynamsoft.com
* @preserve Copyright 2021, Dynamsoft Corporation
* @author Dynamsoft
* @version 8.2.3 (js 20210413)
* @version 8.2.5 (js 20210426)
* @fileoverview Dynamsoft JavaScript Library for Barcode Reader
* More info on DBR JS: https://www.dynamsoft.com/Products/barcode-recognition-javascript.aspx
*/
Expand Down Expand Up @@ -368,7 +368,8 @@ declare class BarcodeReader {
protected static _organizationID: string;
static get organizationID(): string;
/**
* Get or set the Dynamsoft Barcode Reader SDK handshake code. The handshakeCode is an alias of productKeys. Specifically refers to the key that requires network authentication.
* Get or set the Dynamsoft Barcode Reader SDK organizationID. Then if you want to use default handshake of this organization, you can keep handshakeCode empty;
* @see [[handshakeCode]]
*/
static set organizationID(value: string);
/** @ignore */
Expand Down Expand Up @@ -434,6 +435,10 @@ declare class BarcodeReader {
* @ignore
*/
static _bSendSmallRecordsForDebug: boolean;
/**
* @ignore
*/
static _bNeverShowDialog: boolean;
/**
* Whether to use full feature wasm.
* The api may change in later version.
Expand Down Expand Up @@ -530,18 +535,27 @@ declare class BarcodeReader {
/** @ignore */
static get lastErrorString(): string;
/** @ignore */
protected _setWarnnedEx: Set<string>;
/** @ignore */
protected _lastErrorCode: number;
/** @ignore */
get lastErrorCode(): number;
/** @ignore */
protected _lastErrorString: string;
/** @ignore */
get lastErrorString(): string;
private static _loadWasmErr;
/**
* Manually load and compile the decoding module. Used for preloading to avoid taking too long for lazy loading.
* @category Initialize and Destroy
*/
static loadWasm(): Promise<void>;
/**
* @param type "warn" or "error"
* @param content
* @returns
*/
protected static showDialog(type: string, content: string): Promise<void>;
protected static createInstanceInWorker(bScanner?: boolean): Promise<number>;
/**
* Create a `BarcodeReader` object.
Expand Down Expand Up @@ -901,7 +915,7 @@ declare class BarcodeScanner extends BarcodeReader {
* Use `frame` or `true` to play a sound when any barcode is found within a frame.
* Use `unduplicated` to play a sound only when any unique/unduplicated barcode is found within a frame.
* ```js
* // https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#chrome_enterprise_policies
* // A user gesture required. https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#chrome_enterprise_policies
* startPlayButton.addEventListener('click', function() {
* scanner.bPlaySoundOnSuccessfulRead = false;
* scanner.bPlaySoundOnSuccessfulRead = true;
Expand All @@ -915,18 +929,18 @@ declare class BarcodeScanner extends BarcodeReader {
/**
* Whether to vibrate when the scanner reads a barcode successfully.
* Default value is `false`, which does not vibrate.
* Use `frame` or `true` to play a sound when any barcode is found within a frame.
* Use `unduplicated` to play a sound only when any unique/unduplicated barcode is found within a frame.
* Use `frame` or `true` to vibrate when any barcode is found within a frame.
* Use `unduplicated` to vibrate only when any unique/unduplicated barcode is found within a frame.
* ```js
* // https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#chrome_enterprise_policies
* startPlayButton.addEventListener('click', function() {
* // Can I use? https://caniuse.com/?search=vibrate
* // A user gesture required. https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#chrome_enterprise_policies
* startVibrateButton.addEventListener('click', function() {
* scanner.bVibrateOnSuccessfulRead = false;
* scanner.bVibrateOnSuccessfulRead = true;
* scanner.bVibrateOnSuccessfulRead = "frame";
* scanner.bVibrateOnSuccessfulRead = "unduplicated";
* });
* ```
* refer: `favicon bug` https://bugs.chromium.org/p/chromium/issues/detail?id=1069731&q=favicon&can=2
*/
bVibrateOnSuccessfulRead: (boolean | string);
/**
Expand Down Expand Up @@ -987,8 +1001,11 @@ declare class BarcodeScanner extends BarcodeReader {
/** @ignore */
decodeBuffer(buffer: Uint8Array | Uint8ClampedArray | ArrayBuffer | Blob, width: number, height: number, stride: number, format: EnumImagePixelFormat, config?: any): Promise<any>;
/**
* ```js
* await scanner.showVideo();
* console.log(await scanner.decodeCurrentFrame());
* ```
* @category Decode
*/
decodeCurrentFrame(): Promise<TextResult[]>;
private clearMapDecodeRecord;
Expand All @@ -997,7 +1014,7 @@ declare class BarcodeScanner extends BarcodeReader {
private static isRegionNormalPreset;
/**
* Update runtime settings with a given struct, or a string of `speed`, `balance`, `coverage` and `single` to use preset settings for BarcodeScanner.
* We recommend using the speed-optimized `single` preset if scanning only one line at a time. The `single` is only available in `BarcodeScanner`.
* We recommend using the speed-optimized `single` preset if scanning only one barcode at a time. The `single` is only available in `BarcodeScanner`.
* The default settings for BarcodeScanner is `single`.
* ```js
* await scanner.updateRuntimeSettings('balance');
Expand Down
2 changes: 1 addition & 1 deletion dist/dbr.scanner.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<svg width="16" height="16" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1490 1322q0 40-28 68l-136 136q-28 28-68 28t-68-28l-294-294-294 294q-28 28-68 28t-68-28l-136-136q-28-28-28-68t28-68l294-294-294-294q-28-28-28-68t28-68l136-136q28-28 68-28t68 28l294 294 294-294q28-28 68-28t68 28l136 136q28 28 28 68t-28 68l-294 294 294 294q28 28 28 68z"/></svg>
</button>
<!-- The "Powered by Dynamsoft" logo can be easily removed by eliminating the following line. -->
<div style="position:absolute;left:50%;bottom:3%;padding:0 5px;margin: 0;font-family:Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Noto Sans CJK SC,WenQuanYi Micro Hei,Arial,sans-serif;line-height:18px;font-size:12px;color:white;background-color: rgba(0,0,0,.3);border-radius:8px;transform:translateX(-50%);">Powered by Dynamsoft</div>
<div class="dbrScanner-msg-poweredby" style="position:absolute;left:50%;bottom:3%;padding:0 5px;margin: 0;font-family:Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Noto Sans CJK SC,WenQuanYi Micro Hei,Arial,sans-serif;line-height:18px;font-size:12px;color:white;background-color: rgba(0,0,0,.3);border-radius:8px;transform:translateX(-50%);">Powered by Dynamsoft</div>
</div>
<style>
@keyframes dbrScanner-rotate{from{transform:rotate(0turn);}to{transform:rotate(1turn);}}
Expand Down
20 changes: 20 additions & 0 deletions dist/lts.license.dialog.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!-- This file will only be used during the trial phase. Don't change it. (Optional) You can remove it in your Production Environment. -->
<div style="width:100vw;height:100vh;position:fixed;left:0;top:0;background:rgba(0,0,0,0.1);font-family:Helvetica,Arial,sans-serif;z-index:1000;">
<div class="lts-license-dialog" style="position:absolute;left:0;top:50%;right:0;margin:0 auto;transform:translateY(-50%);background:#fff;">
<div style="height:32px;background:#000;position:relative;">
<i class="lts-license-icon-error" style="width:20px;height:20px;top:5px;left:16px;position:absolute;display:inline-block;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsSAAALEgHS3X78AAABRUlEQVQ4jZ1UwU3EQAwc0BWQEq4DwhcJKSVQwpZwJVDClZASKCF8eKeE0EEoAA3y3Vgyi/cuhyVrtVnv2BmP944kGtYDGLTuFbIAmAFMWv+aAVZeSC48m60TyVf5VJ2V+n7cdCRnBY8k+ySZe68Y6k5XA+5Jrjq8BJQBz7prGHAOnQ/jbG2R2rBOnOLEt3hgUtkx40jfjkmlZgUqeWz8zlqBFn3LaDGMGUIeLnDkoJfAIAzurvAzi9cP7Z+a+pPdbyDdhP0t768FW4WfCpyS8wLgCOBZe48ZG4m/nMyl0c2as6xR7oYxRlHXUiiNBvQJ4OjijpfNDjdMSdQrPUk8OCjLVqBBjwVjxbuKVB+7Ip+SZpmMXgA8AHgH8PhLSuGlWUODzN7C6xPNJysdhvi7bgZ0ejn+47Hllrk1gpvdZZPp6nYn8QM3jKdoTCb4owAAAABJRU5ErkJggg==');"></i>
<i class="lts-license-icon-warn" style="width:20px;height:20px;top:5px;left:16px;position:absolute;display:inline-block;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsSAAALEgHS3X78AAABKklEQVQ4ja1UAXHDMAz85QogEMqgGYNAGIRAMIRCKISMQSF4CGYIHYMMwe/UvW6e66RZl7/T6WJJL0W29EQSM+gA9NJ7uVwAJABR+hZGWMhA8sJvmI4kj5JY2IYyPv9oSSY5jyS7SjKXTj5UTFsS7klOMtaIuoXzpFjjgPfQ+2E9myqdORY6R6ueGrodgAHAAcDzDNk9TOJ4N90ACABeZ29tHZI4QqPqxn+QOYzj0GxA9AubE9qlfGga4oLfeQWXcXw2IgobFBeuibNHfVqYjNMd++iP2w8GjVFYCFpKRp/r3BCUZS1Rr2XBfEnsiqb6pAySWLksG88Xvd83TdjPUGSbZlIvfD2ds+2TI8mvr1We/67DiK6b4xHxIKvKMlez/kX82dxs3oeExBcP2agdc6IF/QAAAABJRU5ErkJggg==');"></i>
<i class="lts-license-icon-close" style="width:14px;height:14px;position:absolute;top:8px;right:8px;line-height:14px;color:#ccc;font-size:14px;font-style:normal;display:inline-block;cursor:pointer;" onclick="this.parentElement.parentElement.parentElement.parentElement.removeChild(this.parentElement.parentElement.parentElement);">x</i>
</div>
<div class="lts-license-msg-content" style="font-size:17px;line-height:24px;padding:25px 20px 20px 25px;"></div>
</div>
</div>
<style>
.lts-license-dialog a{color:#50a8e1;}
@media screen and (min-width:800px) {
.lts-license-dialog{width:680px;}
}
@media screen and (max-width:800px) {
.lts-license-dialog{width:85vw;}
}
</style>
Loading