idmission-web-sdk 2.2.42 → 2.2.44

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.2.42';
214
+ var webSdkVersion = '2.2.44';
215
215
 
216
216
  function getPlatform() {
217
217
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -9628,13 +9628,14 @@
9628
9628
  handleStreamEnded = function handleStreamEnded() {
9629
9629
  if (iphoneContinuityCameraAvailable_1 && preferIphoneContinuityCamera) {
9630
9630
  debug('someone unplugged the continuity camera');
9631
- releaseCameraAccess();
9632
9631
  set({
9633
9632
  videoStream: null,
9634
9633
  videoDevice: null,
9634
+ cameraReady: false,
9635
9635
  iphoneContinuityCameraAvailable: false,
9636
9636
  iphoneContinuityCameraDenied: true
9637
9637
  });
9638
+ get().requestCameraAccess();
9638
9639
  } else {
9639
9640
  debug('someone unplugged the webcam');
9640
9641
  releaseCameraAccess();
@@ -9642,6 +9643,7 @@
9642
9643
  videoStream: null,
9643
9644
  videoDevice: null,
9644
9645
  videoLoaded: false,
9646
+ cameraReady: false,
9645
9647
  cameraAccessDenied: true
9646
9648
  });
9647
9649
  }
@@ -9704,7 +9706,7 @@
9704
9706
  },
9705
9707
  requestMicrophoneAccess: function requestMicrophoneAccess() {
9706
9708
  return __awaiter(this, void 0, void 0, function () {
9707
- var stream;
9709
+ var stream_2;
9708
9710
  return __generator(this, function (_a) {
9709
9711
  switch (_a.label) {
9710
9712
  case 0:
@@ -9715,20 +9717,35 @@
9715
9717
  return [4 /*yield*/, navigator.mediaDevices.getUserMedia({
9716
9718
  audio: true,
9717
9719
  video: false
9718
- })];
9720
+ })
9721
+ // iOS 17 has a strange behavior where the video track flickers between muted and unmuted
9722
+ // when the camera access is being requested. This delay is a workaround for that.
9723
+ ];
9719
9724
  case 2:
9720
- stream = _a.sent();
9721
- set({
9722
- audioStream: stream,
9723
- microphoneReady: true
9724
- });
9725
- stream.getAudioTracks().forEach(function (track) {
9726
- track.onended = function () {
9727
- set({
9728
- microphoneAccessDenied: true
9729
- });
9730
- };
9731
- });
9725
+ stream_2 = _a.sent();
9726
+ // iOS 17 has a strange behavior where the video track flickers between muted and unmuted
9727
+ // when the camera access is being requested. This delay is a workaround for that.
9728
+ setTimeout(function () {
9729
+ set({
9730
+ audioStream: stream_2,
9731
+ microphoneReady: true,
9732
+ microphoneAccessDenied: false
9733
+ });
9734
+ stream_2.getAudioTracks().forEach(function (track) {
9735
+ track.onended = function () {
9736
+ return set({
9737
+ microphoneReady: false,
9738
+ microphoneAccessDenied: true
9739
+ });
9740
+ };
9741
+ track.onmute = function () {
9742
+ return set({
9743
+ microphoneReady: false,
9744
+ microphoneAccessDenied: true
9745
+ });
9746
+ };
9747
+ });
9748
+ }, 500);
9732
9749
  return [3 /*break*/, 4];
9733
9750
  case 3:
9734
9751
  _a.sent();
@@ -9759,10 +9776,10 @@
9759
9776
  });
9760
9777
  });
9761
9778
  if (config.requestAccessAutomatically) {
9762
- store.getState().requestCameraAccess();
9779
+ void store.getState().requestCameraAccess();
9763
9780
  }
9764
9781
  if (config.requireMicrophoneAccess) {
9765
- store.getState().requestMicrophoneAccess();
9782
+ void store.getState().requestMicrophoneAccess();
9766
9783
  }
9767
9784
  return _assign(_assign({}, store), {
9768
9785
  destroy: function destroy() {
@@ -17359,7 +17376,7 @@
17359
17376
  type: 'resetWizard'
17360
17377
  });
17361
17378
  onExitCapture === null || onExitCapture === void 0 ? void 0 : onExitCapture();
17362
- requestCameraAccess();
17379
+ void requestCameraAccess();
17363
17380
  }, [dispatch, onExitCapture, releaseCameraAccess, requestCameraAccess]);
17364
17381
  React.useEffect(function () {
17365
17382
  if (submissionStatus !== SubmissionStatus.READY) {
@@ -22465,7 +22482,7 @@
22465
22482
  autoStart: false,
22466
22483
  onModelError: faceLivenessProps === null || faceLivenessProps === void 0 ? void 0 : faceLivenessProps.onModelError,
22467
22484
  modelLoadTimeoutMs: faceLivenessProps === null || faceLivenessProps === void 0 ? void 0 : faceLivenessProps.modelLoadTimeoutMs,
22468
- requireVerticalFaceCentering: captureState === 'CHECKING_LIVENESS'
22485
+ requireVerticalFaceCentering: false
22469
22486
  }, /*#__PURE__*/React.createElement(PageContainer, {
22470
22487
  className: "flex ".concat((_k = classNames.container) !== null && _k !== void 0 ? _k : '')
22471
22488
  }, ['CHECKING_LIVENESS', 'CAPTURING_VIDEO'].includes(captureState) && /*#__PURE__*/React.createElement(CameraVideoTag, {