dynamsoft-barcode-reader-bundle 10.2.1000 → 10.4.2000-beta-202409252002
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.html +47 -59
- package/README.md +53 -61
- package/dist/dbr.bundle.js +2 -2
- package/dist/dbr.bundle.mjs +2 -2
- package/dist/dbr.no-content-bundle.esm.js +2 -2
- package/package.json +9 -9
package/README.html
CHANGED
|
@@ -270,12 +270,12 @@
|
|
|
270
270
|
<p><strong>Popular Examples</strong></p>
|
|
271
271
|
<ul>
|
|
272
272
|
<li>Hello World - <a href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/hello-world/hello-world.html">Github</a> | <a href="https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/hello-world.html?ver=10.2.10&utm_source=npm">Run</a></li>
|
|
273
|
-
<li>Angular App - <a href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/hello-world/angular">Github</a> | <a href="https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/angular/dist/angular/?ver=10.2.10&utm_source=npm">Run</a></li>
|
|
273
|
+
<li>Angular App - <a href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/hello-world/angular">Github</a> | <a href="https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/angular/dist/dbrjs-sample-angular/browser/?ver=10.2.10&utm_source=npm">Run</a></li>
|
|
274
274
|
<li>React App - <a href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/hello-world/react">Github</a> | <a href="https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/react/build/?ver=10.2.10&utm_source=npm">Run</a></li>
|
|
275
275
|
<li>Vue App - <a href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/hello-world/vue">Github</a> | <a href="https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/vue/dist/?ver=10.2.10&utm_source=npm">Run</a></li>
|
|
276
276
|
<li>PWA App - <a href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/hello-world/pwa">Github</a> | <a href="https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/pwa/helloworld-pwa.html?ver=10.2.10&utm_source=npm">Run</a></li>
|
|
277
277
|
<li>WebView in Android and iOS - <a href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v10.2.10/hello-world/webview">Github</a></li>
|
|
278
|
-
<li>Read Driver Licenses - <a href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/use-case/read-a-drivers-license.html">Github</a> | <a href="https://demo.dynamsoft.com/samples/dbr/js/use-case/read-a-drivers-license.html?ver=10.2.10&utm_source=npm">Run</a></li>
|
|
278
|
+
<li>Read Driver Licenses - <a href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/use-case/read-a-drivers-license/index.html">Github</a> | <a href="https://demo.dynamsoft.com/samples/dbr/js/use-case/read-a-drivers-license/index.html?ver=10.2.10&utm_source=npm">Run</a></li>
|
|
279
279
|
<li>Fill A Form - <a href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/use-case/fill-a-form-with-barcode-reading.html">Github</a> | <a href="https://demo.dynamsoft.com/samples/dbr/js/use-case/fill-a-form-with-barcode-reading.html?ver=10.2.10&utm_source=npm">Run</a></li>
|
|
280
280
|
<li>Show result information on the video - <a href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/use-case/show-result-texts-on-the-video.html">Github</a> | <a href="https://demo.dynamsoft.com/Samples/DBR/JS/use-case/show-result-texts-on-the-video.html?ver=10.2.10&utm_source=npm">Run</a></li>
|
|
281
281
|
<li>Debug Camera and Collect Video Frame - <a href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/others/debug">Github</a></li>
|
|
@@ -298,7 +298,7 @@
|
|
|
298
298
|
<pre><code class="hljs html language-html"><span class="hljs-meta"><!DOCTYPE <span class="hljs-meta-keyword">html</span>></span>
|
|
299
299
|
<span class="hljs-tag"><<span class="hljs-name">html</span>></span>
|
|
300
300
|
<span class="hljs-tag"><<span class="hljs-name">body</span>></span>
|
|
301
|
-
<span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"
|
|
301
|
+
<span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"camera-view-container"</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"width: 100%; height: 60vh"</span>></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span>
|
|
302
302
|
<span class="hljs-tag"><<span class="hljs-name">textarea</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"results"</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"width: 100%; min-height: 10vh; font-size: 3vmin; overflow: auto"</span> <span class="hljs-attr">disabled</span>></span><span class="hljs-tag"></<span class="hljs-name">textarea</span>></span>
|
|
303
303
|
<span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@10.2.1000/dist/dbr.bundle.js"</span>></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span>
|
|
304
304
|
<span class="hljs-tag"><<span class="hljs-name">script</span>></span><span class="javascript">
|
|
@@ -307,9 +307,9 @@
|
|
|
307
307
|
<span class="hljs-function">(<span class="hljs-params"><span class="hljs-keyword">async</span> (</span>) =></span> {
|
|
308
308
|
<span class="hljs-keyword">let</span> cvRouter = <span class="hljs-keyword">await</span> Dynamsoft.CVR.CaptureVisionRouter.createInstance();
|
|
309
309
|
|
|
310
|
-
<span class="hljs-keyword">let</span>
|
|
311
|
-
<span class="hljs-keyword">let</span> cameraEnhancer = <span class="hljs-keyword">await</span> Dynamsoft.DCE.CameraEnhancer.createInstance(
|
|
312
|
-
<span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">"#
|
|
310
|
+
<span class="hljs-keyword">let</span> cameraView = <span class="hljs-keyword">await</span> Dynamsoft.DCE.CameraView.createInstance();
|
|
311
|
+
<span class="hljs-keyword">let</span> cameraEnhancer = <span class="hljs-keyword">await</span> Dynamsoft.DCE.CameraEnhancer.createInstance(cameraView);
|
|
312
|
+
<span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">"#camera-view-container"</span>).append(cameraView.getUIElement());
|
|
313
313
|
cvRouter.setInput(cameraEnhancer);
|
|
314
314
|
|
|
315
315
|
<span class="hljs-keyword">const</span> resultsContainer = <span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">"#results"</span>);
|
|
@@ -360,7 +360,7 @@
|
|
|
360
360
|
<code>js
|
|
361
361
|
cvRouter.setInput(cameraEnhancer);
|
|
362
362
|
</code><br />
|
|
363
|
-
> The image source in our case is a <a href="https://www.dynamsoft.com/camera-enhancer/docs/web/programming/javascript/user-guide/index.html">CameraEnhancer</a> object created with <code>Dynamsoft.DCE.CameraEnhancer.createInstance(
|
|
363
|
+
> The image source in our case is a <a href="https://www.dynamsoft.com/camera-enhancer/docs/web/programming/javascript/user-guide/index.html">CameraEnhancer</a> object created with <code>Dynamsoft.DCE.CameraEnhancer.createInstance(cameraView)</code></li></ul></li>
|
|
364
364
|
<li><p><strong>Coordinate Image-Processing Tasks</strong></p>
|
|
365
365
|
<ul>
|
|
366
366
|
<li>The coordination happens behind the scenes. <code>cvRouter</code> starts the process by specifying a preset template "ReadSingleBarcode" in the method <code>startCapturing()</code>.<br />
|
|
@@ -382,7 +382,7 @@ cvRouter.addResultFilter(filter);
|
|
|
382
382
|
<p>Read more on <a href="https://www.dynamsoft.com/capture-vision/docs/core/architecture/#capture-vision-router">Capture Vision Router</a>.</p>
|
|
383
383
|
</blockquote>
|
|
384
384
|
<h3 id="run-the-example">Run the example</h3>
|
|
385
|
-
<p>You can run the example deployed to <a href="https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/hello-world.html?ver=10.2.10&utm_source=npm">the Dynamsoft Demo Server</a> or test it with <a href="https://jsfiddle.net/DynamsoftTeam/
|
|
385
|
+
<p>You can run the example deployed to <a href="https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/hello-world.html?ver=10.2.10&utm_source=npm">the Dynamsoft Demo Server</a> or test it with <a href="https://jsfiddle.net/DynamsoftTeam/csm2f9wb/">JSFiddle code editor</a>. </p>
|
|
386
386
|
<p>You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.</p>
|
|
387
387
|
<p>When a barcode is decoded, you will see the result text show up under the video and the barcode location will be highlighted in the video feed.</p>
|
|
388
388
|
<p>Alternatively, you can test locally by copying and pasting the code shown above into a local file (e.g. "hello-world.html") and opening it in your browser.</p>
|
|
@@ -400,27 +400,14 @@ cvRouter.addResultFilter(filter);
|
|
|
400
400
|
<h3 id="include-the-sdk">Include the SDK</h3>
|
|
401
401
|
<p>To utilize the SDK, the initial step involves including the corresponding resource files:</p>
|
|
402
402
|
<ul>
|
|
403
|
-
<li><code>core.js</code> encompasses common classes, interfaces, and enumerations
|
|
403
|
+
<li><code>core.js</code> encompasses common classes, interfaces, and enumerations shared across all Dynamsoft SDKs.</li>
|
|
404
404
|
<li><code>license.js</code> introduces the <code>LicenseManager</code> class, which manages the licensing for all Dynamsoft SDKs.</li>
|
|
405
|
-
<li><code>utility.js</code> encompasses auxiliary classes
|
|
406
|
-
<li><code>dbr.js</code> defines interfaces and enumerations
|
|
405
|
+
<li><code>utility.js</code> encompasses auxiliary classes shared among all Dynamsoft SDKs.</li>
|
|
406
|
+
<li><code>dbr.js</code> defines interfaces and enumerations tailored to the barcode reader module.</li>
|
|
407
407
|
<li><code>cvr.js</code> introduces the <code>CaptureVisionRouter</code> class, which governs the entire image processing workflow.</li>
|
|
408
408
|
<li><code>dce.js</code> comprises classes that offer camera support and basic user interface functionalities.</li>
|
|
409
409
|
</ul>
|
|
410
|
-
<p>
|
|
411
|
-
<ul>
|
|
412
|
-
<li>dynamsoft-core@3.2.30/dist/core.js</li>
|
|
413
|
-
<li>dynamsoft-license@3.2.21/dist/license.js</li>
|
|
414
|
-
<li>dynamsoft-utility@1.2.20/dist/utility.js</li>
|
|
415
|
-
<li>dynamsoft-barcode-reader@10.2.10/dist/dbr.js</li>
|
|
416
|
-
<li>dynamsoft-capture-vision-router@2.2.30/dist/cvr.js</li>
|
|
417
|
-
<li>dynamsoft-camera-enhancer@4.0.3/dist/dce.js</li>
|
|
418
|
-
</ul>
|
|
419
|
-
<p>Equivalent to</p>
|
|
420
|
-
<ul>
|
|
421
|
-
<li>dynamsoft-barcode-reader-bundle@10.2.1000/dist/dbr.bundle.js</li>
|
|
422
|
-
</ul>
|
|
423
|
-
<p>In the following chapters, we will use <code>dbr.bundle.js</code>.</p>
|
|
410
|
+
<p>To simplify things, starting from version 10.0.21, we introduced <code>dbr.bundle.js</code>, which combines all six of the above files. In the following chapters, we will use <code>dbr.bundle.js</code>.</p>
|
|
424
411
|
<h4 id="use-a-public-cdn">Use a public CDN</h4>
|
|
425
412
|
<p>The simplest way to include the SDK is to use either the <a href="https://jsdelivr.com/">jsDelivr</a> or <a href="https://unpkg.com/">UNPKG</a> CDN. The "hello world" example above uses <strong>jsDelivr</strong>.</p>
|
|
426
413
|
<ul>
|
|
@@ -439,36 +426,36 @@ cvRouter.addResultFilter(filter);
|
|
|
439
426
|
<pre><code class="hljs html language-html"> <span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://download2.dynamsoft.com/packages/dynamsoft-barcode-reader-bundle@10.2.1000/dist/dbr.bundle.js"</span>></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span>
|
|
440
427
|
</code></pre>
|
|
441
428
|
<p>However, please <strong>DO NOT</strong> use <code>download2.dynamsoft.com</code> resources in a production application as they are for temporary testing purposes only. Instead, you can try hosting the SDK yourself.</p>
|
|
442
|
-
<h4 id="host-the-sdk-yourself-optional">Host the SDK yourself (optional)</h4>
|
|
443
|
-
<p>Besides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.</p>
|
|
444
|
-
<p>Options to download the SDK:</p>
|
|
445
429
|
<ul>
|
|
446
|
-
<li
|
|
447
|
-
<p><a href="https://www.dynamsoft.com/barcode-reader/downloads/?ver=10.2.10&utm_source=npm&product=dbr&package=js">Download Dynamsoft Barcode Reader JavaScript Package</a></p></li>
|
|
448
|
-
<li><p>npm</p></li>
|
|
430
|
+
<li>In frameworks like React and Vue, you may want to add the package as a dependency.</li>
|
|
449
431
|
</ul>
|
|
450
|
-
<pre><code class="hljs
|
|
451
|
-
|
|
452
|
-
|
|
432
|
+
<pre><code class="hljs sh language-sh"> npm i dynamsoft-barcode-reader-bundle@10.2.1000 -E
|
|
433
|
+
<span class="hljs-comment"># or</span>
|
|
434
|
+
yarn add dynamsoft-barcode-reader-bundle@10.2.1000 -E
|
|
453
435
|
</code></pre>
|
|
436
|
+
<p>NOTE that in frameworks, you need to <a href="#specify-the-location-of-the-engine-files-optional">specify the engineResourcePaths</a>.</p>
|
|
437
|
+
<h4 id="host-the-sdk-yourself-optional">Host the SDK yourself (optional)</h4>
|
|
438
|
+
<p>Besides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.</p>
|
|
439
|
+
<p>There are two options for downloading the SDK, and the usage for each is slightly different</p>
|
|
454
440
|
<ul>
|
|
455
|
-
<li>
|
|
441
|
+
<li><p>From the website</p>
|
|
442
|
+
<p><a href="https://www.dynamsoft.com/barcode-reader/downloads/?ver=10.2.10&utm_source=npm&product=dbr&package=js">Download Dynamsoft Barcode Reader JavaScript Package</a></p>
|
|
443
|
+
<p>The resources are located at path <code>dynamsoft/distributables/<pkg>@<version></code>, you can typically include it like this:</p></li>
|
|
456
444
|
</ul>
|
|
457
|
-
<pre><code class="hljs
|
|
458
|
-
yarn add dynamsoft-capture-vision-std@<span class="hljs-number">1</span>.<span class="hljs-number">2</span>.<span class="hljs-number">0</span> -E
|
|
459
|
-
yarn add dynamsoft-image-processing@<span class="hljs-number">2</span>.<span class="hljs-number">2</span>.<span class="hljs-number">10</span> -E
|
|
445
|
+
<pre><code class="hljs html language-html"> <span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"dynamsoft/distributables/dynamsoft-barcode-reader-bundle@10.2.1000/dist/dbr.bundle.js"</span>></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span>
|
|
460
446
|
</code></pre>
|
|
461
|
-
<p>Depending on how you downloaded the SDK and how you intend to use it, you can typically include it like this</p>
|
|
462
447
|
<ul>
|
|
463
|
-
<li>
|
|
448
|
+
<li>npm</li>
|
|
464
449
|
</ul>
|
|
465
|
-
<pre><code class="hljs
|
|
450
|
+
<pre><code class="hljs sh language-sh"> npm i dynamsoft-barcode-reader-bundle@10.2.1000 -E
|
|
451
|
+
<span class="hljs-comment"># Compared with using CDN, you need to set up more resources.</span>
|
|
452
|
+
npm i dynamsoft-capture-vision-std@1.2.10 -E
|
|
453
|
+
npm i dynamsoft-image-processing@2.2.30 -E
|
|
466
454
|
</code></pre>
|
|
467
|
-
<
|
|
468
|
-
<
|
|
469
|
-
</ul>
|
|
470
|
-
<pre><code class="hljs html language-html"> <span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"/node_modules/dynamsoft-barcode-reader-bundle@10.2.1000/dist/dbr.bundle.js"</span>></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span>
|
|
455
|
+
<p>The resources are located at the path <code>node_modules/<pkg></code>, without <code>@<version></code>, so the script would be like:</p>
|
|
456
|
+
<pre><code class="hljs html language-html"> <span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"node_modules/dynamsoft-barcode-reader-bundle/dist/dbr.bundle.js"</span>></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span>
|
|
471
457
|
</code></pre>
|
|
458
|
+
<p>Since <code>@<version></code> are missing, you need to <a href="#specify-the-location-of-the-engine-files-optional">specify the engineResourcePaths</a>.</p>
|
|
472
459
|
<p><em>Note</em>:</p>
|
|
473
460
|
<ul>
|
|
474
461
|
<li>Certain legacy web application servers may lack support for the <code>application/wasm</code> mimetype for .wasm files. To address this, you have two options:</li>
|
|
@@ -492,7 +479,7 @@ cvRouter.addResultFilter(filter);
|
|
|
492
479
|
<p>To enable the SDK's functionality, you must provide a valid license. Utilize the API function initLicense to set your license key.</p>
|
|
493
480
|
<pre><code class="hljs javascript language-javascript">Dynamsoft.License.LicenseManager.initLicense(<span class="hljs-string">"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9"</span>);
|
|
494
481
|
</code></pre>
|
|
495
|
-
<p>As previously stated, the key "DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9" serves as a test license valid for 24 hours, applicable to any newly authorized browser. To test the SDK further, you can request a 30-day free trial license via the <a href="https://www.dynamsoft.com/customer/license/trialLicense?ver=10.2.10&utm_source=npm&product=dbr&package=js">
|
|
482
|
+
<p>As previously stated, the key "DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9" serves as a test license valid for 24 hours, applicable to any newly authorized browser. To test the SDK further, you can request a 30-day free trial license via the <a href="https://www.dynamsoft.com/customer/license/trialLicense?ver=10.2.10&utm_source=npm&product=dbr&package=js" target="_blank">Request a Trial License</a> link.</p>
|
|
496
483
|
<blockquote>
|
|
497
484
|
<p>Upon registering a Dynamsoft account and obtaining the SDK package from the official website, Dynamsoft will automatically create a 30-day free trial license and embed the corresponding license key into all the provided SDK samples.</p>
|
|
498
485
|
</blockquote>
|
|
@@ -501,13 +488,13 @@ cvRouter.addResultFilter(filter);
|
|
|
501
488
|
<p>The purpose is to tell the SDK where to find the engine files (*.worker.js, *.wasm.js and *.wasm, etc.). The API is called <code>Dynamsoft.Core.CoreModule.engineResourcePaths</code>:</p>
|
|
502
489
|
<pre><code class="hljs javascript language-javascript"><span class="hljs-comment">//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files</span>
|
|
503
490
|
<span class="hljs-built_in">Object</span>.assign(Dynamsoft.Core.CoreModule.engineResourcePaths, {
|
|
504
|
-
<span class="hljs-attr">std</span>: <span class="hljs-string">"https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-std@1.2.
|
|
505
|
-
<span class="hljs-attr">dip</span>: <span class="hljs-string">"https://cdn.jsdelivr.net/npm/dynamsoft-image-processing@2.2.
|
|
506
|
-
<span class="hljs-attr">core</span>: <span class="hljs-string">"https://cdn.jsdelivr.net/npm/dynamsoft-core@3.2.
|
|
507
|
-
<span class="hljs-attr">license</span>: <span class="hljs-string">"https://cdn.jsdelivr.net/npm/dynamsoft-license@3.2.
|
|
508
|
-
<span class="hljs-attr">cvr</span>: <span class="hljs-string">"https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-router@2.2.
|
|
491
|
+
<span class="hljs-attr">std</span>: <span class="hljs-string">"https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-std@1.2.10/dist/"</span>,
|
|
492
|
+
<span class="hljs-attr">dip</span>: <span class="hljs-string">"https://cdn.jsdelivr.net/npm/dynamsoft-image-processing@2.2.30/dist/"</span>,
|
|
493
|
+
<span class="hljs-attr">core</span>: <span class="hljs-string">"https://cdn.jsdelivr.net/npm/dynamsoft-core@3.2.30/dist/"</span>,
|
|
494
|
+
<span class="hljs-attr">license</span>: <span class="hljs-string">"https://cdn.jsdelivr.net/npm/dynamsoft-license@3.2.21/dist/"</span>,
|
|
495
|
+
<span class="hljs-attr">cvr</span>: <span class="hljs-string">"https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-router@2.2.30/dist/"</span>,
|
|
509
496
|
<span class="hljs-attr">dbr</span>: <span class="hljs-string">"https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader@10.2.10/dist/"</span>,
|
|
510
|
-
<span class="hljs-attr">dce</span>: <span class="hljs-string">"https://cdn.jsdelivr.net/npm/dynamsoft-camera-enhancer@4.0.
|
|
497
|
+
<span class="hljs-attr">dce</span>: <span class="hljs-string">"https://cdn.jsdelivr.net/npm/dynamsoft-camera-enhancer@4.0.3/dist/"</span>
|
|
511
498
|
});
|
|
512
499
|
</code></pre>
|
|
513
500
|
<h3 id="set-up-and-start-image-processing">Set up and start image processing</h3>
|
|
@@ -528,7 +515,7 @@ cvRouter.addResultFilter(filter);
|
|
|
528
515
|
}
|
|
529
516
|
</code></pre>
|
|
530
517
|
<p><em>Tip</em>:</p>
|
|
531
|
-
<p>When creating a <code>CaptureVisionRouter</code> object within a function which may be called more than once, it's best to use a "helper" variable to avoid double creation such as <code>
|
|
518
|
+
<p>When creating a <code>CaptureVisionRouter</code> object within a function which may be called more than once, it's best to use a "helper" variable to avoid double creation such as <code>pCvRouter</code> in the following code:</p>
|
|
532
519
|
<pre><code class="hljs javascript language-javascript">Dynamsoft.License.LicenseManager.initLicense(<span class="hljs-string">"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9"</span>);
|
|
533
520
|
|
|
534
521
|
<span class="hljs-keyword">let</span> pCvRouter = <span class="hljs-literal">null</span>; <span class="hljs-comment">// promise of cvRouter</span>
|
|
@@ -544,12 +531,12 @@ cvRouter.addResultFilter(filter);
|
|
|
544
531
|
</code></pre>
|
|
545
532
|
<h4 id="connect-an-image-source">Connect an image source</h4>
|
|
546
533
|
<p>The <code>CaptureVisionRouter</code> object, denoted as <code>cvRouter</code>, is responsible for handling images provided by an image source. In our scenario, we aim to detect barcodes directly from a live video stream. To facilitate this, we initialize a <code>CameraEnhancer</code> object, identified as <code>cameraEnhancer</code>, which is specifically designed to capture image frames from the video feed and subsequently forward them to <code>cvRouter</code>.</p>
|
|
547
|
-
<p>To enable video streaming on the webpage, we create a <code>CameraView</code> object referred to as <code>
|
|
548
|
-
<pre><code class="hljs html language-html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"
|
|
534
|
+
<p>To enable video streaming on the webpage, we create a <code>CameraView</code> object referred to as <code>cameraView</code>, which is then passed to <code>cameraEnhancer</code>, and its content is displayed on the webpage.</p>
|
|
535
|
+
<pre><code class="hljs html language-html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"camera-view-container"</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"width: 100%; height: 100vh"</span>></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span>
|
|
549
536
|
</code></pre>
|
|
550
|
-
<pre><code class="hljs javascript language-javascript"><span class="hljs-keyword">let</span>
|
|
551
|
-
<span class="hljs-keyword">let</span> cameraEnhancer = <span class="hljs-keyword">await</span> Dynamsoft.DCE.CameraEnhancer.createInstance(
|
|
552
|
-
<span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">"#
|
|
537
|
+
<pre><code class="hljs javascript language-javascript"><span class="hljs-keyword">let</span> cameraView = <span class="hljs-keyword">await</span> Dynamsoft.DCE.CameraView.createInstance();
|
|
538
|
+
<span class="hljs-keyword">let</span> cameraEnhancer = <span class="hljs-keyword">await</span> Dynamsoft.DCE.CameraEnhancer.createInstance(cameraView);
|
|
539
|
+
<span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">"#camera-view-container"</span>).append(cameraView.getUIElement());
|
|
553
540
|
cvRouter.setInput(cameraEnhancer);
|
|
554
541
|
</code></pre>
|
|
555
542
|
<h4 id="register-a-result-receiver">Register a result receiver</h4>
|
|
@@ -704,7 +691,7 @@ settings.roi.points = [
|
|
|
704
691
|
<li>See also: <a href="https://www.dynamsoft.com/camera-enhancer/docs/web/programming/javascript/api-reference/acquisition.html#setscanregion">CameraEnhancer::setScanRegion</a></li>
|
|
705
692
|
</ul>
|
|
706
693
|
</blockquote>
|
|
707
|
-
<pre><code class="hljs javascript language-javascript">cameraEnhancer = <span class="hljs-keyword">await</span> Dynamsoft.DCE.CameraEnhancer.createInstance(
|
|
694
|
+
<pre><code class="hljs javascript language-javascript">cameraEnhancer = <span class="hljs-keyword">await</span> Dynamsoft.DCE.CameraEnhancer.createInstance(cameraView);
|
|
708
695
|
cameraEnhancer.setScanRegion({
|
|
709
696
|
<span class="hljs-attr">x</span>: <span class="hljs-number">25</span>,
|
|
710
697
|
<span class="hljs-attr">y</span>: <span class="hljs-number">25</span>,
|
|
@@ -841,6 +828,7 @@ cvRouter.addResultReceiver(resultReceiver);
|
|
|
841
828
|
<h2 id="next-steps">Next Steps</h2>
|
|
842
829
|
<p>Now that you have got the SDK integrated, you can choose to move forward in the following directions</p>
|
|
843
830
|
<ol>
|
|
831
|
+
<li>Learn how to <a href="https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-in-framework.html">Use in Framework</a></li>
|
|
844
832
|
<li>Check out the <a href="https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=10.2.10">Official Samples and Demo</a></li>
|
|
845
833
|
<li>Learn about the <a href="https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/index.html?ver=10.2.10">APIs of the SDK</a></li>
|
|
846
834
|
</ol>
|
package/README.md
CHANGED
|
@@ -55,12 +55,12 @@ In this guide, you will learn step by step on how to integrate the DBR-JS SDK in
|
|
|
55
55
|
**Popular Examples**
|
|
56
56
|
|
|
57
57
|
- Hello World - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/hello-world/hello-world.html) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/hello-world.html?ver=10.2.10&utm_source=npm)
|
|
58
|
-
- Angular App - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/hello-world/angular) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/angular/dist/angular/?ver=10.2.10&utm_source=npm)
|
|
58
|
+
- Angular App - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/hello-world/angular) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/angular/dist/dbrjs-sample-angular/browser/?ver=10.2.10&utm_source=npm)
|
|
59
59
|
- React App - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/hello-world/react) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/react/build/?ver=10.2.10&utm_source=npm)
|
|
60
60
|
- Vue App - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/hello-world/vue) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/vue/dist/?ver=10.2.10&utm_source=npm)
|
|
61
61
|
- PWA App - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/hello-world/pwa) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/pwa/helloworld-pwa.html?ver=10.2.10&utm_source=npm)
|
|
62
62
|
- WebView in Android and iOS - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v10.2.10/hello-world/webview)
|
|
63
|
-
- Read Driver Licenses - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/use-case/read-a-drivers-license.html) \| [Run](https://demo.dynamsoft.com/samples/dbr/js/use-case/read-a-drivers-license.html?ver=10.2.10&utm_source=npm)
|
|
63
|
+
- Read Driver Licenses - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/use-case/read-a-drivers-license/index.html) \| [Run](https://demo.dynamsoft.com/samples/dbr/js/use-case/read-a-drivers-license/index.html?ver=10.2.10&utm_source=npm)
|
|
64
64
|
- Fill A Form - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/use-case/fill-a-form-with-barcode-reading.html) \| [Run](https://demo.dynamsoft.com/samples/dbr/js/use-case/fill-a-form-with-barcode-reading.html?ver=10.2.10&utm_source=npm)
|
|
65
65
|
- Show result information on the video - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/use-case/show-result-texts-on-the-video.html) \| [Run](https://demo.dynamsoft.com/Samples/DBR/JS/use-case/show-result-texts-on-the-video.html?ver=10.2.10&utm_source=npm)
|
|
66
66
|
- Debug Camera and Collect Video Frame - [Github](https://github.com/Dynamsoft/barcode-reader-javascript-samples/blob/v10.2.10/others/debug)
|
|
@@ -87,7 +87,7 @@ The complete code of the "Hello World" example is shown below
|
|
|
87
87
|
<!DOCTYPE html>
|
|
88
88
|
<html>
|
|
89
89
|
<body>
|
|
90
|
-
<div id="
|
|
90
|
+
<div id="camera-view-container" style="width: 100%; height: 60vh"></div>
|
|
91
91
|
<textarea id="results" style="width: 100%; min-height: 10vh; font-size: 3vmin; overflow: auto" disabled></textarea>
|
|
92
92
|
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@10.2.1000/dist/dbr.bundle.js"></script>
|
|
93
93
|
<script>
|
|
@@ -96,9 +96,9 @@ The complete code of the "Hello World" example is shown below
|
|
|
96
96
|
(async () => {
|
|
97
97
|
let cvRouter = await Dynamsoft.CVR.CaptureVisionRouter.createInstance();
|
|
98
98
|
|
|
99
|
-
let
|
|
100
|
-
let cameraEnhancer = await Dynamsoft.DCE.CameraEnhancer.createInstance(
|
|
101
|
-
document.querySelector("#
|
|
99
|
+
let cameraView = await Dynamsoft.DCE.CameraView.createInstance();
|
|
100
|
+
let cameraEnhancer = await Dynamsoft.DCE.CameraEnhancer.createInstance(cameraView);
|
|
101
|
+
document.querySelector("#camera-view-container").append(cameraView.getUIElement());
|
|
102
102
|
cvRouter.setInput(cameraEnhancer);
|
|
103
103
|
|
|
104
104
|
const resultsContainer = document.querySelector("#results");
|
|
@@ -154,7 +154,7 @@ The complete code of the "Hello World" example is shown below
|
|
|
154
154
|
```js
|
|
155
155
|
cvRouter.setInput(cameraEnhancer);
|
|
156
156
|
```
|
|
157
|
-
> The image source in our case is a [CameraEnhancer](https://www.dynamsoft.com/camera-enhancer/docs/web/programming/javascript/user-guide/index.html) object created with `Dynamsoft.DCE.CameraEnhancer.createInstance(
|
|
157
|
+
> The image source in our case is a [CameraEnhancer](https://www.dynamsoft.com/camera-enhancer/docs/web/programming/javascript/user-guide/index.html) object created with `Dynamsoft.DCE.CameraEnhancer.createInstance(cameraView)`
|
|
158
158
|
- **Coordinate Image-Processing Tasks**
|
|
159
159
|
- The coordination happens behind the scenes. `cvRouter` starts the process by specifying a preset template "ReadSingleBarcode" in the method `startCapturing()`.
|
|
160
160
|
```js
|
|
@@ -174,7 +174,7 @@ The complete code of the "Hello World" example is shown below
|
|
|
174
174
|
|
|
175
175
|
### Run the example
|
|
176
176
|
|
|
177
|
-
You can run the example deployed to [the Dynamsoft Demo Server](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/hello-world.html?ver=10.2.10&utm_source=npm) or test it with [JSFiddle code editor](https://jsfiddle.net/DynamsoftTeam/
|
|
177
|
+
You can run the example deployed to [the Dynamsoft Demo Server](https://demo.dynamsoft.com/Samples/DBR/JS/hello-world/hello-world.html?ver=10.2.10&utm_source=npm) or test it with [JSFiddle code editor](https://jsfiddle.net/DynamsoftTeam/csm2f9wb/).
|
|
178
178
|
|
|
179
179
|
You will be asked to allow access to your camera, after which the video will be displayed on the page. After that, you can point the camera at a barcode to read it.
|
|
180
180
|
|
|
@@ -201,26 +201,14 @@ If the test doesn't go as expected, you can [contact us](https://www.dynamsoft.c
|
|
|
201
201
|
|
|
202
202
|
To utilize the SDK, the initial step involves including the corresponding resource files:
|
|
203
203
|
|
|
204
|
-
* `core.js` encompasses common classes, interfaces, and enumerations
|
|
204
|
+
* `core.js` encompasses common classes, interfaces, and enumerations shared across all Dynamsoft SDKs.
|
|
205
205
|
* `license.js` introduces the `LicenseManager` class, which manages the licensing for all Dynamsoft SDKs.
|
|
206
|
-
* `utility.js` encompasses auxiliary classes
|
|
207
|
-
* `dbr.js` defines interfaces and enumerations
|
|
206
|
+
* `utility.js` encompasses auxiliary classes shared among all Dynamsoft SDKs.
|
|
207
|
+
* `dbr.js` defines interfaces and enumerations tailored to the barcode reader module.
|
|
208
208
|
* `cvr.js` introduces the `CaptureVisionRouter` class, which governs the entire image processing workflow.
|
|
209
209
|
* `dce.js` comprises classes that offer camera support and basic user interface functionalities.
|
|
210
210
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
* dynamsoft-core@3.2.30/dist/core.js
|
|
214
|
-
* dynamsoft-license@3.2.21/dist/license.js
|
|
215
|
-
* dynamsoft-utility@1.2.20/dist/utility.js
|
|
216
|
-
* dynamsoft-barcode-reader@10.2.10/dist/dbr.js
|
|
217
|
-
* dynamsoft-capture-vision-router@2.2.30/dist/cvr.js
|
|
218
|
-
* dynamsoft-camera-enhancer@4.0.3/dist/dce.js
|
|
219
|
-
|
|
220
|
-
Equivalent to
|
|
221
|
-
* dynamsoft-barcode-reader-bundle@10.2.1000/dist/dbr.bundle.js
|
|
222
|
-
|
|
223
|
-
In the following chapters, we will use `dbr.bundle.js`.
|
|
211
|
+
To simplify things, starting from version 10.0.21, we introduced `dbr.bundle.js`, which combines all six of the above files. In the following chapters, we will use `dbr.bundle.js`.
|
|
224
212
|
|
|
225
213
|
#### Use a public CDN
|
|
226
214
|
|
|
@@ -246,45 +234,48 @@ The simplest way to include the SDK is to use either the [jsDelivr](https://jsde
|
|
|
246
234
|
|
|
247
235
|
However, please **DO NOT** use `download2.dynamsoft.com` resources in a production application as they are for temporary testing purposes only. Instead, you can try hosting the SDK yourself.
|
|
248
236
|
|
|
237
|
+
- In frameworks like React and Vue, you may want to add the package as a dependency.
|
|
238
|
+
|
|
239
|
+
```sh
|
|
240
|
+
npm i dynamsoft-barcode-reader-bundle@10.2.1000 -E
|
|
241
|
+
# or
|
|
242
|
+
yarn add dynamsoft-barcode-reader-bundle@10.2.1000 -E
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
NOTE that in frameworks, you need to [specify the engineResourcePaths](#specify-the-location-of-the-engine-files-optional).
|
|
246
|
+
|
|
249
247
|
#### Host the SDK yourself (optional)
|
|
250
248
|
|
|
251
249
|
Besides using the public CDN, you can also download the SDK and host its files on your own server or a commercial CDN before including it in your application.
|
|
252
250
|
|
|
253
|
-
|
|
251
|
+
There are two options for downloading the SDK, and the usage for each is slightly different
|
|
254
252
|
|
|
255
253
|
- From the website
|
|
256
254
|
|
|
257
255
|
[Download Dynamsoft Barcode Reader JavaScript Package](https://www.dynamsoft.com/barcode-reader/downloads/?ver=10.2.10&utm_source=npm&product=dbr&package=js)
|
|
258
256
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
```cmd
|
|
262
|
-
npm i dynamsoft-barcode-reader-bundle@10.2.1000 -E
|
|
263
|
-
npm i dynamsoft-capture-vision-std@1.2.0 -E
|
|
264
|
-
npm i dynamsoft-image-processing@2.2.10 -E
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
- yarn
|
|
257
|
+
The resources are located at path `dynamsoft/distributables/<pkg>@<version>`, you can typically include it like this:
|
|
268
258
|
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
yarn add dynamsoft-capture-vision-std@1.2.0 -E
|
|
272
|
-
yarn add dynamsoft-image-processing@2.2.10 -E
|
|
259
|
+
```html
|
|
260
|
+
<script src="dynamsoft/distributables/dynamsoft-barcode-reader-bundle@10.2.1000/dist/dbr.bundle.js"></script>
|
|
273
261
|
```
|
|
274
262
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
- From the website
|
|
263
|
+
- npm
|
|
278
264
|
|
|
279
|
-
```
|
|
280
|
-
|
|
265
|
+
```sh
|
|
266
|
+
npm i dynamsoft-barcode-reader-bundle@10.2.1000 -E
|
|
267
|
+
# Compared with using CDN, you need to set up more resources.
|
|
268
|
+
npm i dynamsoft-capture-vision-std@1.2.10 -E
|
|
269
|
+
npm i dynamsoft-image-processing@2.2.30 -E
|
|
281
270
|
```
|
|
282
271
|
|
|
283
|
-
|
|
272
|
+
The resources are located at the path `node_modules/<pkg>`, without `@<version>`, so the script would be like:
|
|
284
273
|
|
|
285
274
|
```html
|
|
286
|
-
<script src="
|
|
275
|
+
<script src="node_modules/dynamsoft-barcode-reader-bundle/dist/dbr.bundle.js"></script>
|
|
287
276
|
```
|
|
277
|
+
|
|
278
|
+
Since `@<version>` are missing, you need to [specify the engineResourcePaths](#specify-the-location-of-the-engine-files-optional).
|
|
288
279
|
|
|
289
280
|
*Note*:
|
|
290
281
|
|
|
@@ -315,7 +306,7 @@ To enable the SDK's functionality, you must provide a valid license. Utilize the
|
|
|
315
306
|
Dynamsoft.License.LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9");
|
|
316
307
|
```
|
|
317
308
|
|
|
318
|
-
As previously stated, the key "DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9" serves as a test license valid for 24 hours, applicable to any newly authorized browser. To test the SDK further, you can request a 30-day free trial license via the
|
|
309
|
+
As previously stated, the key "DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9" serves as a test license valid for 24 hours, applicable to any newly authorized browser. To test the SDK further, you can request a 30-day free trial license via the <a href="https://www.dynamsoft.com/customer/license/trialLicense?ver=10.2.10&utm_source=npm&product=dbr&package=js" target="_blank">Request a Trial License</a> link.
|
|
319
310
|
|
|
320
311
|
> Upon registering a Dynamsoft account and obtaining the SDK package from the official website, Dynamsoft will automatically create a 30-day free trial license and embed the corresponding license key into all the provided SDK samples.
|
|
321
312
|
|
|
@@ -328,13 +319,13 @@ The purpose is to tell the SDK where to find the engine files (\*.worker.js, \*.
|
|
|
328
319
|
```javascript
|
|
329
320
|
//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files
|
|
330
321
|
Object.assign(Dynamsoft.Core.CoreModule.engineResourcePaths, {
|
|
331
|
-
std: "https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-std@1.2.
|
|
332
|
-
dip: "https://cdn.jsdelivr.net/npm/dynamsoft-image-processing@2.2.
|
|
333
|
-
core: "https://cdn.jsdelivr.net/npm/dynamsoft-core@3.2.
|
|
334
|
-
license: "https://cdn.jsdelivr.net/npm/dynamsoft-license@3.2.
|
|
335
|
-
cvr: "https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-router@2.2.
|
|
322
|
+
std: "https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-std@1.2.10/dist/",
|
|
323
|
+
dip: "https://cdn.jsdelivr.net/npm/dynamsoft-image-processing@2.2.30/dist/",
|
|
324
|
+
core: "https://cdn.jsdelivr.net/npm/dynamsoft-core@3.2.30/dist/",
|
|
325
|
+
license: "https://cdn.jsdelivr.net/npm/dynamsoft-license@3.2.21/dist/",
|
|
326
|
+
cvr: "https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-router@2.2.30/dist/",
|
|
336
327
|
dbr: "https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader@10.2.10/dist/",
|
|
337
|
-
dce: "https://cdn.jsdelivr.net/npm/dynamsoft-camera-enhancer@4.0.
|
|
328
|
+
dce: "https://cdn.jsdelivr.net/npm/dynamsoft-camera-enhancer@4.0.3/dist/"
|
|
338
329
|
});
|
|
339
330
|
```
|
|
340
331
|
|
|
@@ -366,7 +357,7 @@ try {
|
|
|
366
357
|
|
|
367
358
|
*Tip*:
|
|
368
359
|
|
|
369
|
-
When creating a `CaptureVisionRouter` object within a function which may be called more than once, it's best to use a "helper" variable to avoid double creation such as `
|
|
360
|
+
When creating a `CaptureVisionRouter` object within a function which may be called more than once, it's best to use a "helper" variable to avoid double creation such as `pCvRouter` in the following code:
|
|
370
361
|
|
|
371
362
|
```javascript
|
|
372
363
|
Dynamsoft.License.LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9");
|
|
@@ -387,16 +378,16 @@ document.getElementById('btn-scan').addEventListener('click', async () => {
|
|
|
387
378
|
|
|
388
379
|
The `CaptureVisionRouter` object, denoted as `cvRouter`, is responsible for handling images provided by an image source. In our scenario, we aim to detect barcodes directly from a live video stream. To facilitate this, we initialize a `CameraEnhancer` object, identified as `cameraEnhancer`, which is specifically designed to capture image frames from the video feed and subsequently forward them to `cvRouter`.
|
|
389
380
|
|
|
390
|
-
To enable video streaming on the webpage, we create a `CameraView` object referred to as `
|
|
381
|
+
To enable video streaming on the webpage, we create a `CameraView` object referred to as `cameraView`, which is then passed to `cameraEnhancer`, and its content is displayed on the webpage.
|
|
391
382
|
|
|
392
383
|
```html
|
|
393
|
-
<div id="
|
|
384
|
+
<div id="camera-view-container" style="width: 100%; height: 100vh"></div>
|
|
394
385
|
```
|
|
395
386
|
|
|
396
387
|
```javascript
|
|
397
|
-
let
|
|
398
|
-
let cameraEnhancer = await Dynamsoft.DCE.CameraEnhancer.createInstance(
|
|
399
|
-
document.querySelector("#
|
|
388
|
+
let cameraView = await Dynamsoft.DCE.CameraView.createInstance();
|
|
389
|
+
let cameraEnhancer = await Dynamsoft.DCE.CameraEnhancer.createInstance(cameraView);
|
|
390
|
+
document.querySelector("#camera-view-container").append(cameraView.getUIElement());
|
|
400
391
|
cvRouter.setInput(cameraEnhancer);
|
|
401
392
|
```
|
|
402
393
|
|
|
@@ -560,7 +551,7 @@ While the code above accomplishes the task, a more effective approach is to rest
|
|
|
560
551
|
> * See also: [CameraEnhancer::setScanRegion](https://www.dynamsoft.com/camera-enhancer/docs/web/programming/javascript/api-reference/acquisition.html#setscanregion)
|
|
561
552
|
|
|
562
553
|
```javascript
|
|
563
|
-
cameraEnhancer = await Dynamsoft.DCE.CameraEnhancer.createInstance(
|
|
554
|
+
cameraEnhancer = await Dynamsoft.DCE.CameraEnhancer.createInstance(cameraView);
|
|
564
555
|
cameraEnhancer.setScanRegion({
|
|
565
556
|
x: 25,
|
|
566
557
|
y: 25,
|
|
@@ -723,5 +714,6 @@ Learn about what are included in each release at [https://www.dynamsoft.com/barc
|
|
|
723
714
|
|
|
724
715
|
Now that you have got the SDK integrated, you can choose to move forward in the following directions
|
|
725
716
|
|
|
726
|
-
1.
|
|
727
|
-
2.
|
|
717
|
+
1. Learn how to [Use in Framework](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/use-in-framework.html)
|
|
718
|
+
2. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=10.2.10)
|
|
719
|
+
3. Learn about the [APIs of the SDK](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/index.html?ver=10.2.10)
|