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.
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.17';
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) {
@@ -15267,7 +15250,6 @@ var VideoIdWizard = function VideoIdWizard(_a) {
15267
15250
  return n + 1;
15268
15251
  });
15269
15252
  setCaptureState('CAPTURING_ID');
15270
- useVideoRecorderStore.getState().clearRecordedData();
15271
15253
  }, []);
15272
15254
  var isCapturingId = !skipIdCapture && ['LOADING', 'CAPTURING_ID'].includes(captureState);
15273
15255
  useEffect(function () {
@@ -15278,7 +15260,6 @@ var VideoIdWizard = function VideoIdWizard(_a) {
15278
15260
  return n + 1;
15279
15261
  });
15280
15262
  setCaptureState('CHECKING_LIVENESS');
15281
- useVideoRecorderStore.getState().clearRecordedData();
15282
15263
  }, []);
15283
15264
  var handleExitCapture = useCallback(function () {
15284
15265
  setAttempt(function (n) {