@tsocial/tvweb-sdk 5.5.0 → 5.6.0

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.
@@ -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
- accessKey: inputAccessKey.value,
328
- secretKey: inputSecretKey.value,
329
- apiUrl: inputApiUrl.value,
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: 0,
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.0",
3
+ "version": "5.6.0",
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.4.5",
28
- "@tsocial/tvweb-ui": "^5.5.0",
27
+ "@tsocial/tvweb-core": "^5.6.0",
28
+ "@tsocial/tvweb-ui": "^5.6.0",
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.4.5"
37
+ "@tsocial/tvweb-builder": "^5.5.3"
38
38
  },
39
- "gitHead": "dae417f2f6501055f9755461ba5ac524a585457f"
39
+ "gitHead": "a6b14ed5f04e6f7f2f379349494cbbe05a8e0e0a"
40
40
  }