-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #236 from Dynamsoft/_dev
Dev
- Loading branch information
Showing
10 changed files
with
222 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -156,6 +156,8 @@ window.startVideoDecode = async () => { | |
|
||
// Open camera and start scanning single barcode. | ||
await cameraEnhancer.open(); | ||
|
||
cameraView.setScanLaserVisible(true); | ||
await cvRouter.startCapturing("ReadSingleBarcode"); | ||
} catch (ex) { | ||
let errMsg = ex.message || ex; | ||
|
@@ -283,45 +285,43 @@ Inside the `wwwroot\index.html` file, we will initialize the license and necessa | |
|
||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/dbr.bundle.min.js"></script> | ||
<script> | ||
/** LICENSE ALERT - README | ||
* To use the library, you need to first specify a license key using the API "initLicense()" as shown below. | ||
*/ | ||
|
||
Dynamsoft.License.LicenseManager.initLicense("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/docs/web/programming/javascript/user-guide/index.html?ver=10.4.2002&cVer=true#specify-the-license&utm_source=samples or contact [email protected]. | ||
* LICENSE ALERT - THE END | ||
*/ | ||
|
||
// Optional. Used to load wasm resources in advance, reducing latency between video playing and barcode decoding. | ||
Dynamsoft.Core.CoreModule.loadWasm(["DBR"]); | ||
|
||
// Defined globally for easy debugging. | ||
let cameraEnhancer, cvRouter; | ||
let videoModuleLoaded = false; | ||
let imageModuleLoaded = false; | ||
|
||
// Lazy load Decode video module until needed | ||
async function loadDecodeVideoModule() { | ||
if (!videoModuleLoaded) { | ||
await import('./decodeVideo.js'); | ||
videoModuleLoaded = true; | ||
} | ||
/** LICENSE ALERT - README | ||
* To use the library, you need to first specify a license key using the API "initLicense()" as shown below. | ||
*/ | ||
Dynamsoft.License.LicenseManager.initLicense("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/docs/web/programming/javascript/user-guide/index.html?ver=10.4.2002&cVer=true#specify-the-license&utm_source=samples or contact [email protected]. | ||
* LICENSE ALERT - THE END | ||
*/ | ||
|
||
// Optional. Used to load wasm resources in advance, reducing latency between video playing and barcode decoding. | ||
Dynamsoft.Core.CoreModule.loadWasm(["DBR"]); | ||
|
||
// Defined globally for easy debugging. | ||
let cameraEnhancer, cvRouter; | ||
let videoModuleLoaded = false; | ||
let imageModuleLoaded = false; | ||
|
||
// Lazy load Decode video module until needed | ||
async function loadDecodeVideoModule() { | ||
if (!videoModuleLoaded) { | ||
await import("./decodeVideo.js"); | ||
videoModuleLoaded = true; | ||
} | ||
} | ||
|
||
// Lazy load decode image module until needed | ||
async function loadDecodeImageModule() { | ||
if (!imageModuleLoaded) { | ||
await import('./decodeImage.js'); | ||
imageModuleLoaded = true; | ||
} | ||
// Lazy load decode image module until needed | ||
async function loadDecodeImageModule() { | ||
if (!imageModuleLoaded) { | ||
await import("./decodeImage.js"); | ||
imageModuleLoaded = true; | ||
} | ||
} | ||
</script> | ||
</body> | ||
|
||
</body> | ||
</html> | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.