idmission-web-sdk 2.3.16 → 2.3.18

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/sdk2.esm.js CHANGED
@@ -204,7 +204,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
204
204
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
205
205
  };
206
206
 
207
- var webSdkVersion = '2.3.16';
207
+ var webSdkVersion = '2.3.18';
208
208
 
209
209
  function getPlatform() {
210
210
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -13449,6 +13449,10 @@ var useVideoRecorder = function useVideoRecorder(mergeAVStreams) {
13449
13449
  mergeAVStreams: mergeAVStreams
13450
13450
  });
13451
13451
  }, [mergeAVStreams]);
13452
+ useEffect(function () {
13453
+ // clear recorded data when the component is mounted
13454
+ useVideoRecorderStore.getState().clearRecordedData();
13455
+ }, []);
13452
13456
  var processVideo = useCallback(function () {
13453
13457
  var videoBlob = new Blob(videoChunks, {
13454
13458
  type: 'video/mp4'
@@ -13623,31 +13627,11 @@ function VideoSignatureContextProvider(_a) {
13623
13627
  outputCanvas: outputCanvas
13624
13628
  });
13625
13629
  }, []);
13630
+ useEffect(function () {
13631
+ // clear recorded data when the component is mounted
13632
+ useVideoSignatureStore.getState().clearRecordedData();
13633
+ }, []);
13626
13634
  var isRecording = useVideoSignatureStore().isRecording;
13627
- // useEffect(() => {
13628
- // if (!isRecording || !camera) return
13629
- // waitForCanvasAvailable(outputCanvas).then(() => {
13630
- // log('VideoSignatureContext: starting recording...')
13631
- // clearSignatureChunks()
13632
- // const { startRecordingVideo, startRecordingAudio } =
13633
- // useVideoRecorderStore.getState()
13634
- // startRecordingVideo(camera, audioStream)
13635
- // if (captureAudio) startRecordingAudio(audioStream)
13636
- // const stream = outputCanvas.current!.captureStream(24 /* fps */)
13637
- // const tracks = [stream.getVideoTracks()[0]]
13638
- // const audioTrack = audioStream?.getAudioTracks()?.[0]
13639
- // if (audioTrack) tracks.push(audioTrack)
13640
- // const signatureRecorder = new MediaRecorder(new MediaStream(tracks), {
13641
- // videoBitsPerSecond: 270000,
13642
- // audioBitsPerSecond: 32000,
13643
- // })
13644
- // setSignatureRecorder(signatureRecorder)
13645
- // signatureRecorder.ondataavailable = (event) => {
13646
- // signatureChunks.push(event.data)
13647
- // }
13648
- // signatureRecorder.start(1000)
13649
- // })
13650
- // }, [audioStream, captureAudio, isRecording, camera])
13651
13635
  var animationFrame = useRef(0);
13652
13636
  useEffect(function () {
13653
13637
  if (!videoRef.current || !outputCanvas.current || !camera || !isRecording || !isRecordingVideo) return;
@@ -14165,7 +14149,6 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
14165
14149
  return n + 1;
14166
14150
  });
14167
14151
  setCaptureState('CHECKING_LIVENESS');
14168
- useVideoSignatureStore.getState().clearRecordedData();
14169
14152
  }, [onRetryClicked]);
14170
14153
  var onExitSignatureCapture = useCallback(function () {
14171
14154
  setAttempt(function (n) {
@@ -14173,6 +14156,7 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
14173
14156
  });
14174
14157
  setCaptureState('CHECKING_LIVENESS');
14175
14158
  onExitCapture === null || onExitCapture === void 0 ? void 0 : onExitCapture();
14159
+ useVideoSignatureStore.getState().clearRecordedData();
14176
14160
  }, [onExitCapture]);
14177
14161
  var showSuccessScreen = useShowSuccessScreen(skipSuccessScreen, captureState === 'SUCCESS', onComplete);
14178
14162
  useEffect(function () {
@@ -15266,7 +15250,6 @@ var VideoIdWizard = function VideoIdWizard(_a) {
15266
15250
  return n + 1;
15267
15251
  });
15268
15252
  setCaptureState('CAPTURING_ID');
15269
- useVideoRecorderStore.getState().clearRecordedData();
15270
15253
  }, []);
15271
15254
  var isCapturingId = !skipIdCapture && ['LOADING', 'CAPTURING_ID'].includes(captureState);
15272
15255
  useEffect(function () {
@@ -15283,6 +15266,7 @@ var VideoIdWizard = function VideoIdWizard(_a) {
15283
15266
  return n + 1;
15284
15267
  });
15285
15268
  onExitCapture === null || onExitCapture === void 0 ? void 0 : onExitCapture();
15269
+ useVideoRecorderStore.getState().clearRecordedData();
15286
15270
  }, [onExitCapture]);
15287
15271
  var capturedIdDocumentType = idDocumentType !== 'idCardOrPassport' ? idDocumentType : passportImage ? 'passport' : 'idCard';
15288
15272
  var faceLivenessGuides = useCallback(function (_a) {