You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1.hello-world/README.md
+35-11Lines changed: 35 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ Let's break down each of the samples
8
8
9
9
## Hello World - Read Barcodes via Video
10
10
11
-
In this sample, you will find the basic lines of code ncessary to initialize the SDK and set it up.
11
+
In this sample, you will find the basic lines of code necessary to initialize the SDK and set it up.
12
12
13
13
Let's quickly break down the methods used in order:
14
14
@@ -30,47 +30,71 @@ In this sample, a event listener is set up so that the SDK decodes any image tha
30
30
31
31
## Hello World in Angular
32
32
33
-
Read more on the sample [here](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-angular.html).
33
+
Read more in the README under "3.read-video-angular".
34
34
35
35
## Hello World in React
36
36
37
-
Read more on the sample [here](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-reactjs.html).
37
+
Read more in the README under "4.read-video-react".
38
+
39
+
## Hello World in React with Hooks
40
+
41
+
Read more in the README under "13.read-video-react-hook".
38
42
39
43
## Hello World in Vue 2
40
44
41
-
Read more on the sample [here](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-vuejs.html).
45
+
Read more in the README under "5.read-video-vue".
42
46
43
47
## Hello World in Vue 3
44
48
45
-
Read more on the sample [here](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-vuejsv3.html).
49
+
Read more in the README under "6.read-video-vue3".
46
50
47
51
## Hello World in Next.js
48
52
49
-
Read more on the sample [here](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-nextjs.html).
53
+
Read more in the README under "7.read-video-nextjs".
50
54
51
55
## Hello World in NuxtJS
52
56
53
-
Read more on the sample [here](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-nuxtjs.html).
57
+
Read more in the README under "8.read-video-nuxtjs".
54
58
55
59
## Hello World in Electron
56
60
57
-
Read more on the sample [here](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-electron.html).
61
+
Read more in the README under "9.read-video-electron".
58
62
59
63
## Hello World in PWA
60
64
61
-
Read more on the sample [here](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-pwa.html).
65
+
Read more in the README under "10.read-video-pwa".
62
66
63
67
## Hello World with RequireJS
64
68
65
-
Read more on the sample [here](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-requirejs.html).
69
+
This sample shows how to use the SDK in a web page based on RequireJS.
70
+
71
+
Let's quickly break down the methods used in order:
72
+
73
+
*`license`: This property specifies a license key. Read more on Specify the license.
74
+
*`createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the MediaDevices interface.
75
+
*`onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.
76
+
*`onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.
77
+
*`show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning
78
+
79
+
In fact, `onFrameRead` and `onUniqueRead` do not have to both be defined in the code. `onUniqueRead` is the more used one between the two as it is triggered when a new barcode is found rather than on every frame.
66
80
67
81
## Hello World with ES6
68
82
69
83
This sample shows how to use the SDK in a web page based on ES6 (also known as ECMAScript 2015 or ECMAScript 6).
70
84
85
+
Let's quickly break down the methods used in order:
86
+
87
+
*`license`: This property specifies a license key. Read more on Specify the license.
88
+
*`createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the MediaDevices interface.
89
+
*`onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The `results` object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.
90
+
*`onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. `txt` holds the barcode text value while `result` is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.
91
+
*`show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning
92
+
93
+
In fact, `onFrameRead` and `onUniqueRead` do not have to both be defined in the code. `onUniqueRead` is the more used one between the two as it is triggered when a new barcode is found rather than on every frame.
94
+
71
95
## Hello World with WebView
72
96
73
-
This sample shows how to use Mobile SDK in web pages through webview, you can read more in moblie samples repository:[Android](https://github.com/Dynamsoft/barcode-reader-mobile-samples/tree/main/android/JavaScript/WebViewBarcodeScanning)/[iOS](https://github.com/Dynamsoft/barcode-reader-mobile-samples/tree/main/ios/JavaScript/WebViewBarcodeScanning).
97
+
Read more in the README under "14.read-video-webview".
0 commit comments