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: SimpleHTMLApp/README.md
+70-22Lines changed: 70 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
-
# Acuant JavaScript Web SDK v11.3.3
1
+
# Acuant JavaScript Web SDK v11.4.0
2
2
3
3
4
-
**June 2020**
4
+
**July 2020**
5
5
6
6
----------
7
7
@@ -10,15 +10,12 @@
10
10
This document provides detailed information about the Acuant JavaScript Web SDK. The JavaScript Web SDK allows developers to integrate image capture and processing functionality in their mobile web applications.
11
11
12
12
----------
13
-
## Supported browsers
14
13
15
-
The JavaScript Web SDK supports the following web browsers for live capture of ID documents:
16
-
17
-
-**Android**: Chrome, Firefox11.
18
-
-**iOS**: Safari
14
+
# Updates
19
15
20
-
For other browsers, regular HTML capture is used.
16
+
**v11.4.0:** Please review [v11.4.0 Migration Details](docs/MigrationDetail11.4.0.md) for migration details.
21
17
18
+
----------
22
19
23
20
## Modules
24
21
@@ -40,7 +37,7 @@ The SDK includes the following modules:
40
37
- HTML5 Web Worker to process the images
41
38
42
39
----------
43
-
###Setup
40
+
## Setup
44
41
45
42
1. Add the following dependencies on these files (**Note**: These files should be accessible by HTTP in the public resource directory of the hosted application.):
46
43
- **AcuantJavaScriptSdk.min.js**
@@ -54,7 +51,7 @@ The SDK includes the following modules:
54
51
55
52
1. Definte a custom path to load files (if different than root):
56
53
57
-
const acuantConfig = = {
54
+
const acuantConfig = {
58
55
path: "/custom/path/to/sdk/"
59
56
}
60
57
@@ -135,6 +132,22 @@ The following may significantly increase errors or false results:
135
132
}
136
133
})
137
134
135
+
----------
136
+
## Live Capture using WebRTC
137
+
138
+
**Supported browsers**
139
+
140
+
The JavaScript Web SDK supports the following web browsers for live capture of ID documents:
141
+
142
+
-**Android**: Chrome
143
+
-**iOS**: Safari, with iOS version <= 13.0
144
+
145
+
For other browsers, regular HTML capture is used.
146
+
147
+
**Camera Preview**
148
+
149
+
-**Android**: Android uses browser supported fullScreen mode for camera preview. User can exit out of this fullscreen mode. We recommend hiding all elements on page while camera is shown.
150
+
-**iOS**: iOS will fill up screen height with camera preview. We recommend hiding all elements on page while camera is shown.
138
151
139
152
140
153
----------
@@ -147,7 +160,7 @@ The following may significantly increase errors or false results:
147
160
1. Initialize the Worker. (**Note**: If worker has not been started, this call will start the Worker.)
148
161
149
162
function initialize(
150
-
token : string, //token provieded by Acuant
163
+
token : string, //token provided by Acuant
151
164
endpoint : string, //Acuant endpoint
152
165
callback: object); //callback shown below
153
166
@@ -193,14 +206,45 @@ The following may significantly increase errors or false results:
193
206
194
207
1. Start the Camera and get result.
195
208
196
-
AcuantCameraUI.start((response) => {
197
-
//use response if needed
198
-
//end
199
-
}, (error) => {
200
-
alert("Camera not supported\n" + error);
201
-
}, options);
202
-
203
-
1. End Camera.
209
+
var cameraCallback = {
210
+
onCaptured: function(response){
211
+
//document captured
212
+
//this is not the final result of processed image
213
+
//show a loading screen until onCropped is called
214
+
},
215
+
onCropped: function(response){
216
+
if (response) {
217
+
//use response
218
+
}
219
+
else{
220
+
//cropping error
221
+
//restart capture
222
+
}
223
+
},
224
+
onFrameAvailable: function(response){
225
+
//get each frame if needed
226
+
//console.log(response)
227
+
response = {
228
+
type: Number,
229
+
dimensions: Object,
230
+
dpi: Number,
231
+
isCorrectAspectRatio: Boolean,
232
+
points: Array,
233
+
state: Number => {
234
+
NO_DOCUMENT: 0,
235
+
SMALL_DOCUMENT: 1,
236
+
GOOD_DOCUMENT: 2
237
+
}
238
+
}
239
+
}
240
+
}
241
+
242
+
AcuantCameraUI.start(cameraCallback, (error) => {
243
+
//constraint error or camera not supported
244
+
//show manual capture
245
+
}, options)
246
+
247
+
1. End Camera. **NOTE** Once AcuantCameraUI onCaptured is called, the end API is internally executed.
204
248
205
249
AcuantCameraUI.end();
206
250
----------
@@ -275,7 +319,7 @@ The following may significantly increase errors or false results:
@@ -284,7 +328,11 @@ The following may significantly increase errors or false results:
284
328
}
285
329
});
286
330
287
-
1. Manual Capture:
331
+
1. Manual Capture:
332
+
333
+
**IMPORTANT**: AcuantCamera manual capture uses \<input type="file"/> html tags to access the native camera. This REQUIRES a user initiated event to start the camera.
334
+
335
+
**NOTE**: We recommend not hiding any UI elements when starting manual capture. Be aware users will be able to cancel out of the native camera screen.
288
336
289
337
AcuantCamera.startManualCapture({
290
338
onCaptured: function(){
@@ -357,7 +405,7 @@ The following may significantly increase errors or false results:
0 commit comments