react-native-timacare 3.3.28 → 3.3.29
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/lib/commonjs/screens/camera/CCCDCameraScreen.js +1 -1
- package/lib/commonjs/screens/camera/CCCDCameraScreen.js.flow +29 -26
- package/lib/commonjs/screens/camera/CCCDCameraScreen.js.map +1 -1
- package/lib/commonjs/screens/camera/index.js +1 -1
- package/lib/commonjs/screens/camera/index.js.flow +34 -48
- package/lib/commonjs/screens/camera/index.js.map +1 -1
- package/lib/commonjs/screens/home/DigitalTopupItem.js +1 -1
- package/lib/commonjs/screens/home/DigitalTopupItem.js.flow +31 -33
- package/lib/commonjs/screens/home/DigitalTopupItem.js.map +1 -1
- package/lib/commonjs/screens/liveness/index.js +1 -1
- package/lib/commonjs/screens/liveness/index.js.flow +43 -54
- package/lib/commonjs/screens/liveness/index.js.map +1 -1
- package/lib/commonjs/screens/liveness-v2/index.js +1 -1
- package/lib/commonjs/screens/liveness-v2/index.js.flow +60 -56
- package/lib/commonjs/screens/liveness-v2/index.js.map +1 -1
- package/lib/commonjs/screens/mrz-scanner/index.js +1 -1
- package/lib/commonjs/screens/mrz-scanner/index.js.flow +25 -10
- package/lib/commonjs/screens/mrz-scanner/index.js.map +1 -1
- package/lib/commonjs/screens/toan-trinh-so/OCR.js +1 -1
- package/lib/commonjs/screens/toan-trinh-so/OCR.js.flow +48 -49
- package/lib/commonjs/screens/toan-trinh-so/OCR.js.map +1 -1
- package/lib/commonjs/screens/toan-trinh-so/RegisterCamera.js +1 -1
- package/lib/commonjs/screens/toan-trinh-so/RegisterCamera.js.flow +32 -33
- package/lib/commonjs/screens/toan-trinh-so/RegisterCamera.js.map +1 -1
- package/lib/commonjs/screens/toan-trinh-so/TTSSelfie.js +1 -1
- package/lib/commonjs/screens/toan-trinh-so/TTSSelfie.js.flow +26 -37
- package/lib/commonjs/screens/toan-trinh-so/TTSSelfie.js.map +1 -1
- package/lib/commonjs/screens/toan-trinh-so/VehicleCamera.js +1 -1
- package/lib/commonjs/screens/toan-trinh-so/VehicleCamera.js.flow +77 -78
- package/lib/commonjs/screens/toan-trinh-so/VehicleCamera.js.map +1 -1
- package/lib/commonjs/screens/uploadVideo/index.js +1 -1
- package/lib/commonjs/screens/uploadVideo/index.js.flow +32 -33
- package/lib/commonjs/screens/uploadVideo/index.js.map +1 -1
- package/lib/module/screens/camera/CCCDCameraScreen.js +1 -1
- package/lib/module/screens/camera/CCCDCameraScreen.js.map +1 -1
- package/lib/module/screens/camera/index.js +1 -1
- package/lib/module/screens/camera/index.js.map +1 -1
- package/lib/module/screens/home/DigitalTopupItem.js +1 -1
- package/lib/module/screens/home/DigitalTopupItem.js.map +1 -1
- package/lib/module/screens/liveness/index.js +1 -1
- package/lib/module/screens/liveness/index.js.map +1 -1
- package/lib/module/screens/liveness-v2/index.js +1 -1
- package/lib/module/screens/liveness-v2/index.js.map +1 -1
- package/lib/module/screens/mrz-scanner/index.js +1 -1
- package/lib/module/screens/mrz-scanner/index.js.map +1 -1
- package/lib/module/screens/toan-trinh-so/OCR.js +1 -1
- package/lib/module/screens/toan-trinh-so/OCR.js.map +1 -1
- package/lib/module/screens/toan-trinh-so/RegisterCamera.js +1 -1
- package/lib/module/screens/toan-trinh-so/RegisterCamera.js.map +1 -1
- package/lib/module/screens/toan-trinh-so/TTSSelfie.js +1 -1
- package/lib/module/screens/toan-trinh-so/TTSSelfie.js.map +1 -1
- package/lib/module/screens/toan-trinh-so/VehicleCamera.js +1 -1
- package/lib/module/screens/toan-trinh-so/VehicleCamera.js.map +1 -1
- package/lib/module/screens/uploadVideo/index.js +1 -1
- package/lib/module/screens/uploadVideo/index.js.map +1 -1
- package/lib/typescript/screens/camera/CCCDCameraScreen.d.ts.map +1 -1
- package/lib/typescript/screens/camera/index.d.ts.map +1 -1
- package/lib/typescript/screens/home/DigitalTopupItem.d.ts.map +1 -1
- package/lib/typescript/screens/liveness/index.d.ts.map +1 -1
- package/lib/typescript/screens/liveness-v2/index.d.ts.map +1 -1
- package/lib/typescript/screens/mrz-scanner/index.d.ts.map +1 -1
- package/lib/typescript/screens/toan-trinh-so/OCR.d.ts.map +1 -1
- package/lib/typescript/screens/toan-trinh-so/RegisterCamera.d.ts.map +1 -1
- package/lib/typescript/screens/toan-trinh-so/TTSSelfie.d.ts.map +1 -1
- package/lib/typescript/screens/toan-trinh-so/VehicleCamera.d.ts.map +1 -1
- package/lib/typescript/screens/uploadVideo/index.d.ts.map +1 -1
- package/package.json +1 -2
- package/src/screens/camera/CCCDCameraScreen.tsx +29 -26
- package/src/screens/camera/index.tsx +34 -48
- package/src/screens/home/DigitalTopupItem.tsx +31 -33
- package/src/screens/liveness/index.tsx +43 -54
- package/src/screens/liveness-v2/index.tsx +60 -56
- package/src/screens/mrz-scanner/index.tsx +25 -10
- package/src/screens/toan-trinh-so/OCR.tsx +48 -49
- package/src/screens/toan-trinh-so/RegisterCamera.tsx +32 -33
- package/src/screens/toan-trinh-so/TTSSelfie.tsx +26 -37
- package/src/screens/toan-trinh-so/VehicleCamera.tsx +77 -78
- package/src/screens/uploadVideo/index.tsx +32 -33
|
@@ -10,7 +10,10 @@ import {
|
|
|
10
10
|
View,
|
|
11
11
|
} from 'react-native';
|
|
12
12
|
import { formatDDMMYYY, formatMoney } from '../../utils';
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
Camera as VisionCamera,
|
|
15
|
+
useCameraDevice,
|
|
16
|
+
} from 'react-native-vision-camera';
|
|
14
17
|
import MButton from '../../components/MButton';
|
|
15
18
|
import { IconPause, IconPlay } from '../../assets/icons';
|
|
16
19
|
import { MText } from '../../components/MText';
|
|
@@ -39,6 +42,8 @@ export const Video = observer(function Video(props: any) {
|
|
|
39
42
|
const [count, setCount] = useState(COUNTDOWN_SECONDS);
|
|
40
43
|
const [isRecording, setIsRecording] = useState(false);
|
|
41
44
|
const [isLoading, setIsLoading] = useState(false);
|
|
45
|
+
const [passPermission, setPassPermission] = useState(false);
|
|
46
|
+
const device = useCameraDevice('front');
|
|
42
47
|
|
|
43
48
|
const loan = props?.route?.params?.loan;
|
|
44
49
|
const content = useMemo(() => {
|
|
@@ -56,7 +61,10 @@ export const Video = observer(function Video(props: any) {
|
|
|
56
61
|
(permission) => statuses[permission] !== RESULTS.GRANTED
|
|
57
62
|
);
|
|
58
63
|
|
|
59
|
-
if (toRequest.length === 0)
|
|
64
|
+
if (toRequest.length === 0) {
|
|
65
|
+
setPassPermission(true);
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
60
68
|
|
|
61
69
|
const requested = await requestMultiple(toRequest);
|
|
62
70
|
const values = Object.values(requested);
|
|
@@ -64,6 +72,7 @@ export const Video = observer(function Video(props: any) {
|
|
|
64
72
|
const anyBlocked = values.some((status) => status === RESULTS.BLOCKED);
|
|
65
73
|
|
|
66
74
|
if (!allGranted) {
|
|
75
|
+
setPassPermission(false);
|
|
67
76
|
Alert.alert(
|
|
68
77
|
'Thông báo',
|
|
69
78
|
anyBlocked
|
|
@@ -81,6 +90,7 @@ export const Video = observer(function Video(props: any) {
|
|
|
81
90
|
);
|
|
82
91
|
}
|
|
83
92
|
|
|
93
|
+
setPassPermission(allGranted);
|
|
84
94
|
return allGranted;
|
|
85
95
|
};
|
|
86
96
|
|
|
@@ -114,19 +124,20 @@ export const Video = observer(function Video(props: any) {
|
|
|
114
124
|
|
|
115
125
|
setIsRecording(true);
|
|
116
126
|
try {
|
|
117
|
-
const data = await
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
127
|
+
const data = await new Promise((resolve, reject) => {
|
|
128
|
+
camera.current.startRecording({
|
|
129
|
+
videoCodec: Platform.OS === 'ios' ? 'h264' : undefined,
|
|
130
|
+
onRecordingFinished: resolve,
|
|
131
|
+
onRecordingError: reject,
|
|
132
|
+
});
|
|
123
133
|
});
|
|
124
134
|
|
|
125
135
|
setIsLoading(true);
|
|
136
|
+
const uri = 'file://' + data.path;
|
|
126
137
|
const formData = new FormData();
|
|
127
138
|
formData.append('video', {
|
|
128
|
-
name: data.
|
|
129
|
-
uri
|
|
139
|
+
name: data.path.split(/[\\/]/).pop(),
|
|
140
|
+
uri,
|
|
130
141
|
type: 'video/*',
|
|
131
142
|
});
|
|
132
143
|
|
|
@@ -188,27 +199,16 @@ export const Video = observer(function Video(props: any) {
|
|
|
188
199
|
</MText>
|
|
189
200
|
</View>
|
|
190
201
|
)}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
message: 'We need your permission to use your camera',
|
|
202
|
-
buttonPositive: 'Ok',
|
|
203
|
-
buttonNegative: 'Cancel',
|
|
204
|
-
}}
|
|
205
|
-
androidRecordAudioPermissionOptions={{
|
|
206
|
-
title: 'Permission to use audio recording',
|
|
207
|
-
message: 'We need your permission to use your audio',
|
|
208
|
-
buttonPositive: 'Ok',
|
|
209
|
-
buttonNegative: 'Cancel',
|
|
210
|
-
}}
|
|
211
|
-
/>
|
|
202
|
+
{passPermission && device ? (
|
|
203
|
+
<VisionCamera
|
|
204
|
+
ref={camera}
|
|
205
|
+
style={styles.preview}
|
|
206
|
+
device={device}
|
|
207
|
+
isActive={true}
|
|
208
|
+
video={true}
|
|
209
|
+
audio={true}
|
|
210
|
+
/>
|
|
211
|
+
) : null}
|
|
212
212
|
<View
|
|
213
213
|
style={{
|
|
214
214
|
backgroundColor: '#00000080',
|
|
@@ -217,6 +217,7 @@ export const Video = observer(function Video(props: any) {
|
|
|
217
217
|
bottom: 0,
|
|
218
218
|
left: 0,
|
|
219
219
|
right: 0,
|
|
220
|
+
paddingVertical: 16,
|
|
220
221
|
}}
|
|
221
222
|
>
|
|
222
223
|
{isRecording ? (
|
|
@@ -224,7 +225,6 @@ export const Video = observer(function Video(props: any) {
|
|
|
224
225
|
style={{
|
|
225
226
|
justifyContent: 'center',
|
|
226
227
|
alignItems: 'center',
|
|
227
|
-
marginBottom: 20,
|
|
228
228
|
}}
|
|
229
229
|
onPress={() => {
|
|
230
230
|
stopRecording();
|
|
@@ -237,7 +237,6 @@ export const Video = observer(function Video(props: any) {
|
|
|
237
237
|
style={{
|
|
238
238
|
justifyContent: 'center',
|
|
239
239
|
alignItems: 'center',
|
|
240
|
-
marginBottom: 20,
|
|
241
240
|
}}
|
|
242
241
|
disabled={videoStore.isLoading}
|
|
243
242
|
onPress={() => {
|