idmission-web-sdk 2.2.160 → 2.2.162

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
@@ -203,7 +203,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
203
203
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
204
204
  };
205
205
 
206
- var webSdkVersion = '2.2.160';
206
+ var webSdkVersion = '2.2.162';
207
207
 
208
208
  function getPlatform() {
209
209
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -3402,7 +3402,7 @@ function useFrameLoop(fn, _a) {
3402
3402
 
3403
3403
  function listAvailableCameras(facingMode_1) {
3404
3404
  return __awaiter(this, arguments, void 0, function (facingMode, requestMicAccess) {
3405
- var cameraEnumerationStream, videoDevices;
3405
+ var cameraEnumerationStream, allDevices, allowedVideoDevices;
3406
3406
  if (requestMicAccess === void 0) {
3407
3407
  requestMicAccess = false;
3408
3408
  }
@@ -3423,7 +3423,8 @@ function listAvailableCameras(facingMode_1) {
3423
3423
  cameraEnumerationStream = _a.sent();
3424
3424
  return [4 /*yield*/, navigator.mediaDevices.enumerateDevices()];
3425
3425
  case 2:
3426
- videoDevices = _a.sent().filter(function (_a) {
3426
+ allDevices = _a.sent();
3427
+ allowedVideoDevices = allDevices.filter(function (_a) {
3427
3428
  var kind = _a.kind,
3428
3429
  label = _a.label;
3429
3430
  return kind === 'videoinput' && !label.toLowerCase().includes('virtual');
@@ -3434,7 +3435,7 @@ function listAvailableCameras(facingMode_1) {
3434
3435
  track.stop();
3435
3436
  });
3436
3437
  cameraEnumerationStream = null;
3437
- return [2 /*return*/, videoDevices];
3438
+ return [2 /*return*/, allowedVideoDevices];
3438
3439
  }
3439
3440
  });
3440
3441
  });
@@ -3530,8 +3531,17 @@ var createCameraStore = function createCameraStore(config) {
3530
3531
  setConfig: function setConfig(config) {
3531
3532
  return set(config);
3532
3533
  },
3533
- onVideoMounted: function onVideoMounted() {
3534
- return set({
3534
+ onVideoMounted: function onVideoMounted(e) {
3535
+ var _a;
3536
+ var selectedVideoStreamId = (_a = get().videoStream) === null || _a === void 0 ? void 0 : _a.id;
3537
+ if (!selectedVideoStreamId) return;
3538
+ var srcObject = e.currentTarget.srcObject;
3539
+ if (srcObject.id !== selectedVideoStreamId) {
3540
+ warn('camera tampering detected, reloading the page.');
3541
+ window.location.reload();
3542
+ return;
3543
+ }
3544
+ set({
3535
3545
  videoLoaded: true
3536
3546
  });
3537
3547
  },
@@ -14002,7 +14012,7 @@ var defaultVideoIdCaptureThresholds = {
14002
14012
  detection: {
14003
14013
  idCardFront: 0.4,
14004
14014
  idCardBack: 0.5,
14005
- passport: 0.3,
14015
+ passport: 0.25,
14006
14016
  singlePage: 0.3
14007
14017
  },
14008
14018
  focus: {