Skip to content

Commit 54d6b4e

Browse files
committed
added v11.4.0
1 parent 9c37d6a commit 54d6b4e

File tree

5 files changed

+677
-358
lines changed

5 files changed

+677
-358
lines changed

SimpleHTMLApp/README.md

Lines changed: 70 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Acuant JavaScript Web SDK v11.3.3
1+
# Acuant JavaScript Web SDK v11.4.0
22

33

4-
**June 2020**
4+
**July 2020**
55

66
----------
77

@@ -10,15 +10,12 @@
1010
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.
1111

1212
----------
13-
## Supported browsers
1413

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
1915

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.
2117

18+
----------
2219

2320
## Modules
2421

@@ -40,7 +37,7 @@ The SDK includes the following modules:
4037
- HTML5 Web Worker to process the images
4138

4239
----------
43-
### Setup
40+
## Setup
4441

4542
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.):
4643
- **AcuantJavaScriptSdk.min.js**
@@ -54,7 +51,7 @@ The SDK includes the following modules:
5451

5552
1. Definte a custom path to load files (if different than root):
5653

57-
const acuantConfig = = {
54+
const acuantConfig = {
5855
path: "/custom/path/to/sdk/"
5956
}
6057
@@ -135,6 +132,22 @@ The following may significantly increase errors or false results:
135132
}
136133
})
137134
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.
138151

139152

140153
----------
@@ -147,7 +160,7 @@ The following may significantly increase errors or false results:
147160
1. Initialize the Worker. (**Note**: If worker has not been started, this call will start the Worker.)
148161

149162
function initialize(
150-
token : string, //token provieded by Acuant
163+
token : string, //token provided by Acuant
151164
endpoint : string, //Acuant endpoint
152165
callback: object); //callback shown below
153166

@@ -193,14 +206,45 @@ The following may significantly increase errors or false results:
193206

194207
1. Start the Camera and get result.
195208

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.
204248

205249
AcuantCameraUI.end();
206250
----------
@@ -275,7 +319,7 @@ The following may significantly increase errors or false results:
275319
},
276320
glare: Number,
277321
sharpness: Number,
278-
isPassport: Boolean,
322+
cardType: Number,//define card type, None = 0, ID = 1, Passport = 2
279323
dpi: Number
280324
}
281325
}
@@ -284,7 +328,11 @@ The following may significantly increase errors or false results:
284328
}
285329
});
286330
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.
288336
289337
AcuantCamera.startManualCapture({
290338
onCaptured: function(){
@@ -357,7 +405,7 @@ The following may significantly increase errors or false results:
357405
dpi: Number,
358406
sharpness: Number,
359407
glare: Number,
360-
isPassport: Boolean,
408+
cardType: Number,//card type, 0 = None, 1 = ID, 2 = Passport
361409
image:{
362410
data: String,
363411
width: Number,

0 commit comments

Comments
 (0)