@tsocial/tvweb-sdk 5.4.0 → 5.4.2-alpha.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.
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<h2>Native Camera</h2>
|
|
11
11
|
<button id="btn-open-camera">Open camera</button>
|
|
12
12
|
<div id="container"></div>
|
|
13
|
-
<img id="img-result" width="300"
|
|
13
|
+
<img id="img-result" width="300"/>
|
|
14
14
|
<script src="../../build/tvweb-sdk.standalone.min.js"></script>
|
|
15
15
|
<script type="text/javascript">
|
|
16
16
|
const tv = new TVWebSDK.SDK({
|
|
@@ -21,14 +21,22 @@
|
|
|
21
21
|
const buttonOpenCamera = document.getElementById('btn-open-camera')
|
|
22
22
|
const imgResultEl = document.getElementById('img-result')
|
|
23
23
|
|
|
24
|
-
function handleCaptureDone ({ file }) {
|
|
24
|
+
function handleCaptureDone ({ file, encrypted }) {
|
|
25
25
|
imgResultEl.src = URL.createObjectURL(file)
|
|
26
26
|
imgResultEl.onload = function () {
|
|
27
27
|
URL.revokeObjectURL(this.src)
|
|
28
28
|
}
|
|
29
|
+
if (encrypted) {
|
|
30
|
+
alert(JSON.stringify(encrypted))
|
|
31
|
+
}
|
|
29
32
|
}
|
|
30
33
|
|
|
31
|
-
const { openCamera } = tv.initNativeCamera({
|
|
34
|
+
const { openCamera } = tv.initNativeCamera({
|
|
35
|
+
frontCamera: false,
|
|
36
|
+
onCaptureDone: handleCaptureDone,
|
|
37
|
+
useFileBrowse: true,
|
|
38
|
+
outputEncryptionSettings: { key: '123' }
|
|
39
|
+
})
|
|
32
40
|
|
|
33
41
|
buttonOpenCamera.onclick = openCamera
|
|
34
42
|
</script>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsocial/tvweb-sdk",
|
|
3
|
-
"version": "5.4.0",
|
|
3
|
+
"version": "5.4.2-alpha.0",
|
|
4
4
|
"description": "TV Web SDK - The Standalone SDK",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "Nha Hoang <nha.hoang@trustingsocial.com>",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@tsocial/tvweb-builder": "^5.4.0"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "8de5736043aeb63960d60e1d3b1f47eca0ae2876"
|
|
40
40
|
}
|