@tsocial/tvweb-sdk 5.5.0 → 5.5.1
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/assets/.DS_Store +0 -0
- package/build/tvweb-sdk.cjs.min.js +7 -7
- package/build/tvweb-sdk.standalone.min.js +2 -2
- package/examples/.DS_Store +0 -0
- package/examples/extract-id-info-and-liveness-detection/.DS_Store +0 -0
- package/examples/extract-id-info-and-liveness-detection/index.html +24 -19
- package/package.json +5 -5
package/examples/.DS_Store
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -11,6 +11,13 @@
|
|
|
11
11
|
<h2>Extract ID Info & Liveness detection</h2>
|
|
12
12
|
<div id="container"></div>
|
|
13
13
|
|
|
14
|
+
<div style="margin-bottom: 10px">
|
|
15
|
+
Language
|
|
16
|
+
<select id="select-lang" onchange="onSelectLang()">
|
|
17
|
+
<option value="vi" selected>vi</option>
|
|
18
|
+
<option value="en">en</option>
|
|
19
|
+
</select>
|
|
20
|
+
</div>
|
|
14
21
|
<div style="margin-bottom: 10px">
|
|
15
22
|
<label>
|
|
16
23
|
Keys:
|
|
@@ -102,10 +109,6 @@
|
|
|
102
109
|
<option value="false">Back</option>
|
|
103
110
|
</select>
|
|
104
111
|
</div>
|
|
105
|
-
<div>
|
|
106
|
-
<div>Custom step time constraints (ms):</div>
|
|
107
|
-
<textarea cols="25" rows="15" id="custom-step-time-constraints"></textarea>
|
|
108
|
-
</div>
|
|
109
112
|
<button onclick="startLivenessDetection()" id="btn-start-liveness">
|
|
110
113
|
Liveness detection
|
|
111
114
|
</button>
|
|
@@ -142,11 +145,21 @@
|
|
|
142
145
|
inputAccessKey.value = accessKey;
|
|
143
146
|
inputSecretKey.value = secretKey;
|
|
144
147
|
}
|
|
148
|
+
function onSelectLang() {
|
|
149
|
+
const langEle = document.getElementById("select-lang");
|
|
150
|
+
localStorage.setItem('lang', langEle?.value);
|
|
151
|
+
location.reload();
|
|
152
|
+
}
|
|
145
153
|
</script>
|
|
146
154
|
<script type="text/javascript">
|
|
155
|
+
const lang = localStorage.getItem('lang');
|
|
156
|
+
if (lang) {
|
|
157
|
+
const langEle = document.getElementById("select-lang");
|
|
158
|
+
langEle.value = lang;
|
|
159
|
+
}
|
|
147
160
|
const tv = new TVWebSDK.SDK({
|
|
148
161
|
container: document.getElementById("container"),
|
|
149
|
-
lang: "vi",
|
|
162
|
+
lang: lang || "vi",
|
|
150
163
|
assetRoot: "https://unpkg.com/tv-model-prod@1.0.7/assets",
|
|
151
164
|
enableAntiDebug: false,
|
|
152
165
|
});
|
|
@@ -165,7 +178,6 @@
|
|
|
165
178
|
const userIdEl = document.getElementById("user-id");
|
|
166
179
|
const trackingConfigEl = document.getElementById("tracking-config");
|
|
167
180
|
const readIdCardLoadingEl = document.getElementById("read-id-card-loading");
|
|
168
|
-
const customStepTimeConstraintsEl = document.getElementById("custom-step-time-constraints");
|
|
169
181
|
const statusWarmupReadIDCardEl = document.getElementById("status-warmup-read-id-card");
|
|
170
182
|
const livenessLoadingEl = document.getElementById("liveness-loading");
|
|
171
183
|
const startLivenessBtn = document.getElementById("btn-start-liveness");
|
|
@@ -198,14 +210,6 @@
|
|
|
198
210
|
selectModeEl.appendChild(option);
|
|
199
211
|
});
|
|
200
212
|
|
|
201
|
-
const customStepTimeConstraintsData = {
|
|
202
|
-
[TVWebSDK.Constants.FaceDirection.UP]: { delayTime: 1000 },
|
|
203
|
-
[TVWebSDK.Constants.FaceDirection.LEFT]: { delayTime: 1000 },
|
|
204
|
-
[TVWebSDK.Constants.FaceDirection.RIGHT]: { delayTime: 1000 },
|
|
205
|
-
[TVWebSDK.Constants.FaceDirection.FRONTAL]: { delayTime: 2000 },
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
customStepTimeConstraintsEl.value = JSON.stringify(customStepTimeConstraintsData, null, 2);
|
|
209
213
|
idCardSettingsEl.value = JSON.stringify(TVWebSDK.defaultClientSettings, null, 2);
|
|
210
214
|
idCardStepsEl.value = JSON.stringify(TVWebSDK.defaultReadIDCardSteps, null, 2);
|
|
211
215
|
trackingConfigEl.value = JSON.stringify(TVWebSDK.TrackingContext.defaultTrackingConfig, null, 2);
|
|
@@ -324,15 +328,16 @@
|
|
|
324
328
|
tv.livenessDetection({
|
|
325
329
|
apiCheck: apiCheck,
|
|
326
330
|
mode: livenessDetectionMode,
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
331
|
+
apiCredentials: {
|
|
332
|
+
accessKey: inputAccessKey.value,
|
|
333
|
+
secretKey: inputSecretKey.value,
|
|
334
|
+
apiUrl: inputApiUrl.value,
|
|
335
|
+
},
|
|
330
336
|
onLivenessDetectionDone: handleLivenessDetectionDone,
|
|
331
|
-
customStepTimeConstraints: JSON.parse(customStepTimeConstraintsEl.value),
|
|
332
337
|
captureFrameSettings: {
|
|
333
338
|
enable: true,
|
|
334
339
|
framesIntervalTime: 180,
|
|
335
|
-
framesBatchLength:
|
|
340
|
+
framesBatchLength: 15,
|
|
336
341
|
},
|
|
337
342
|
onError: (e) => {
|
|
338
343
|
livenessLoadingEl.style.display = "none";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsocial/tvweb-sdk",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.1",
|
|
4
4
|
"description": "TV Web SDK - The Standalone SDK",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "Nha Hoang <nha.hoang@trustingsocial.com>",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@tsocial/trustvision-sdk": "2.10.1",
|
|
27
|
-
"@tsocial/tvweb-core": "^5.
|
|
28
|
-
"@tsocial/tvweb-ui": "^5.5.
|
|
27
|
+
"@tsocial/tvweb-core": "^5.5.1",
|
|
28
|
+
"@tsocial/tvweb-ui": "^5.5.1",
|
|
29
29
|
"http-server": "0.12.3",
|
|
30
30
|
"invariant": "^2.2.4",
|
|
31
31
|
"react": "^16.14.0",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"styled-components": "^5.2.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@tsocial/tvweb-builder": "^5.
|
|
37
|
+
"@tsocial/tvweb-builder": "^5.5.1"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "31b9035fa1458ed3cf11eb0848f9062bb5a93684"
|
|
40
40
|
}
|