idmission-web-sdk 2.3.17 → 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.17';
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) {
@@ -25173,7 +25156,6 @@
25173
25156
  return n + 1;
25174
25157
  });
25175
25158
  setCaptureState('CAPTURING_ID');
25176
- useVideoRecorderStore.getState().clearRecordedData();
25177
25159
  }, []);
25178
25160
  var isCapturingId = !skipIdCapture && ['LOADING', 'CAPTURING_ID'].includes(captureState);
25179
25161
  React.useEffect(function () {
@@ -25184,7 +25166,6 @@
25184
25166
  return n + 1;
25185
25167
  });
25186
25168
  setCaptureState('CHECKING_LIVENESS');
25187
- useVideoRecorderStore.getState().clearRecordedData();
25188
25169
  }, []);
25189
25170
  var handleExitCapture = React.useCallback(function () {
25190
25171
  setAttempt(function (n) {