@tsocial/tvweb-sdk.tcb.bss 5.8.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.
@@ -0,0 +1,457 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
6
+ <meta name="description" content="Vanilla JS demo" />
7
+ <link rel="preconnect" href="https://fonts.googleapis.com">
8
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
10
+ <link rel="stylesheet" href="./style.css" />
11
+ </head>
12
+ <body>
13
+ <noscript>You need to enable JavaScript to run this app.</noscript>
14
+ <h2>Extract ID Info & Liveness detection</h2>
15
+ <div id="container"></div>
16
+
17
+ <div id="content">
18
+ <div style="margin-bottom: 10px">
19
+ Language
20
+ <select id="select-lang" onchange="onSelectLang()">
21
+ <option value="vi" selected>vi</option>
22
+ <option value="en">en</option>
23
+ </select>
24
+ </div>
25
+ <div style="margin-bottom: 10px">
26
+ <label>
27
+ Keys:
28
+ <select id="select-api-key" onchange="onSelectKey()">
29
+ <option value="0" selected>Web face tracking (..a31)</option>
30
+ <option value="1">QA (..217)</option>
31
+ <option value="2">Labeller test real data (..3b2)</option>
32
+ <option value="3">Labeller test fake data (..ac4)</option>
33
+ </select>
34
+ </label>
35
+ </div>
36
+ <div style="margin-bottom: 10px">
37
+ <label>
38
+ Access key
39
+ <input id="access-key" style="width: 500px" />
40
+ </label>
41
+ </div>
42
+ <div style="margin-bottom: 10px">
43
+ <label>
44
+ Secret key
45
+ <input id="secret-key" style="width: 500px" />
46
+ </label>
47
+ </div>
48
+ <div style="margin-bottom: 10px">
49
+ <label>
50
+ API URL
51
+ <input id="api-url" style="width: 500px" />
52
+ </label>
53
+ </div>
54
+ <div>
55
+ Api check
56
+ <select id="select-api-check">
57
+ <option value="false">false</option>
58
+ <option value="true" selected>true</option>
59
+ </select>
60
+ </div>
61
+
62
+ <div style="display: none; margin-top: 10px;">
63
+ <label>
64
+ Cached User ID
65
+ <input id="user-id" readonly style="width: 300px" />
66
+ </label>
67
+ <button onclick="clearUserId()">Clear user id (x-request-id)</button>
68
+ </div>
69
+
70
+ <div style="display: none; margin-top: 10px;">
71
+ <div>
72
+ Tracking config
73
+ <select id="select-tracking-config-template" onchange="onSelectTrackingConfigTemplate()">
74
+ <option value="0" selected>default</option>
75
+ <option value="1">Engineering test (...9fe5)</option>
76
+ </select>
77
+ </div>
78
+ <textarea cols="55" rows="8" id="tracking-config"></textarea>
79
+ </div>
80
+
81
+ <hr />
82
+ <h4>Extract ID Info</h4>
83
+ <div style="display: none; margin-right: 20px;">
84
+ <div>Settings (notice that if <strong>Api check: true</strong>, settings from api will overwrite these settings)</div>
85
+ <textarea cols="55" rows="15" id="id-card-settings"></textarea>
86
+ </div>
87
+ <div style="display: none">
88
+ <div>Steps</div>
89
+ <textarea cols="55" rows="15" id="id-card-steps"></textarea>
90
+ </div>
91
+ <div style="margin-bottom: 10px">
92
+ <button onclick="runPreloadEKYCResources()">Preload Resources</button>
93
+ </div>
94
+ <div style="margin-bottom: 10px">
95
+ <button onclick="runWarmUpReadIDCard()">Warm up</button>
96
+ <span id="status-warmup-read-id-card"></span>
97
+ </div>
98
+ <button onclick="startExtractIDInfo()">Start</button>
99
+ <pre id="result-extract-id-info"></pre>
100
+ <div id="read-id-card-loading" style="margin-top: 10px; display: none;">
101
+ Api checking
102
+ <div class="dot-windmill"></div>
103
+ </div>
104
+
105
+ <hr />
106
+
107
+ <h4>Liveness detection</h4>
108
+ <div style="display: none">
109
+ Mode:
110
+ <select id="select-mode"></select>
111
+ </div>
112
+ <div style="display: none">
113
+ Camera:
114
+ <select id="select-camera">
115
+ <option value="true">Front</option>
116
+ <option value="false">Back</option>
117
+ </select>
118
+ </div>
119
+ <button onclick="startLivenessDetection()" id="btn-start-liveness">
120
+ Liveness detection
121
+ </button>
122
+ <div id="liveness-loading" style="padding-top: 10px; display: none;">
123
+ Api checking
124
+ <div class="dot-windmill"></div>
125
+ </div>
126
+ <div id="result-liveness-detection"></div>
127
+ <div style="height: 100px;"></div>
128
+ </div>
129
+
130
+ <script src="https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js"></script>
131
+ <script src="https://unpkg.com/@tsocial/trustvision-sdk@2.10.1/dist/trustvision-sdk.umd.js"></script>
132
+ <script src="../../build/tvweb-sdk.tcb.bss.standalone.min.js"></script>
133
+ <script>
134
+ const keys = [
135
+ {
136
+ accessKey: "f051dfd3-8a6e-4a15-a4e8-7ea8cdc84a31",
137
+ secretKey: "vgiKCenoKvhPq79KABbFmxCBu6WX1tdw",
138
+ },
139
+ {
140
+ accessKey: "b96f7a1a-a7f1-46e8-9d7f-5f43d2d51217",
141
+ secretKey: "SYsUyQ792pLm7rnDRQFfIL6cgAecZCOp",
142
+ },
143
+ {
144
+ accessKey: "db3d055f-ba7b-4177-b7e8-110068bda3b2",
145
+ secretKey: "R1zjKNbTH3RkT2xgO2CarxAsFbcLCdsf",
146
+ },
147
+ {
148
+ accessKey: "4e24c8f3-7fe0-4824-9339-9a1216a72ac4",
149
+ secretKey: "CkoyKslrfBGv4m53LIlH0Q8yJYf4O56e",
150
+ },
151
+ ];
152
+ function onSelectKey() {
153
+ const selectedKey = document.getElementById("select-api-key").value;
154
+ const { accessKey, secretKey } = keys[selectedKey];
155
+ inputAccessKey.value = accessKey;
156
+ inputSecretKey.value = secretKey;
157
+ }
158
+ function onSelectLang() {
159
+ const langEle = document.getElementById("select-lang");
160
+ localStorage.setItem('lang', langEle?.value);
161
+ location.reload();
162
+ }
163
+ </script>
164
+ <script type="text/javascript">
165
+ const lang = localStorage.getItem('lang');
166
+ if (lang) {
167
+ const langEle = document.getElementById("select-lang");
168
+ langEle.value = lang;
169
+ }
170
+ const tv = new TVWebSDK.SDK({
171
+ container: document.getElementById("container"),
172
+ lang: lang || "vi",
173
+ // assetRoot: "../../assets/tcb.bss",
174
+ assetRoot: "https://unpkg.com/@tsocial/tvweb-sdk.tcb.bss@latest/assets",
175
+ enableAntiDebug: false,
176
+ });
177
+ window.tv = tv;
178
+ const resultExtractIdInfoEl = document.getElementById(
179
+ "result-extract-id-info"
180
+ );
181
+ const resultLivenessDetectionEl = document.getElementById(
182
+ "result-liveness-detection"
183
+ );
184
+ const selectModeEl = document.getElementById("select-mode");
185
+ const selectApiCheckEl = document.getElementById("select-api-check");
186
+ const inputAccessKey = document.getElementById("access-key");
187
+ const inputSecretKey = document.getElementById("secret-key");
188
+ const inputApiUrl = document.getElementById("api-url");
189
+ const userIdEl = document.getElementById("user-id");
190
+ const trackingConfigEl = document.getElementById("tracking-config");
191
+ const readIdCardLoadingEl = document.getElementById("read-id-card-loading");
192
+ const statusWarmupReadIDCardEl = document.getElementById("status-warmup-read-id-card");
193
+ const livenessLoadingEl = document.getElementById("liveness-loading");
194
+ const startLivenessBtn = document.getElementById("btn-start-liveness");
195
+ const idCardSettingsEl = document.getElementById("id-card-settings");
196
+ const idCardStepsEl = document.getElementById("id-card-steps");
197
+ inputAccessKey.value = "f051dfd3-8a6e-4a15-a4e8-7ea8cdc84a31";
198
+ inputSecretKey.value = "vgiKCenoKvhPq79KABbFmxCBu6WX1tdw";
199
+ inputApiUrl.value = "https://tv-testing.trustingsocial.com/api";
200
+ userIdEl.value = JSON.parse(localStorage.getItem("user-id"));
201
+
202
+ const trackingConfigTemplates = [
203
+ TVWebSDK.TrackingContext.defaultTrackingConfig,
204
+ {
205
+ "enable": true,
206
+ "accessKey": "4df5f9b9-f34d-4ffa-829f-aa4889bc9fe5",
207
+ "secretKey": "dQDfxkVYXfAxpdReqdOd1zJP4pJ088Y7",
208
+ "apiUrl": "https://tv-testing.trustingsocial.com/api",
209
+ "userId": ""
210
+ },
211
+ ];
212
+ function onSelectTrackingConfigTemplate() {
213
+ const selected = document.getElementById("select-tracking-config-template").value;
214
+ trackingConfigEl.value = JSON.stringify(trackingConfigTemplates[selected], null, 2);
215
+ }
216
+
217
+ Object.keys(TVWebSDK.Constants.Mode).forEach((k) => {
218
+ const option = document.createElement("option");
219
+ option.appendChild(document.createTextNode(k));
220
+ option.setAttribute("value", TVWebSDK.Constants.Mode[k]);
221
+ selectModeEl.appendChild(option);
222
+ });
223
+
224
+ idCardSettingsEl.value = JSON.stringify(TVWebSDK.defaultClientSettings, null, 2);
225
+ idCardStepsEl.value = JSON.stringify(TVWebSDK.defaultReadIDCardSteps, null, 2);
226
+ trackingConfigEl.value = JSON.stringify(TVWebSDK.TrackingContext.defaultTrackingConfig, null, 2);
227
+
228
+ function clearUserId() {
229
+ window.localStorage.removeItem('user-id');
230
+ userIdEl.value = JSON.parse(localStorage.getItem("user-id"));
231
+ }
232
+
233
+ function runWarmUpReadIDCard() {
234
+ statusWarmupReadIDCardEl.innerHTML = "..."
235
+ tv.runWarmUpReadIDCard().then(function() {
236
+ statusWarmupReadIDCardEl.innerHTML = "...done"
237
+ })
238
+ }
239
+
240
+ function runPreloadEKYCResources() {
241
+ tv.runPreloadEKYCResources();
242
+ }
243
+
244
+ function handleStepDoneIDCard ({ stepNumber, image, qrScannedResult, recordedVideos, apiResult }) {
245
+ const steps = JSON.parse(idCardStepsEl.value)
246
+ console.log('image', image)
247
+
248
+ resultExtractIdInfoEl.appendChild(document.createTextNode(`\n-----------------------------------------\n`))
249
+ resultExtractIdInfoEl.appendChild(document.createTextNode(`\nSTEP NUMBER ${stepNumber}:\n`));
250
+
251
+
252
+ const imgEl = document.createElement("img");
253
+ imgEl.width = "300";
254
+ imgEl.src = URL.createObjectURL(image.blob);
255
+ resultExtractIdInfoEl.appendChild(imgEl);
256
+ resultExtractIdInfoEl.appendChild(document.createElement("br"));
257
+ resultExtractIdInfoEl.appendChild(document.createTextNode(`Recorded videos: ${recordedVideos.length}\n`));
258
+
259
+ if (qrScannedResult) {
260
+ const { result, image } = qrScannedResult
261
+
262
+ const qrImgEl = document.createElement("img");
263
+ qrImgEl.width = "200";
264
+ qrImgEl.src = URL.createObjectURL(image.blob);
265
+ resultExtractIdInfoEl.appendChild(qrImgEl);
266
+ resultExtractIdInfoEl.appendChild(document.createTextNode(`\n${result}\n`));
267
+ }
268
+
269
+ if (apiResult) {
270
+ resultExtractIdInfoEl.appendChild(document.createTextNode("API Result:\n"));
271
+ const apiResultEl = document.createElement('textarea');
272
+ apiResultEl.value = JSON.stringify(apiResult, null, 2);
273
+ apiResultEl.cols = 55
274
+ apiResultEl.rows = 15
275
+ resultExtractIdInfoEl.appendChild(apiResultEl);
276
+ }
277
+
278
+ // all steps done
279
+ if (stepNumber === steps.length - 1) {
280
+ tv.destroyView();
281
+ readIdCardLoadingEl.style.display = 'none';
282
+ }
283
+ }
284
+
285
+ async function handleDetectIdCard (props) {
286
+ const { cardType, image, cardSide } = props
287
+ const apiClient = new trustvisionSdk.default(inputAccessKey.value, inputSecretKey.value, inputApiUrl.value);
288
+ const resultUpload = await apiClient.uploadImage({
289
+ file: image.blob,
290
+ label: `id_card.${cardType}.${cardSide}`,
291
+ });
292
+ const imageId = resultUpload.data.image_id
293
+ const resultDetect = await apiClient.httpClient.post('/v1/detect_id_cards_sync', {
294
+ card_type: cardType,
295
+ image: {
296
+ id: imageId,
297
+ }
298
+ });
299
+ return _.get(resultDetect, 'data.image.cards.0')
300
+ }
301
+
302
+ function startExtractIDInfo() {
303
+ const apiCheck = selectApiCheckEl.value === "true";
304
+ resultExtractIdInfoEl.innerHTML = "";
305
+ document.body.style.height = 0;
306
+
307
+ const commonProps = {
308
+ onError: (e) => {
309
+ resultExtractIdInfoEl.appendChild(
310
+ document.createTextNode(`Error:\n${JSON.stringify(e, null, 2)}`)
311
+ );
312
+ tv.destroyView();
313
+ document.body.style.height = 'auto';
314
+ readIdCardLoadingEl.style.display = 'none';
315
+ },
316
+ onClose: () => {
317
+ document.body.style.height = 'auto';
318
+ tv.destroyView();
319
+ },
320
+ clientSettings: JSON.parse(idCardSettingsEl.value),
321
+ detectIdCard: handleDetectIdCard,
322
+ onStepDone: handleStepDoneIDCard,
323
+ steps: JSON.parse(idCardStepsEl.value),
324
+ tracking: JSON.parse(trackingConfigEl.value),
325
+ outputEncryptionSettings: { key: 'abc123' },
326
+ }
327
+
328
+ if (apiCheck) {
329
+ console.log('With api call')
330
+ tv.readIDCardWithApiCall({
331
+ apiCredentials: {
332
+ accessKey: inputAccessKey.value,
333
+ secretKey: inputSecretKey.value,
334
+ apiUrl: inputApiUrl.value,
335
+ },
336
+ ...commonProps,
337
+ })
338
+ } else {
339
+ console.log('UI only')
340
+ tv.readIDCardUIOnly(commonProps)
341
+ }
342
+ }
343
+
344
+ function startLivenessDetection() {
345
+ const livenessDetectionMode = selectModeEl.value;
346
+ const apiCheck = selectApiCheckEl.value === "true";
347
+ const cameraSelected = document.getElementById("select-camera");
348
+ document.body.style.height = 0;
349
+
350
+ tv.livenessDetection({
351
+ apiCheck: apiCheck,
352
+ mode: livenessDetectionMode,
353
+ apiCredentials: {
354
+ accessKey: inputAccessKey.value,
355
+ secretKey: inputSecretKey.value,
356
+ apiUrl: inputApiUrl.value,
357
+ },
358
+ onLivenessDetectionDone: handleLivenessDetectionDone,
359
+ captureFrameSettings: {
360
+ enable: true,
361
+ framesIntervalTime: 180,
362
+ framesBatchLength: 15,
363
+ },
364
+ outputEncryptionSettings: { key: 'abc123' },
365
+ onError: (e) => {
366
+ livenessLoadingEl.style.display = "none";
367
+ startLivenessBtn.disabled = false;
368
+ resultLivenessDetectionEl.appendChild(
369
+ document.createTextNode(`${JSON.stringify(e, null, 2)}`)
370
+ );
371
+ },
372
+ frontCamera: cameraSelected.value === "true",
373
+ onProcessing: () => {
374
+ livenessLoadingEl.style.display = "block";
375
+ startLivenessBtn.disabled = true;
376
+
377
+ resultLivenessDetectionEl.innerHTML = "";
378
+ document.body.style.height = 'auto';
379
+ setTimeout(() => {
380
+ tv.destroyView();
381
+ }, 250);
382
+ },
383
+ onClose: () => { document.body.style.height = 'auto'; tv.destroyView(); },
384
+ });
385
+ }
386
+
387
+ function handleReadIDCardResult({ image, recordedVideos, apiResult }) {
388
+ const apiCheck = selectApiCheckEl.value === "true";
389
+
390
+ const imgEl = document.createElement("img");
391
+ imgEl.width = "200";
392
+ imgEl.src = URL.createObjectURL(image);
393
+ resultExtractIdInfoEl.appendChild(imgEl);
394
+ resultExtractIdInfoEl.appendChild(document.createElement("br"));
395
+ resultExtractIdInfoEl.appendChild(document.createTextNode(`Recorded videos: ${recordedVideos.length}\n`));
396
+
397
+ if (apiCheck) {
398
+ resultExtractIdInfoEl.appendChild(document.createTextNode("API Result:\n"));
399
+ resultExtractIdInfoEl.appendChild(
400
+ document.createTextNode(`${JSON.stringify(apiResult, null, 2)}`)
401
+ );
402
+ if (cardSide === TVWebSDK.Constants.IDCardSide.FRONT) {
403
+ const frontCardId = apiResult.cardInfo.image1.id;
404
+ inputFrontIdEl.value = frontCardId;
405
+ }
406
+ }
407
+
408
+ tv.destroyView();
409
+ readIdCardLoadingEl.style.display = 'none';
410
+ }
411
+
412
+ function handleLivenessDetectionDone(result) {
413
+ const { frontalFaces, apiCheckPassed, steps } = result;
414
+ const apiCheck = selectApiCheckEl.value === "true";
415
+ resultLivenessDetectionEl.innerHTML = "";
416
+
417
+ if (apiCheck === false) {
418
+ livenessLoadingEl.style.display = "none";
419
+ startLivenessBtn.disabled = false;
420
+ resultLivenessDetectionEl.appendChild(
421
+ document.createTextNode("Random frontal faces detected: ")
422
+ );
423
+ frontalFaces.forEach((blob) => {
424
+ const imgEl = document.createElement("img");
425
+ imgEl.width = "200";
426
+ imgEl.style.marginRight = "5px";
427
+ imgEl.src = URL.createObjectURL(blob);
428
+ resultLivenessDetectionEl.appendChild(imgEl);
429
+ });
430
+ resultLivenessDetectionEl.appendChild(document.createElement("br"));
431
+ resultLivenessDetectionEl.appendChild(document.createElement("br"));
432
+ resultLivenessDetectionEl.appendChild(
433
+ document.createTextNode("Directional faces:")
434
+ );
435
+ steps.forEach((s) => {
436
+ const imgEl = document.createElement("img");
437
+ imgEl.width = "200";
438
+ imgEl.style.marginRight = "5px";
439
+ imgEl.src = URL.createObjectURL(s.image.blob);
440
+ resultLivenessDetectionEl.appendChild(imgEl);
441
+ });
442
+ resultLivenessDetectionEl.appendChild(document.createElement("br"));
443
+ resultLivenessDetectionEl.appendChild(document.createElement("br"));
444
+ resultLivenessDetectionEl.appendChild(
445
+ document.createTextNode("Video:")
446
+ );
447
+ } else {
448
+ livenessLoadingEl.style.display = "none";
449
+ startLivenessBtn.disabled = false;
450
+ resultLivenessDetectionEl.appendChild(
451
+ document.createTextNode(`apiCheckPassed: ${apiCheckPassed}`)
452
+ );
453
+ }
454
+ }
455
+ </script>
456
+ </body>
457
+ </html>
@@ -0,0 +1,57 @@
1
+ html {
2
+ font-family: 'Inter', sans-serif;
3
+ }
4
+
5
+ .dot-windmill {
6
+ position: relative;
7
+ top: -10px;
8
+ width: 10px;
9
+ height: 10px;
10
+ border-radius: 5px;
11
+ background-color: #9880ff;
12
+ color: #9880ff;
13
+ transform-origin: 5px 15px;
14
+ animation: dotWindmill 2s infinite linear;
15
+ margin-left: 100px;
16
+ margin-top: -10px;
17
+ }
18
+
19
+ .dot-windmill::before,
20
+ .dot-windmill::after {
21
+ content: "";
22
+ display: inline-block;
23
+ position: absolute;
24
+ }
25
+
26
+ .dot-windmill::before {
27
+ left: -8.66px;
28
+ top: 15px;
29
+ width: 10px;
30
+ height: 10px;
31
+ border-radius: 5px;
32
+ background-color: #9880ff;
33
+ color: #9880ff;
34
+ }
35
+
36
+ .dot-windmill::after {
37
+ left: 8.66px;
38
+ top: 15px;
39
+ width: 10px;
40
+ height: 10px;
41
+ border-radius: 5px;
42
+ background-color: #9880ff;
43
+ color: #9880ff;
44
+ }
45
+
46
+ @keyframes dotWindmill {
47
+ 0% {
48
+ transform: rotateZ(0deg) translate3d(0, 0, 0);
49
+ }
50
+ 100% {
51
+ transform: rotateZ(720deg) translate3d(0, 0, 0);
52
+ }
53
+ }
54
+
55
+ #result-biz-ocr {
56
+ white-space: pre;
57
+ }
@@ -0,0 +1,21 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8"/>
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
6
+ <meta name="description" content="Vanilla JS demo"/>
7
+ <title>TrustVision SDK Examples</title>
8
+ </head>
9
+ <body>
10
+ <noscript>You need to enable JavaScript to run this app.</noscript>
11
+ <h2>TrustVision SDK Examples</h2>
12
+ <ul>
13
+ <li>
14
+ <a href="extract-id-info-and-liveness-detection/index.html">Extract ID info & Liveness detection</a>
15
+ </li>
16
+ <li>
17
+ <a href="native-camera/index.html">Native camera</a>
18
+ </li>
19
+ </ul>
20
+ </body>
21
+ </html>
@@ -0,0 +1,44 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8"/>
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
6
+ <meta name="description" content="Vanilla JS demo"/>
7
+ </head>
8
+ <body>
9
+ <noscript>You need to enable JavaScript to run this app.</noscript>
10
+ <h2>Native Camera</h2>
11
+ <button id="btn-open-camera">Open camera</button>
12
+ <div id="container"></div>
13
+ <img id="img-result" width="300"/>
14
+ <script src="../../build/tvweb-sdk.tcb.bss.standalone.min.js"></script>
15
+ <script type="text/javascript">
16
+ const tv = new TVWebSDK.SDK({
17
+ container: document.getElementById('container'),
18
+ lang: 'vi',
19
+ assetRoot: 'https://unpkg.com/@tsocial/tvweb-sdk@latest/assets',
20
+ })
21
+ const buttonOpenCamera = document.getElementById('btn-open-camera')
22
+ const imgResultEl = document.getElementById('img-result')
23
+
24
+ function handleCaptureDone ({ file, encrypted }) {
25
+ imgResultEl.src = URL.createObjectURL(file)
26
+ imgResultEl.onload = function () {
27
+ URL.revokeObjectURL(this.src)
28
+ }
29
+ if (encrypted) {
30
+ alert(JSON.stringify(encrypted))
31
+ }
32
+ }
33
+
34
+ const { openCamera } = tv.initNativeCamera({
35
+ frontCamera: false,
36
+ onCaptureDone: handleCaptureDone,
37
+ useFileBrowse: true,
38
+ outputEncryptionSettings: { key: 'abc123' }
39
+ })
40
+
41
+ buttonOpenCamera.onclick = openCamera
42
+ </script>
43
+ </body>
44
+ </html>
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@tsocial/tvweb-sdk.tcb.bss",
3
+ "version": "5.8.0",
4
+ "description": "TV Web SDK - The Standalone SDK",
5
+ "keywords": [],
6
+ "license": "ISC",
7
+ "main": "build/tvweb-sdk.tcb.bss.cjs.min.js",
8
+ "module": "build/tvweb-sdk.tcb.bss.esm.min.js",
9
+ "src": "src/index.js",
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "files": [
14
+ "build/tvweb-sdk.tcb.bss.standalone.min.js",
15
+ "examples",
16
+ "assets"
17
+ ],
18
+ "scripts": {
19
+ "build": "yarn run tvweb-builder --type standalone --libName TVWebSDK",
20
+ "pack": "tvweb-builder --type standalone --libName TVWebSDK --defaultAssetRoot ./assets",
21
+ "run-example": "tvweb-builder --type standalone --libName TVWebSDK && http-server ./ -c-1",
22
+ "test": "echo \"Error: run tests from root\" && exit 1"
23
+ },
24
+ "dependencies": {
25
+ "@tsocial/trustvision-sdk": "2.10.1",
26
+ "@tsocial/tvweb-core": "^5.8.0",
27
+ "@tsocial/tvweb-ui": "^5.8.0",
28
+ "invariant": "^2.2.4",
29
+ "react": "^16.14.0",
30
+ "react-app-polyfill": "^2.0.0",
31
+ "react-dom": "^16.14.0",
32
+ "styled-components": "^5.2.1"
33
+ },
34
+ "devDependencies": {
35
+ "@tsocial/tvweb-builder": "^5.8.0"
36
+ },
37
+ "gitHead": "83e74af82fa84f0501a3f8469b32b893086b61c7"
38
+ }