idmission-web-sdk 2.2.161 → 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.
@@ -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.161';
214
+ var webSdkVersion = '2.2.162';
215
215
 
216
216
  function getPlatform() {
217
217
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -9373,7 +9373,7 @@
9373
9373
 
9374
9374
  function listAvailableCameras(facingMode_1) {
9375
9375
  return __awaiter(this, arguments, void 0, function (facingMode, requestMicAccess) {
9376
- var cameraEnumerationStream, videoDevices;
9376
+ var cameraEnumerationStream, allDevices, allowedVideoDevices;
9377
9377
  if (requestMicAccess === void 0) {
9378
9378
  requestMicAccess = false;
9379
9379
  }
@@ -9394,7 +9394,8 @@
9394
9394
  cameraEnumerationStream = _a.sent();
9395
9395
  return [4 /*yield*/, navigator.mediaDevices.enumerateDevices()];
9396
9396
  case 2:
9397
- videoDevices = _a.sent().filter(function (_a) {
9397
+ allDevices = _a.sent();
9398
+ allowedVideoDevices = allDevices.filter(function (_a) {
9398
9399
  var kind = _a.kind,
9399
9400
  label = _a.label;
9400
9401
  return kind === 'videoinput' && !label.toLowerCase().includes('virtual');
@@ -9405,7 +9406,7 @@
9405
9406
  track.stop();
9406
9407
  });
9407
9408
  cameraEnumerationStream = null;
9408
- return [2 /*return*/, videoDevices];
9409
+ return [2 /*return*/, allowedVideoDevices];
9409
9410
  }
9410
9411
  });
9411
9412
  });
@@ -9501,8 +9502,17 @@
9501
9502
  setConfig: function setConfig(config) {
9502
9503
  return set(config);
9503
9504
  },
9504
- onVideoMounted: function onVideoMounted() {
9505
- return set({
9505
+ onVideoMounted: function onVideoMounted(e) {
9506
+ var _a;
9507
+ var selectedVideoStreamId = (_a = get().videoStream) === null || _a === void 0 ? void 0 : _a.id;
9508
+ if (!selectedVideoStreamId) return;
9509
+ var srcObject = e.currentTarget.srcObject;
9510
+ if (srcObject.id !== selectedVideoStreamId) {
9511
+ warn('camera tampering detected, reloading the page.');
9512
+ window.location.reload();
9513
+ return;
9514
+ }
9515
+ set({
9506
9516
  videoLoaded: true
9507
9517
  });
9508
9518
  },