idmission-web-sdk 0.0.78 → 0.0.79

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
@@ -14,7 +14,7 @@ import useResizeObserver from 'use-resize-observer';
14
14
  import { FaceDetector, FilesetResolver } from '@mediapipe/tasks-vision';
15
15
  import SignatureCanvas from 'react-signature-canvas';
16
16
 
17
- var webSdkVersion = '0.0.78';
17
+ var webSdkVersion = '0.0.79';
18
18
 
19
19
  function getPlatform() {
20
20
  return window.platform;
@@ -1442,21 +1442,23 @@ var useHighestResCaptureDevice = function useHighestResCaptureDevice(_a) {
1442
1442
  if (!stream) {
1443
1443
  throw new Error('failed to open camera');
1444
1444
  }
1445
- stream.getVideoTracks()[0].onended = function () {
1446
- var _a;
1447
- if (iphoneContinuityCameraAvailable && iphoneContinuityCameraAllowed) {
1448
- console.log('someone unplugged the continuity camera');
1449
- setIphoneContinuityCameraAvailable(false);
1450
- setIphoneContinuityCameraDenied(true);
1451
- } else {
1452
- console.log('someone unplugged the webcam');
1453
- (_a = cameraRef.current) === null || _a === void 0 ? void 0 : _a.release();
1454
- cameraRef.current = null;
1455
- setVideoLoaded(false);
1456
- setCameraAccessDenied(true);
1457
- setCaptureDevice(null);
1458
- }
1459
- };
1445
+ stream.getVideoTracks().forEach(function (track) {
1446
+ track.onended = function () {
1447
+ var _a;
1448
+ if (iphoneContinuityCameraAvailable && iphoneContinuityCameraAllowed) {
1449
+ console.log('someone unplugged the continuity camera');
1450
+ setIphoneContinuityCameraAvailable(false);
1451
+ setIphoneContinuityCameraDenied(true);
1452
+ } else {
1453
+ console.log('someone unplugged the webcam');
1454
+ (_a = cameraRef.current) === null || _a === void 0 ? void 0 : _a.release();
1455
+ cameraRef.current = null;
1456
+ setVideoLoaded(false);
1457
+ setCameraAccessDenied(true);
1458
+ setCaptureDevice(null);
1459
+ }
1460
+ };
1461
+ });
1460
1462
  cameraRef.current = obtainCameraAccess(stream, videoDevice.label, videoRef.current);
1461
1463
  return [2];
1462
1464
  }