idmission-web-sdk 2.1.75 → 2.1.76

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.
@@ -38,6 +38,7 @@ export type VideoIdCaptureThresholds = IdCaptureThresholds & {
38
38
  /** Number of good frames of the ID card back that must be captured before moving on during video capture. */
39
39
  idCardBack: number;
40
40
  };
41
+ flipShortcutThreshold: number;
41
42
  };
42
43
  export declare const defaultVideoIdCaptureThresholds: VideoIdCaptureThresholds;
43
44
  export type IdVideoCaptureProps = {
@@ -234,7 +234,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
234
234
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
235
235
  };
236
236
 
237
- var webSdkVersion = '2.1.75';
237
+ var webSdkVersion = '2.1.76';
238
238
 
239
239
  function getPlatform() {
240
240
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -13939,7 +13939,7 @@ var edgeBoundary = 0.05;
13939
13939
  var defaultVideoIdCaptureThresholds = {
13940
13940
  detection: {
13941
13941
  idCardFront: 0.4,
13942
- idCardBack: 0.4,
13942
+ idCardBack: 0.5,
13943
13943
  passport: 1
13944
13944
  },
13945
13945
  focus: {
@@ -13959,7 +13959,8 @@ var defaultVideoIdCaptureThresholds = {
13959
13959
  goodFrames: {
13960
13960
  idCardFront: 1,
13961
13961
  idCardBack: 1
13962
- }
13962
+ },
13963
+ flipShortcutThreshold: 0.7
13963
13964
  };
13964
13965
  var IdVideoCapture = function IdVideoCapture(_a) {
13965
13966
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
@@ -14115,14 +14116,15 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14115
14116
  setCurrentFocusScore(prediction.focusScore);
14116
14117
  var detectionThresholdMet = requestedAction === 'SHOW_ID_FRONT' ? prediction.idCardFrontDetectionThresholdMet : prediction.idCardBackDetectionThresholdMet;
14117
14118
  var isGoodFrame = detectionThresholdMet && prediction.focusThresholdMet;
14118
- if (requestedAction === 'FLIP_ID' && isGoodFrame) {
14119
+ var shouldShortcutFlipAnimation = requestedAction === 'FLIP_ID' && isGoodFrame && prediction.idCardBackDetectionScore >= videoIdCaptureThresholds.flipShortcutThreshold;
14120
+ if (shouldShortcutFlipAnimation) {
14119
14121
  return setRequestedAction('SHOW_ID_BACK');
14120
14122
  }
14121
14123
  setGoodFramesCount(isGoodFrame ? function (n) {
14122
14124
  return n + 1;
14123
14125
  } : 0);
14124
14126
  });
14125
- }, [idCaptureModelsEnabled, onIdPredictionMade, idModelError, requestedAction]);
14127
+ }, [idCaptureModelsEnabled, onIdPredictionMade, idModelError, requestedAction, videoIdCaptureThresholds.flipShortcutThreshold]);
14126
14128
  var _29 = React.useState(null),
14127
14129
  idFrontCaptureStartedAt = _29[0],
14128
14130
  setFirstGoodFrameTime = _29[1];