idmission-web-sdk 1.0.326 → 1.0.327

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.
@@ -50,7 +50,7 @@ var LanguageDetector__default = /*#__PURE__*/_interopDefaultLegacy(LanguageDetec
50
50
  var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
51
51
  var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
52
52
 
53
- var webSdkVersion = '1.0.326';
53
+ var webSdkVersion = '1.0.327';
54
54
 
55
55
  function getPlatform() {
56
56
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -12782,7 +12782,16 @@ var DocumentCaptureStateProvider = function DocumentCaptureStateProvider(_a) {
12782
12782
  });
12783
12783
  }
12784
12784
  if (typeof ImageCapture !== 'undefined') {
12785
- new ImageCapture(cameraRef.current.stream.getTracks()[0]).takePhoto().then(onComplete)["catch"](function () {});
12785
+ var tracks = cameraRef.current.stream.getTracks();
12786
+ var videoCameraTrack = tracks.find(function (track) {
12787
+ return track.kind === 'video';
12788
+ });
12789
+ if (videoCameraTrack) {
12790
+ var imageCapture = new ImageCapture(videoCameraTrack);
12791
+ imageCapture.takePhoto().then(onComplete)["catch"](function () {});
12792
+ } else {
12793
+ throw new Error('Failed to find a video feed for taking a photo');
12794
+ }
12786
12795
  } else if (videoTag) {
12787
12796
  var canvas = document.createElement('canvas');
12788
12797
  drawToCanvas(canvas, videoTag);