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.
@@ -211,7 +211,7 @@
211
211
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
212
212
  };
213
213
 
214
- var webSdkVersion = '2.3.16';
214
+ var webSdkVersion = '2.3.18';
215
215
 
216
216
  function getPlatform() {
217
217
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -23355,6 +23355,10 @@
23355
23355
  mergeAVStreams: mergeAVStreams
23356
23356
  });
23357
23357
  }, [mergeAVStreams]);
23358
+ React.useEffect(function () {
23359
+ // clear recorded data when the component is mounted
23360
+ useVideoRecorderStore.getState().clearRecordedData();
23361
+ }, []);
23358
23362
  var processVideo = React.useCallback(function () {
23359
23363
  var videoBlob = new Blob(videoChunks, {
23360
23364
  type: 'video/mp4'
@@ -23529,31 +23533,11 @@
23529
23533
  outputCanvas: outputCanvas
23530
23534
  });
23531
23535
  }, []);
23536
+ React.useEffect(function () {
23537
+ // clear recorded data when the component is mounted
23538
+ useVideoSignatureStore.getState().clearRecordedData();
23539
+ }, []);
23532
23540
  var isRecording = useVideoSignatureStore().isRecording;
23533
- // useEffect(() => {
23534
- // if (!isRecording || !camera) return
23535
- // waitForCanvasAvailable(outputCanvas).then(() => {
23536
- // log('VideoSignatureContext: starting recording...')
23537
- // clearSignatureChunks()
23538
- // const { startRecordingVideo, startRecordingAudio } =
23539
- // useVideoRecorderStore.getState()
23540
- // startRecordingVideo(camera, audioStream)
23541
- // if (captureAudio) startRecordingAudio(audioStream)
23542
- // const stream = outputCanvas.current!.captureStream(24 /* fps */)
23543
- // const tracks = [stream.getVideoTracks()[0]]
23544
- // const audioTrack = audioStream?.getAudioTracks()?.[0]
23545
- // if (audioTrack) tracks.push(audioTrack)
23546
- // const signatureRecorder = new MediaRecorder(new MediaStream(tracks), {
23547
- // videoBitsPerSecond: 270000,
23548
- // audioBitsPerSecond: 32000,
23549
- // })
23550
- // setSignatureRecorder(signatureRecorder)
23551
- // signatureRecorder.ondataavailable = (event) => {
23552
- // signatureChunks.push(event.data)
23553
- // }
23554
- // signatureRecorder.start(1000)
23555
- // })
23556
- // }, [audioStream, captureAudio, isRecording, camera])
23557
23541
  var animationFrame = React.useRef(0);
23558
23542
  React.useEffect(function () {
23559
23543
  if (!videoRef.current || !outputCanvas.current || !camera || !isRecording || !isRecordingVideo) return;
@@ -24071,7 +24055,6 @@
24071
24055
  return n + 1;
24072
24056
  });
24073
24057
  setCaptureState('CHECKING_LIVENESS');
24074
- useVideoSignatureStore.getState().clearRecordedData();
24075
24058
  }, [onRetryClicked]);
24076
24059
  var onExitSignatureCapture = React.useCallback(function () {
24077
24060
  setAttempt(function (n) {
@@ -24079,6 +24062,7 @@
24079
24062
  });
24080
24063
  setCaptureState('CHECKING_LIVENESS');
24081
24064
  onExitCapture === null || onExitCapture === void 0 ? void 0 : onExitCapture();
24065
+ useVideoSignatureStore.getState().clearRecordedData();
24082
24066
  }, [onExitCapture]);
24083
24067
  var showSuccessScreen = useShowSuccessScreen(skipSuccessScreen, captureState === 'SUCCESS', onComplete);
24084
24068
  React.useEffect(function () {
@@ -25172,7 +25156,6 @@
25172
25156
  return n + 1;
25173
25157
  });
25174
25158
  setCaptureState('CAPTURING_ID');
25175
- useVideoRecorderStore.getState().clearRecordedData();
25176
25159
  }, []);
25177
25160
  var isCapturingId = !skipIdCapture && ['LOADING', 'CAPTURING_ID'].includes(captureState);
25178
25161
  React.useEffect(function () {
@@ -25189,6 +25172,7 @@
25189
25172
  return n + 1;
25190
25173
  });
25191
25174
  onExitCapture === null || onExitCapture === void 0 ? void 0 : onExitCapture();
25175
+ useVideoRecorderStore.getState().clearRecordedData();
25192
25176
  }, [onExitCapture]);
25193
25177
  var capturedIdDocumentType = idDocumentType !== 'idCardOrPassport' ? idDocumentType : passportImage ? 'passport' : 'idCard';
25194
25178
  var faceLivenessGuides = React.useCallback(function (_a) {