@ekyc_qoobiss/qbs-ect-cmp 3.5.22 → 3.6.1

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.
@@ -5686,7 +5686,7 @@ class Cameras {
5686
5686
  const devices = await navigator.mediaDevices.enumerateDevices();
5687
5687
  const videoDevices = devices.filter(device => device.kind === 'videoinput');
5688
5688
  for (const device of videoDevices) {
5689
- const updatedConstraints = this.GetConstraints(device.deviceId, deviceInfo);
5689
+ const updatedConstraints = deviceInfo.isAppleDevice ? this.GetConstraintsIOs(deviceInfo) : this.GetConstraints(device.deviceId, deviceInfo);
5690
5690
  const stream = await navigator.mediaDevices.getUserMedia(updatedConstraints);
5691
5691
  stream.getVideoTracks().forEach(track => {
5692
5692
  var _a, _b;
@@ -5747,30 +5747,53 @@ class Cameras {
5747
5747
  GetConstraints(selectedDeviceId, device, portrait = false) {
5748
5748
  let constraints = {
5749
5749
  audio: false,
5750
- video: {
5751
- frameRate: 30,
5752
- },
5750
+ };
5751
+ let mediaTrack = {
5752
+ frameRate: 30,
5753
5753
  };
5754
5754
  if (selectedDeviceId) {
5755
- constraints.video.deviceId = {
5755
+ mediaTrack.deviceId = {
5756
5756
  exact: selectedDeviceId,
5757
5757
  };
5758
5758
  }
5759
5759
  if (device.isDesktop) {
5760
- constraints.video.width = { ideal: 1280 };
5760
+ mediaTrack.width = { ideal: 1280 };
5761
+ }
5762
+ else {
5763
+ mediaTrack.facingMode = 'user';
5764
+ if (portrait) {
5765
+ mediaTrack.width = { ideal: 1920 };
5766
+ mediaTrack.height = { ideal: 1080 };
5767
+ }
5768
+ else {
5769
+ mediaTrack.facingMode = 'environment';
5770
+ mediaTrack.width = { ideal: 1920 };
5771
+ mediaTrack.aspectRatio = 1;
5772
+ }
5773
+ }
5774
+ constraints.video = mediaTrack;
5775
+ return constraints;
5776
+ }
5777
+ GetConstraintsIOs(device, portrait = false) {
5778
+ let constraints = {
5779
+ audio: false,
5780
+ };
5781
+ let mediaTrack = {};
5782
+ if (device.isDesktop) {
5783
+ mediaTrack.width = 1280;
5761
5784
  }
5762
5785
  else {
5786
+ mediaTrack.facingMode = 'user';
5763
5787
  if (portrait) {
5764
- constraints.video.facingMode = 'user';
5765
- constraints.video.width = { ideal: 1280 };
5766
- constraints.video.height = { ideal: 720 };
5788
+ mediaTrack.width = 1280;
5789
+ mediaTrack.height = 720;
5767
5790
  }
5768
5791
  else {
5769
- constraints.video.facingMode = 'environment';
5770
- constraints.video.width = { ideal: 1280 };
5771
- constraints.video.aspectRatio = 1;
5792
+ mediaTrack.facingMode = 'environment';
5793
+ mediaTrack.width = 1280;
5772
5794
  }
5773
5795
  }
5796
+ constraints.video = mediaTrack;
5774
5797
  return constraints;
5775
5798
  }
5776
5799
  GetRecommendedCamera(cameras) {
@@ -5862,7 +5885,7 @@ const IdBackCapture = class {
5862
5885
  }
5863
5886
  async openCamera() {
5864
5887
  await this.baseComponent.logStep(FlowSteps.CiBackCapture, FlowMoments.Initialized);
5865
- var constraints = this.cameras.GetConstraints(state.cameraId, state.device);
5888
+ const constraints = state.device.isAppleDevice ? this.cameras.GetConstraintsIOs(state.device) : this.cameras.GetConstraints(state.cameraId, state.device);
5866
5889
  setTimeout(() => {
5867
5890
  navigator.mediaDevices
5868
5891
  .getUserMedia(constraints)
@@ -5979,7 +6002,7 @@ const IdCapture = class {
5979
6002
  }
5980
6003
  async openCamera() {
5981
6004
  await this.baseComponent.logStep(FlowSteps.CiFrontCapture, FlowMoments.Initialized);
5982
- var constraints = this.cameras.GetConstraints(state.cameraId, state.device);
6005
+ const constraints = state.device.isAppleDevice ? this.cameras.GetConstraintsIOs(state.device) : this.cameras.GetConstraints(state.cameraId, state.device);
5983
6006
  setTimeout(() => {
5984
6007
  navigator.mediaDevices
5985
6008
  .getUserMedia(constraints)
@@ -6438,7 +6461,7 @@ function v4(options, buf, offset) {
6438
6461
  }
6439
6462
 
6440
6463
  const name = "@ekyc_qoobiss/qbs-ect-cmp";
6441
- const version$1 = "3.5.22";
6464
+ const version$1 = "3.6.1";
6442
6465
  const description = "Person Identification Component";
6443
6466
  const main = "./dist/index.cjs.js";
6444
6467
  const module$1 = "./dist/index.js";
@@ -9913,7 +9936,7 @@ const SelfieCapture = class {
9913
9936
  }
9914
9937
  async openCamera() {
9915
9938
  await this.baseComponent.logStep(FlowSteps.SelfieCapture, FlowMoments.Initialized);
9916
- const constraints = this.cameras.GetConstraints('', state.device, true);
9939
+ const constraints = state.device.isAppleDevice ? this.cameras.GetConstraintsIOs(state.device, true) : this.cameras.GetConstraints('', state.device, true);
9917
9940
  setTimeout(() => {
9918
9941
  navigator.mediaDevices
9919
9942
  .getUserMedia(constraints)
@@ -66,7 +66,7 @@ export class IdBackCapture {
66
66
  }
67
67
  async openCamera() {
68
68
  await this.baseComponent.logStep(FlowSteps.CiBackCapture, FlowMoments.Initialized);
69
- var constraints = this.cameras.GetConstraints(store.cameraId, store.device);
69
+ const constraints = store.device.isAppleDevice ? this.cameras.GetConstraintsIOs(store.device) : this.cameras.GetConstraints(store.cameraId, store.device);
70
70
  setTimeout(() => {
71
71
  navigator.mediaDevices
72
72
  .getUserMedia(constraints)
@@ -62,7 +62,7 @@ export class IdCapture {
62
62
  }
63
63
  async openCamera() {
64
64
  await this.baseComponent.logStep(FlowSteps.CiFrontCapture, FlowMoments.Initialized);
65
- var constraints = this.cameras.GetConstraints(store.cameraId, store.device);
65
+ const constraints = store.device.isAppleDevice ? this.cameras.GetConstraintsIOs(store.device) : this.cameras.GetConstraints(store.cameraId, store.device);
66
66
  setTimeout(() => {
67
67
  navigator.mediaDevices
68
68
  .getUserMedia(constraints)
@@ -72,7 +72,7 @@ export class SelfieCapture {
72
72
  }
73
73
  async openCamera() {
74
74
  await this.baseComponent.logStep(FlowSteps.SelfieCapture, FlowMoments.Initialized);
75
- const constraints = this.cameras.GetConstraints('', store.device, true);
75
+ const constraints = store.device.isAppleDevice ? this.cameras.GetConstraintsIOs(store.device, true) : this.cameras.GetConstraints('', store.device, true);
76
76
  setTimeout(() => {
77
77
  navigator.mediaDevices
78
78
  .getUserMedia(constraints)
@@ -6,7 +6,7 @@ export class Cameras {
6
6
  const devices = await navigator.mediaDevices.enumerateDevices();
7
7
  const videoDevices = devices.filter(device => device.kind === 'videoinput');
8
8
  for (const device of videoDevices) {
9
- const updatedConstraints = this.GetConstraints(device.deviceId, deviceInfo);
9
+ const updatedConstraints = deviceInfo.isAppleDevice ? this.GetConstraintsIOs(deviceInfo) : this.GetConstraints(device.deviceId, deviceInfo);
10
10
  const stream = await navigator.mediaDevices.getUserMedia(updatedConstraints);
11
11
  stream.getVideoTracks().forEach(track => {
12
12
  var _a, _b;
@@ -67,30 +67,53 @@ export class Cameras {
67
67
  GetConstraints(selectedDeviceId, device, portrait = false) {
68
68
  let constraints = {
69
69
  audio: false,
70
- video: {
71
- frameRate: 30,
72
- },
70
+ };
71
+ let mediaTrack = {
72
+ frameRate: 30,
73
73
  };
74
74
  if (selectedDeviceId) {
75
- constraints.video.deviceId = {
75
+ mediaTrack.deviceId = {
76
76
  exact: selectedDeviceId,
77
77
  };
78
78
  }
79
79
  if (device.isDesktop) {
80
- constraints.video.width = { ideal: 1280 };
80
+ mediaTrack.width = { ideal: 1280 };
81
+ }
82
+ else {
83
+ mediaTrack.facingMode = 'user';
84
+ if (portrait) {
85
+ mediaTrack.width = { ideal: 1920 };
86
+ mediaTrack.height = { ideal: 1080 };
87
+ }
88
+ else {
89
+ mediaTrack.facingMode = 'environment';
90
+ mediaTrack.width = { ideal: 1920 };
91
+ mediaTrack.aspectRatio = 1;
92
+ }
93
+ }
94
+ constraints.video = mediaTrack;
95
+ return constraints;
96
+ }
97
+ GetConstraintsIOs(device, portrait = false) {
98
+ let constraints = {
99
+ audio: false,
100
+ };
101
+ let mediaTrack = {};
102
+ if (device.isDesktop) {
103
+ mediaTrack.width = 1280;
81
104
  }
82
105
  else {
106
+ mediaTrack.facingMode = 'user';
83
107
  if (portrait) {
84
- constraints.video.facingMode = 'user';
85
- constraints.video.width = { ideal: 1280 };
86
- constraints.video.height = { ideal: 720 };
108
+ mediaTrack.width = 1280;
109
+ mediaTrack.height = 720;
87
110
  }
88
111
  else {
89
- constraints.video.facingMode = 'environment';
90
- constraints.video.width = { ideal: 1280 };
91
- constraints.video.aspectRatio = 1;
112
+ mediaTrack.facingMode = 'environment';
113
+ mediaTrack.width = 1280;
92
114
  }
93
115
  }
116
+ constraints.video = mediaTrack;
94
117
  return constraints;
95
118
  }
96
119
  GetRecommendedCamera(cameras) {
@@ -5682,7 +5682,7 @@ class Cameras {
5682
5682
  const devices = await navigator.mediaDevices.enumerateDevices();
5683
5683
  const videoDevices = devices.filter(device => device.kind === 'videoinput');
5684
5684
  for (const device of videoDevices) {
5685
- const updatedConstraints = this.GetConstraints(device.deviceId, deviceInfo);
5685
+ const updatedConstraints = deviceInfo.isAppleDevice ? this.GetConstraintsIOs(deviceInfo) : this.GetConstraints(device.deviceId, deviceInfo);
5686
5686
  const stream = await navigator.mediaDevices.getUserMedia(updatedConstraints);
5687
5687
  stream.getVideoTracks().forEach(track => {
5688
5688
  var _a, _b;
@@ -5743,30 +5743,53 @@ class Cameras {
5743
5743
  GetConstraints(selectedDeviceId, device, portrait = false) {
5744
5744
  let constraints = {
5745
5745
  audio: false,
5746
- video: {
5747
- frameRate: 30,
5748
- },
5746
+ };
5747
+ let mediaTrack = {
5748
+ frameRate: 30,
5749
5749
  };
5750
5750
  if (selectedDeviceId) {
5751
- constraints.video.deviceId = {
5751
+ mediaTrack.deviceId = {
5752
5752
  exact: selectedDeviceId,
5753
5753
  };
5754
5754
  }
5755
5755
  if (device.isDesktop) {
5756
- constraints.video.width = { ideal: 1280 };
5756
+ mediaTrack.width = { ideal: 1280 };
5757
+ }
5758
+ else {
5759
+ mediaTrack.facingMode = 'user';
5760
+ if (portrait) {
5761
+ mediaTrack.width = { ideal: 1920 };
5762
+ mediaTrack.height = { ideal: 1080 };
5763
+ }
5764
+ else {
5765
+ mediaTrack.facingMode = 'environment';
5766
+ mediaTrack.width = { ideal: 1920 };
5767
+ mediaTrack.aspectRatio = 1;
5768
+ }
5769
+ }
5770
+ constraints.video = mediaTrack;
5771
+ return constraints;
5772
+ }
5773
+ GetConstraintsIOs(device, portrait = false) {
5774
+ let constraints = {
5775
+ audio: false,
5776
+ };
5777
+ let mediaTrack = {};
5778
+ if (device.isDesktop) {
5779
+ mediaTrack.width = 1280;
5757
5780
  }
5758
5781
  else {
5782
+ mediaTrack.facingMode = 'user';
5759
5783
  if (portrait) {
5760
- constraints.video.facingMode = 'user';
5761
- constraints.video.width = { ideal: 1280 };
5762
- constraints.video.height = { ideal: 720 };
5784
+ mediaTrack.width = 1280;
5785
+ mediaTrack.height = 720;
5763
5786
  }
5764
5787
  else {
5765
- constraints.video.facingMode = 'environment';
5766
- constraints.video.width = { ideal: 1280 };
5767
- constraints.video.aspectRatio = 1;
5788
+ mediaTrack.facingMode = 'environment';
5789
+ mediaTrack.width = 1280;
5768
5790
  }
5769
5791
  }
5792
+ constraints.video = mediaTrack;
5770
5793
  return constraints;
5771
5794
  }
5772
5795
  GetRecommendedCamera(cameras) {
@@ -5858,7 +5881,7 @@ const IdBackCapture = class {
5858
5881
  }
5859
5882
  async openCamera() {
5860
5883
  await this.baseComponent.logStep(FlowSteps.CiBackCapture, FlowMoments.Initialized);
5861
- var constraints = this.cameras.GetConstraints(state.cameraId, state.device);
5884
+ const constraints = state.device.isAppleDevice ? this.cameras.GetConstraintsIOs(state.device) : this.cameras.GetConstraints(state.cameraId, state.device);
5862
5885
  setTimeout(() => {
5863
5886
  navigator.mediaDevices
5864
5887
  .getUserMedia(constraints)
@@ -5975,7 +5998,7 @@ const IdCapture = class {
5975
5998
  }
5976
5999
  async openCamera() {
5977
6000
  await this.baseComponent.logStep(FlowSteps.CiFrontCapture, FlowMoments.Initialized);
5978
- var constraints = this.cameras.GetConstraints(state.cameraId, state.device);
6001
+ const constraints = state.device.isAppleDevice ? this.cameras.GetConstraintsIOs(state.device) : this.cameras.GetConstraints(state.cameraId, state.device);
5979
6002
  setTimeout(() => {
5980
6003
  navigator.mediaDevices
5981
6004
  .getUserMedia(constraints)
@@ -6434,7 +6457,7 @@ function v4(options, buf, offset) {
6434
6457
  }
6435
6458
 
6436
6459
  const name = "@ekyc_qoobiss/qbs-ect-cmp";
6437
- const version$1 = "3.5.22";
6460
+ const version$1 = "3.6.1";
6438
6461
  const description = "Person Identification Component";
6439
6462
  const main = "./dist/index.cjs.js";
6440
6463
  const module = "./dist/index.js";
@@ -9909,7 +9932,7 @@ const SelfieCapture = class {
9909
9932
  }
9910
9933
  async openCamera() {
9911
9934
  await this.baseComponent.logStep(FlowSteps.SelfieCapture, FlowMoments.Initialized);
9912
- const constraints = this.cameras.GetConstraints('', state.device, true);
9935
+ const constraints = state.device.isAppleDevice ? this.cameras.GetConstraintsIOs(state.device, true) : this.cameras.GetConstraints('', state.device, true);
9913
9936
  setTimeout(() => {
9914
9937
  navigator.mediaDevices
9915
9938
  .getUserMedia(constraints)