idmission-web-sdk 1.0.383 → 1.0.384
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/dist/components/video_id/IdVideoCapture.d.ts +2 -1
- package/dist/lib/camera/useVideoRecorder.d.ts +2 -0
- package/dist/sdk2.cjs.development.js +154 -55
- package/dist/sdk2.cjs.development.js.map +1 -1
- package/dist/sdk2.cjs.production.js +1 -1
- package/dist/sdk2.cjs.production.js.map +1 -1
- package/dist/sdk2.esm.js +154 -55
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +154 -55
- package/dist/sdk2.umd.development.js.map +1 -1
- package/dist/sdk2.umd.production.js +1 -1
- package/dist/sdk2.umd.production.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -36,6 +36,7 @@ export type IdVideoCaptureProps = {
|
|
|
36
36
|
onIdFrontImageCaptured?: (imageUrl: string) => void;
|
|
37
37
|
onIdBackImageCaptured?: (imageUrl: string) => void;
|
|
38
38
|
onFaceNotDetected?: () => void;
|
|
39
|
+
onRecordingFailed?: () => void;
|
|
39
40
|
idCaptureModelsEnabled?: boolean;
|
|
40
41
|
idCardFrontDelay?: number;
|
|
41
42
|
idCardFrontDetectionThreshold?: number;
|
|
@@ -57,4 +58,4 @@ export type IdVideoCaptureProps = {
|
|
|
57
58
|
verbiage?: IdVideoCaptureVerbiage;
|
|
58
59
|
debugMode?: boolean;
|
|
59
60
|
};
|
|
60
|
-
export declare const IdVideoCapture: ({ onComplete, onIdFrontImageCaptured, onIdBackImageCaptured, onFaceNotDetected, idCaptureModelsEnabled, idCardFrontDelay, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, goodIdCardFrontFramesThreshold, idCardBackDetectionThreshold, idCardBackFocusThreshold, goodIdCardBackFramesThreshold, skipShowIdCardBack, captureCountdownSeconds, readTextPrompt, readTextTimeoutDurationMs, readTextMinReadingMs, disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, assets, classNames, colors, verbiage: rawVerbiage, debugMode, }: IdVideoCaptureProps) => ReactElement;
|
|
61
|
+
export declare const IdVideoCapture: ({ onComplete, onIdFrontImageCaptured, onIdBackImageCaptured, onFaceNotDetected, onRecordingFailed, idCaptureModelsEnabled, idCardFrontDelay, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, goodIdCardFrontFramesThreshold, idCardBackDetectionThreshold, idCardBackFocusThreshold, goodIdCardBackFramesThreshold, skipShowIdCardBack, captureCountdownSeconds, readTextPrompt, readTextTimeoutDurationMs, readTextMinReadingMs, disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, assets, classNames, colors, verbiage: rawVerbiage, debugMode, }: IdVideoCaptureProps) => ReactElement;
|
|
@@ -6,6 +6,8 @@ export declare const useVideoRecorder: (camera: Camera | null, audioStream?: Med
|
|
|
6
6
|
startRecordingAudio: () => void;
|
|
7
7
|
stopRecordingVideo: () => void;
|
|
8
8
|
stopRecordingAudio: () => void;
|
|
9
|
+
videoRecordingUnintentionallyStopped: boolean;
|
|
10
|
+
audioRecordingUnintentionallyStopped: boolean;
|
|
9
11
|
videoUrl: string | null;
|
|
10
12
|
audioUrl: string | null;
|
|
11
13
|
};
|
|
@@ -51,7 +51,7 @@ var LanguageDetector__default = /*#__PURE__*/_interopDefaultLegacy(LanguageDetec
|
|
|
51
51
|
var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
|
|
52
52
|
var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
|
|
53
53
|
|
|
54
|
-
var webSdkVersion = '1.0.
|
|
54
|
+
var webSdkVersion = '1.0.384';
|
|
55
55
|
|
|
56
56
|
function getPlatform() {
|
|
57
57
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -2061,6 +2061,11 @@ function usePreferredCaptureDevice(_a) {
|
|
|
2061
2061
|
currentAudioStream = stream;
|
|
2062
2062
|
setAudioStream(stream);
|
|
2063
2063
|
setMicrophoneReady(true);
|
|
2064
|
+
stream.getAudioTracks().forEach(function (track) {
|
|
2065
|
+
track.onended = function () {
|
|
2066
|
+
setMicrophoneAccessDenied(true);
|
|
2067
|
+
};
|
|
2068
|
+
});
|
|
2064
2069
|
return [3 /*break*/, 4];
|
|
2065
2070
|
case 3:
|
|
2066
2071
|
_a.sent();
|
|
@@ -13574,17 +13579,19 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
13574
13579
|
var _15 = useIdCaptureState(),
|
|
13575
13580
|
state = _15[0],
|
|
13576
13581
|
dispatch = _15[1];
|
|
13577
|
-
var
|
|
13578
|
-
|
|
13579
|
-
|
|
13580
|
-
|
|
13581
|
-
|
|
13582
|
-
|
|
13583
|
-
|
|
13584
|
-
|
|
13585
|
-
|
|
13586
|
-
|
|
13587
|
-
|
|
13582
|
+
var _16 = React.useContext(CameraStateContext),
|
|
13583
|
+
cameraAccessDenied = _16.cameraAccessDenied,
|
|
13584
|
+
releaseCameraAccess = _16.releaseCameraAccess;
|
|
13585
|
+
var _17 = React.useState(false),
|
|
13586
|
+
overlayDismissed = _17[0],
|
|
13587
|
+
setOverlayDismissed = _17[1];
|
|
13588
|
+
var _18 = React.useContext(SubmissionContext),
|
|
13589
|
+
submissionStatus = _18.submissionStatus,
|
|
13590
|
+
setIdFrontImage = _18.setIdFrontImage,
|
|
13591
|
+
setIdBackImage = _18.setIdBackImage,
|
|
13592
|
+
setPassportImage = _18.setPassportImage,
|
|
13593
|
+
logIdFrontCaptureAttempt = _18.logIdFrontCaptureAttempt,
|
|
13594
|
+
logIdBackCaptureAttempt = _18.logIdBackCaptureAttempt;
|
|
13588
13595
|
var idModelError = React.useContext(IdCaptureModelsContext).idModelError;
|
|
13589
13596
|
var operationStartedAt = React.useRef();
|
|
13590
13597
|
React.useEffect(function () {
|
|
@@ -13649,9 +13656,9 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
13649
13656
|
type: 'resetWizard'
|
|
13650
13657
|
});
|
|
13651
13658
|
}, [dispatch]);
|
|
13652
|
-
var
|
|
13653
|
-
attempt =
|
|
13654
|
-
setAttempt =
|
|
13659
|
+
var _19 = React.useState(0),
|
|
13660
|
+
attempt = _19[0],
|
|
13661
|
+
setAttempt = _19[1];
|
|
13655
13662
|
var onExit = React.useCallback(function () {
|
|
13656
13663
|
setOverlayDismissed(false);
|
|
13657
13664
|
setAttempt(function (n) {
|
|
@@ -13667,6 +13674,14 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
13667
13674
|
releaseCameraAccessOnExit && releaseCameraAccess();
|
|
13668
13675
|
}
|
|
13669
13676
|
}, [releaseCameraAccess, releaseCameraAccessOnExit, submissionStatus]);
|
|
13677
|
+
React.useEffect(function () {
|
|
13678
|
+
if (cameraAccessDenied) {
|
|
13679
|
+
setOverlayDismissed(false);
|
|
13680
|
+
setAttempt(function (n) {
|
|
13681
|
+
return n + 1;
|
|
13682
|
+
});
|
|
13683
|
+
}
|
|
13684
|
+
}, [cameraAccessDenied]);
|
|
13670
13685
|
assets.idCardFront || (assets.idCardFront = {});
|
|
13671
13686
|
(_h = assets.idCardFront).portraitGuidesImageUrl || (_h.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Portrait-2.svg"));
|
|
13672
13687
|
(_j = assets.idCardFront).landscapeGuidesImageUrl || (_j.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));
|
|
@@ -13694,12 +13709,12 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
13694
13709
|
})
|
|
13695
13710
|
};
|
|
13696
13711
|
var theme = styled.useTheme();
|
|
13697
|
-
var
|
|
13698
|
-
guideRectX =
|
|
13699
|
-
guideRectY =
|
|
13700
|
-
guideRectWidth =
|
|
13701
|
-
guideRectHeight =
|
|
13702
|
-
imageUrl =
|
|
13712
|
+
var _20 = useIdCaptureState()[0],
|
|
13713
|
+
guideRectX = _20.guideRectX,
|
|
13714
|
+
guideRectY = _20.guideRectY,
|
|
13715
|
+
guideRectWidth = _20.guideRectWidth,
|
|
13716
|
+
guideRectHeight = _20.guideRectHeight,
|
|
13717
|
+
imageUrl = _20.imageUrl;
|
|
13703
13718
|
var idCaptureAssets = assets[state.requestedDocumentType];
|
|
13704
13719
|
var idCaptureVerbiage = idCaptureVerbiages[state.requestedDocumentType];
|
|
13705
13720
|
React.useEffect(function () {
|
|
@@ -15294,16 +15309,18 @@ var FaceLivenessWizard = function FaceLivenessWizard(_a) {
|
|
|
15294
15309
|
livenessCheckRequest = _s.livenessCheckRequest,
|
|
15295
15310
|
setSelfieImage = _s.setSelfieImage,
|
|
15296
15311
|
logSelfieCaptureAttempt = _s.logSelfieCaptureAttempt;
|
|
15297
|
-
var
|
|
15298
|
-
|
|
15299
|
-
|
|
15300
|
-
|
|
15301
|
-
|
|
15302
|
-
|
|
15303
|
-
|
|
15304
|
-
|
|
15305
|
-
|
|
15306
|
-
|
|
15312
|
+
var _t = React.useContext(CameraStateContext),
|
|
15313
|
+
cameraAccessDenied = _t.cameraAccessDenied,
|
|
15314
|
+
releaseCameraAccess = _t.releaseCameraAccess;
|
|
15315
|
+
var _u = React.useState(''),
|
|
15316
|
+
faceCropImageUrl = _u[0],
|
|
15317
|
+
setFaceCropImageUrl = _u[1];
|
|
15318
|
+
var _v = React.useState(0),
|
|
15319
|
+
retryCount = _v[0],
|
|
15320
|
+
setRetryCount = _v[1];
|
|
15321
|
+
var _w = React.useState('LOADING'),
|
|
15322
|
+
captureState = _w[0],
|
|
15323
|
+
setCaptureState = _w[1];
|
|
15307
15324
|
var captureStartedAt = React.useRef();
|
|
15308
15325
|
var captureEndedAt = React.useRef();
|
|
15309
15326
|
var operationStartedAt = React.useRef();
|
|
@@ -15351,9 +15368,9 @@ var FaceLivenessWizard = function FaceLivenessWizard(_a) {
|
|
|
15351
15368
|
setCaptureState('FAILED');
|
|
15352
15369
|
onTimeout === null || onTimeout === void 0 ? void 0 : onTimeout(submissionResponse, livenessCheckRequest);
|
|
15353
15370
|
}, [onTimeout, livenessCheckRequest, submissionResponse]);
|
|
15354
|
-
var
|
|
15355
|
-
attempt =
|
|
15356
|
-
setAttempt =
|
|
15371
|
+
var _x = React.useState(0),
|
|
15372
|
+
attempt = _x[0],
|
|
15373
|
+
setAttempt = _x[1];
|
|
15357
15374
|
var onExitCallback = React.useCallback(function () {
|
|
15358
15375
|
setAttempt(function (n) {
|
|
15359
15376
|
return n + 1;
|
|
@@ -15369,6 +15386,14 @@ var FaceLivenessWizard = function FaceLivenessWizard(_a) {
|
|
|
15369
15386
|
}, 0);
|
|
15370
15387
|
}, [logCaptureMetadata, onComplete, releaseCameraAccess, releaseCameraAccessOnExit, livenessCheckRequest, submissionResponse]);
|
|
15371
15388
|
var showSuccessScreen = useShowSuccessScreen(skipSuccessScreen, captureState === 'SUCCESS', onDoneCallback);
|
|
15389
|
+
React.useEffect(function () {
|
|
15390
|
+
if (cameraAccessDenied) {
|
|
15391
|
+
setAttempt(function (n) {
|
|
15392
|
+
return n + 1;
|
|
15393
|
+
});
|
|
15394
|
+
setCaptureState('LOADING');
|
|
15395
|
+
}
|
|
15396
|
+
}, [cameraAccessDenied]);
|
|
15372
15397
|
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(PageContainer, {
|
|
15373
15398
|
className: "flex ".concat((_c = (_b = classNames.capture) === null || _b === void 0 ? void 0 : _b.container) !== null && _c !== void 0 ? _c : '')
|
|
15374
15399
|
}, renderCameraFeed && ( /*#__PURE__*/React__default['default'].createElement(CameraVideoTag, {
|
|
@@ -15780,6 +15805,18 @@ var useVideoRecorder = function useVideoRecorder(camera, audioStream) {
|
|
|
15780
15805
|
var _d = React.useState(false),
|
|
15781
15806
|
isRecordingAudio = _d[0],
|
|
15782
15807
|
setIsRecordingAudio = _d[1];
|
|
15808
|
+
var _e = React.useState(false),
|
|
15809
|
+
videoRecordingStopped = _e[0],
|
|
15810
|
+
setVideoRecordingStopped = _e[1];
|
|
15811
|
+
var _f = React.useState(false),
|
|
15812
|
+
audioRecordingStopped = _f[0],
|
|
15813
|
+
setAudioRecordingStopped = _f[1];
|
|
15814
|
+
var _g = React.useState(false),
|
|
15815
|
+
videoRecordingIntentionallyStopped = _g[0],
|
|
15816
|
+
setVideoRecordingIntentionallyStopped = _g[1];
|
|
15817
|
+
var _h = React.useState(false),
|
|
15818
|
+
audioRecordingIntentionallyStopped = _h[0],
|
|
15819
|
+
setAudioRecordingIntentionallyStopped = _h[1];
|
|
15783
15820
|
var videoStream = camera === null || camera === void 0 ? void 0 : camera.stream;
|
|
15784
15821
|
var processVideo = React.useCallback(function () {
|
|
15785
15822
|
var videoBlob = new Blob(videoChunks.current, {
|
|
@@ -15804,13 +15841,17 @@ var useVideoRecorder = function useVideoRecorder(camera, audioStream) {
|
|
|
15804
15841
|
if (!videoStream) return;
|
|
15805
15842
|
videoChunks.current = [];
|
|
15806
15843
|
setIsRecordingVideo(true);
|
|
15844
|
+
setVideoRecordingStopped(false);
|
|
15845
|
+
setVideoRecordingIntentionallyStopped(false);
|
|
15807
15846
|
videoRecorder.current = new MediaRecorder(videoStream, {
|
|
15808
15847
|
videoBitsPerSecond: 270000
|
|
15809
15848
|
});
|
|
15810
15849
|
videoRecorder.current.ondataavailable = function (e) {
|
|
15811
15850
|
videoChunks.current.push(e.data);
|
|
15812
15851
|
};
|
|
15813
|
-
videoRecorder.current.onstop =
|
|
15852
|
+
videoRecorder.current.onstop = function () {
|
|
15853
|
+
setVideoRecordingStopped(true);
|
|
15854
|
+
};
|
|
15814
15855
|
videoRecorder.current.start(1000);
|
|
15815
15856
|
setTimeout(function () {
|
|
15816
15857
|
var _a;
|
|
@@ -15819,36 +15860,48 @@ var useVideoRecorder = function useVideoRecorder(camera, audioStream) {
|
|
|
15819
15860
|
// TODO: figure out what to do here
|
|
15820
15861
|
}
|
|
15821
15862
|
}, 100);
|
|
15822
|
-
}, [
|
|
15863
|
+
}, [videoStream]);
|
|
15823
15864
|
var startRecordingAudio = React.useCallback(function () {
|
|
15824
15865
|
if (!audioStream) return;
|
|
15825
15866
|
audioChunks.current = [];
|
|
15826
15867
|
setIsRecordingAudio(true);
|
|
15868
|
+
setAudioRecordingStopped(false);
|
|
15869
|
+
setAudioRecordingIntentionallyStopped(false);
|
|
15827
15870
|
audioRecorder.current = new MediaRecorder(audioStream, {
|
|
15828
15871
|
audioBitsPerSecond: 32000
|
|
15829
15872
|
});
|
|
15830
15873
|
audioRecorder.current.ondataavailable = function (e) {
|
|
15831
15874
|
audioChunks.current.push(e.data);
|
|
15832
15875
|
};
|
|
15833
|
-
audioRecorder.current.onstop =
|
|
15876
|
+
audioRecorder.current.onstop = function () {
|
|
15877
|
+
setAudioRecordingStopped(true);
|
|
15878
|
+
};
|
|
15834
15879
|
audioRecorder.current.start(1000);
|
|
15835
|
-
}, [audioStream
|
|
15880
|
+
}, [audioStream]);
|
|
15836
15881
|
var stopRecordingVideo = React.useCallback(function () {
|
|
15837
15882
|
var _a, _b;
|
|
15883
|
+
setVideoRecordingIntentionallyStopped(true);
|
|
15838
15884
|
if (((_a = videoRecorder.current) === null || _a === void 0 ? void 0 : _a.state) !== 'inactive') {
|
|
15839
15885
|
(_b = videoRecorder.current) === null || _b === void 0 ? void 0 : _b.stop(); // if you call this while state === 'inactive', an exception is thrown.
|
|
15840
|
-
} else {
|
|
15841
|
-
processVideo(); // if we are in 'inactive' state, we just invoke our processing code manually.
|
|
15842
15886
|
}
|
|
15843
|
-
}, [
|
|
15887
|
+
}, []);
|
|
15844
15888
|
var stopRecordingAudio = React.useCallback(function () {
|
|
15845
15889
|
var _a, _b;
|
|
15890
|
+
setAudioRecordingIntentionallyStopped(true);
|
|
15846
15891
|
if (((_a = audioRecorder.current) === null || _a === void 0 ? void 0 : _a.state) !== 'inactive') {
|
|
15847
15892
|
(_b = audioRecorder.current) === null || _b === void 0 ? void 0 : _b.stop(); // if you call this while state === 'inactive', an exception is thrown.
|
|
15848
|
-
} else {
|
|
15849
|
-
processAudio(); // if we are in 'inactive' state, we just invoke our processing code manually.
|
|
15850
15893
|
}
|
|
15851
|
-
}, [
|
|
15894
|
+
}, []);
|
|
15895
|
+
React.useEffect(function () {
|
|
15896
|
+
if (videoRecordingStopped && videoRecordingIntentionallyStopped) {
|
|
15897
|
+
processVideo();
|
|
15898
|
+
}
|
|
15899
|
+
}, [processVideo, videoRecordingIntentionallyStopped, videoRecordingStopped]);
|
|
15900
|
+
React.useEffect(function () {
|
|
15901
|
+
if (audioRecordingStopped && audioRecordingIntentionallyStopped) {
|
|
15902
|
+
processAudio();
|
|
15903
|
+
}
|
|
15904
|
+
}, [audioRecordingIntentionallyStopped, audioRecordingStopped, processAudio]);
|
|
15852
15905
|
return {
|
|
15853
15906
|
isRecordingVideo: isRecordingVideo,
|
|
15854
15907
|
isRecordingAudio: isRecordingAudio,
|
|
@@ -15856,6 +15909,8 @@ var useVideoRecorder = function useVideoRecorder(camera, audioStream) {
|
|
|
15856
15909
|
startRecordingAudio: startRecordingAudio,
|
|
15857
15910
|
stopRecordingVideo: stopRecordingVideo,
|
|
15858
15911
|
stopRecordingAudio: stopRecordingAudio,
|
|
15912
|
+
videoRecordingUnintentionallyStopped: videoRecordingStopped && !videoRecordingIntentionallyStopped,
|
|
15913
|
+
audioRecordingUnintentionallyStopped: audioRecordingStopped && !audioRecordingIntentionallyStopped,
|
|
15859
15914
|
videoUrl: videoUrl,
|
|
15860
15915
|
audioUrl: audioUrl
|
|
15861
15916
|
};
|
|
@@ -16126,6 +16181,7 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
|
|
|
16126
16181
|
setSignatureData = _l.setSignatureData,
|
|
16127
16182
|
setSignatureVideoUrl = _l.setSignatureVideoUrl,
|
|
16128
16183
|
logSelfieCaptureAttempt = _l.logSelfieCaptureAttempt;
|
|
16184
|
+
var cameraAccessDenied = React.useContext(CameraStateContext).cameraAccessDenied;
|
|
16129
16185
|
var _m = React.useState('LOADING'),
|
|
16130
16186
|
captureState = _m[0],
|
|
16131
16187
|
setCaptureState = _m[1];
|
|
@@ -16196,6 +16252,14 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
|
|
|
16196
16252
|
onExit();
|
|
16197
16253
|
}, [onExit, onRetryClicked]);
|
|
16198
16254
|
var showSuccessScreen = useShowSuccessScreen(skipSuccessScreen, captureState === 'SUCCESS', onComplete);
|
|
16255
|
+
React.useEffect(function () {
|
|
16256
|
+
if (cameraAccessDenied) {
|
|
16257
|
+
setAttempt(function (n) {
|
|
16258
|
+
return n + 1;
|
|
16259
|
+
});
|
|
16260
|
+
setCaptureState('LOADING');
|
|
16261
|
+
}
|
|
16262
|
+
}, [cameraAccessDenied]);
|
|
16199
16263
|
return /*#__PURE__*/React__default['default'].createElement(HighPerformanceSelfieGuidanceModelsProvider, {
|
|
16200
16264
|
throttleMs: captureState === 'CAPTURING_SIGNATURE' ? 250 : 0,
|
|
16201
16265
|
onModelError: onModelError,
|
|
@@ -16535,6 +16599,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
16535
16599
|
onIdFrontImageCaptured = _a.onIdFrontImageCaptured,
|
|
16536
16600
|
onIdBackImageCaptured = _a.onIdBackImageCaptured,
|
|
16537
16601
|
onFaceNotDetected = _a.onFaceNotDetected,
|
|
16602
|
+
onRecordingFailed = _a.onRecordingFailed,
|
|
16538
16603
|
_u = _a.idCaptureModelsEnabled,
|
|
16539
16604
|
idCaptureModelsEnabled = _u === void 0 ? true : _u,
|
|
16540
16605
|
_v = _a.idCardFrontDelay,
|
|
@@ -16620,6 +16685,8 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
16620
16685
|
startRecordingAudio = _23.startRecordingAudio,
|
|
16621
16686
|
stopRecordingVideo = _23.stopRecordingVideo,
|
|
16622
16687
|
stopRecordingAudio = _23.stopRecordingAudio,
|
|
16688
|
+
videoRecordingUnintentionallyStopped = _23.videoRecordingUnintentionallyStopped,
|
|
16689
|
+
audioRecordingUnintentionallyStopped = _23.audioRecordingUnintentionallyStopped,
|
|
16623
16690
|
videoUrl = _23.videoUrl,
|
|
16624
16691
|
audioUrl = _23.audioUrl;
|
|
16625
16692
|
var countdownTimeoutRef = React.useRef(undefined);
|
|
@@ -16635,7 +16702,12 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
16635
16702
|
setVideoLoaded(false);
|
|
16636
16703
|
onComplete === null || onComplete === void 0 ? void 0 : onComplete(videoUrl, audioUrl);
|
|
16637
16704
|
}
|
|
16638
|
-
}, [audioUrl, isRecordingVideo, onComplete, readTextPrompt, startRecordingVideo, videoUrl]);
|
|
16705
|
+
}, [audioUrl, isRecordingVideo, onComplete, readTextPrompt, setVideoLoaded, startRecordingVideo, videoUrl]);
|
|
16706
|
+
React.useEffect(function () {
|
|
16707
|
+
if (videoRecordingUnintentionallyStopped || audioRecordingUnintentionallyStopped) {
|
|
16708
|
+
onRecordingFailed === null || onRecordingFailed === void 0 ? void 0 : onRecordingFailed();
|
|
16709
|
+
}
|
|
16710
|
+
}, [audioRecordingUnintentionallyStopped, onRecordingFailed, videoRecordingUnintentionallyStopped]);
|
|
16639
16711
|
var animationFrame = React.useRef(0);
|
|
16640
16712
|
var shouldCaptureFrames = React.useRef(false);
|
|
16641
16713
|
React.useEffect(function () {
|
|
@@ -16715,7 +16787,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
16715
16787
|
} else {
|
|
16716
16788
|
stopRecordingVideo();
|
|
16717
16789
|
}
|
|
16718
|
-
}, [
|
|
16790
|
+
}, [setExpectedAudioText, setIdCaptureVideoAudioStartsAt, startRecordingAudio, stopRecordingVideo, translatedText, videoStartsAt]);
|
|
16719
16791
|
var frameWidth = (_c = (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.videoWidth) !== null && _c !== void 0 ? _c : 0;
|
|
16720
16792
|
var frameHeight = (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0;
|
|
16721
16793
|
var faceBox = (_f = faces === null || faces === void 0 ? void 0 : faces[0]) === null || _f === void 0 ? void 0 : _f.box;
|
|
@@ -17131,7 +17203,7 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
17131
17203
|
setIdCaptureVideoAudioUrl = _2.setIdCaptureVideoAudioUrl;
|
|
17132
17204
|
var _3 = React.useState('CAPTURING_ID'),
|
|
17133
17205
|
captureState = _3[0],
|
|
17134
|
-
setCaptureState = _3[1];
|
|
17206
|
+
setCaptureState = _3[1];
|
|
17135
17207
|
React.useEffect(function () {
|
|
17136
17208
|
if (skipIdCapture && captureState === 'CAPTURING_ID') setCaptureState('CHECKING_LIVENESS');
|
|
17137
17209
|
}, [captureState, skipIdCapture]);
|
|
@@ -17183,6 +17255,12 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
17183
17255
|
React.useEffect(function () {
|
|
17184
17256
|
if (submissionStatus === SubmissionStatus.SUBMITTING) releaseCameraAccess();
|
|
17185
17257
|
}, [submissionStatus]);
|
|
17258
|
+
var onRecordingFailed = React.useCallback(function () {
|
|
17259
|
+
setAttempt(function (n) {
|
|
17260
|
+
return n + 1;
|
|
17261
|
+
});
|
|
17262
|
+
setCaptureState('CHECKING_LIVENESS');
|
|
17263
|
+
}, []);
|
|
17186
17264
|
if (submissionStatus === SubmissionStatus.SUBMITTING) {
|
|
17187
17265
|
return /*#__PURE__*/React__default['default'].createElement(PageContainer, {
|
|
17188
17266
|
className: "flex"
|
|
@@ -17257,6 +17335,7 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
17257
17335
|
onIdFrontImageCaptured: setIdCaptureVideoIdFrontImage,
|
|
17258
17336
|
onIdBackImageCaptured: setIdCaptureVideoIdBackImage,
|
|
17259
17337
|
onFaceNotDetected: onVideoCaptureFaceNotDetected,
|
|
17338
|
+
onRecordingFailed: onRecordingFailed,
|
|
17260
17339
|
idCaptureModelsEnabled: idCaptureModelsEnabled,
|
|
17261
17340
|
idCardFrontDetectionThreshold: idCardFrontDetectionThreshold,
|
|
17262
17341
|
idCardBackDetectionThreshold: idCardBackDetectionThreshold,
|
|
@@ -18724,7 +18803,9 @@ var CustomerVerificationWizard = function CustomerVerificationWizard(_a) {
|
|
|
18724
18803
|
var _l = React.useState('LOADING'),
|
|
18725
18804
|
captureState = _l[0],
|
|
18726
18805
|
setCaptureState = _l[1];
|
|
18727
|
-
var
|
|
18806
|
+
var _m = React.useContext(CameraStateContext),
|
|
18807
|
+
cameraAccessDenied = _m.cameraAccessDenied,
|
|
18808
|
+
releaseCameraAccess = _m.releaseCameraAccess;
|
|
18728
18809
|
var onCustomerMatchedCallback = React.useCallback(function (resp, req) {
|
|
18729
18810
|
return tslib.__awaiter(void 0, void 0, void 0, function () {
|
|
18730
18811
|
return tslib.__generator(this, function (_a) {
|
|
@@ -18747,9 +18828,9 @@ var CustomerVerificationWizard = function CustomerVerificationWizard(_a) {
|
|
|
18747
18828
|
setCaptureState('FAILED');
|
|
18748
18829
|
onCaptureGuidanceTimeout === null || onCaptureGuidanceTimeout === void 0 ? void 0 : onCaptureGuidanceTimeout();
|
|
18749
18830
|
}, [onCaptureGuidanceTimeout]);
|
|
18750
|
-
var
|
|
18751
|
-
attempt =
|
|
18752
|
-
setAttempt =
|
|
18831
|
+
var _o = React.useState(0),
|
|
18832
|
+
attempt = _o[0],
|
|
18833
|
+
setAttempt = _o[1];
|
|
18753
18834
|
var onExitCallback = React.useCallback(function () {
|
|
18754
18835
|
setAttempt(function (n) {
|
|
18755
18836
|
return n + 1;
|
|
@@ -18762,6 +18843,14 @@ var CustomerVerificationWizard = function CustomerVerificationWizard(_a) {
|
|
|
18762
18843
|
if (submissionRequest && submissionResponse) onComplete === null || onComplete === void 0 ? void 0 : onComplete(submissionResponse, submissionRequest);
|
|
18763
18844
|
}, [onComplete, releaseCameraAccess, submissionRequest, submissionResponse]);
|
|
18764
18845
|
var showSuccessScreen = useShowSuccessScreen(skipSuccessScreen, captureState === 'MATCHED', onDoneCallback);
|
|
18846
|
+
React.useEffect(function () {
|
|
18847
|
+
if (cameraAccessDenied) {
|
|
18848
|
+
setAttempt(function (n) {
|
|
18849
|
+
return n + 1;
|
|
18850
|
+
});
|
|
18851
|
+
setCaptureState('LOADING');
|
|
18852
|
+
}
|
|
18853
|
+
}, [cameraAccessDenied]);
|
|
18765
18854
|
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(PageContainer, {
|
|
18766
18855
|
className: "flex ".concat((_b = classNames.container) !== null && _b !== void 0 ? _b : '')
|
|
18767
18856
|
}, /*#__PURE__*/React__default['default'].createElement(CameraVideoTag, {
|
|
@@ -19241,7 +19330,9 @@ var CustomerIdentificationWizard = function CustomerIdentificationWizard(_a) {
|
|
|
19241
19330
|
var _l = React.useState('LOADING'),
|
|
19242
19331
|
captureState = _l[0],
|
|
19243
19332
|
setCaptureState = _l[1];
|
|
19244
|
-
var
|
|
19333
|
+
var _m = React.useContext(CameraStateContext),
|
|
19334
|
+
cameraAccessDenied = _m.cameraAccessDenied,
|
|
19335
|
+
releaseCameraAccess = _m.releaseCameraAccess;
|
|
19245
19336
|
var onCustomerMatchedCallback = React.useCallback(function (resp, req) {
|
|
19246
19337
|
return tslib.__awaiter(void 0, void 0, void 0, function () {
|
|
19247
19338
|
return tslib.__generator(this, function (_a) {
|
|
@@ -19264,9 +19355,9 @@ var CustomerIdentificationWizard = function CustomerIdentificationWizard(_a) {
|
|
|
19264
19355
|
setCaptureState('FAILED');
|
|
19265
19356
|
onCaptureGuidanceTimeout === null || onCaptureGuidanceTimeout === void 0 ? void 0 : onCaptureGuidanceTimeout();
|
|
19266
19357
|
}, [onCaptureGuidanceTimeout]);
|
|
19267
|
-
var
|
|
19268
|
-
attempt =
|
|
19269
|
-
setAttempt =
|
|
19358
|
+
var _o = React.useState(0),
|
|
19359
|
+
attempt = _o[0],
|
|
19360
|
+
setAttempt = _o[1];
|
|
19270
19361
|
var onExitCallback = React.useCallback(function () {
|
|
19271
19362
|
setAttempt(function (n) {
|
|
19272
19363
|
return n + 1;
|
|
@@ -19279,6 +19370,14 @@ var CustomerIdentificationWizard = function CustomerIdentificationWizard(_a) {
|
|
|
19279
19370
|
if (submissionRequest && submissionResponse) onComplete === null || onComplete === void 0 ? void 0 : onComplete(submissionResponse, submissionRequest);
|
|
19280
19371
|
}, [onComplete, releaseCameraAccess, submissionRequest, submissionResponse]);
|
|
19281
19372
|
var showSuccessScreen = useShowSuccessScreen(skipSuccessScreen, captureState === 'FOUND', onDoneCallback);
|
|
19373
|
+
React.useEffect(function () {
|
|
19374
|
+
if (cameraAccessDenied) {
|
|
19375
|
+
setAttempt(function (n) {
|
|
19376
|
+
return n + 1;
|
|
19377
|
+
});
|
|
19378
|
+
setCaptureState('LOADING');
|
|
19379
|
+
}
|
|
19380
|
+
}, [cameraAccessDenied]);
|
|
19282
19381
|
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(PageContainer, {
|
|
19283
19382
|
className: "flex ".concat((_b = classNames.container) !== null && _b !== void 0 ? _b : '')
|
|
19284
19383
|
}, /*#__PURE__*/React__default['default'].createElement(CameraVideoTag, {
|