@ekyc_qoobiss/qbs-ect-cmp 3.6.35 → 3.6.37

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.
@@ -2027,6 +2027,7 @@ class FaceML5Detector {
2027
2027
  if (this.stream.facePose !== null) {
2028
2028
  await delay(3000);
2029
2029
  this.validFacePose = true;
2030
+ this.stream.autoCapturing();
2030
2031
  await this.drawFrame('green', true);
2031
2032
  }
2032
2033
  }
@@ -4562,7 +4563,7 @@ class Stream {
4562
4563
  this.faceML5Detector = FaceML5Detector.getInstance(this, TranslationUtils.state.device.isMobile);
4563
4564
  this.verificationMode = mode;
4564
4565
  }
4565
- static getInstance(mode) {
4566
+ static getNewInstance(mode) {
4566
4567
  if (!Stream.instance) {
4567
4568
  Stream.instance = new Stream(mode);
4568
4569
  }
@@ -4797,7 +4798,7 @@ const Camera = class {
4797
4798
  }
4798
4799
  startStream() {
4799
4800
  var captureMode = this.captureMode == 'tilt' ? VerificationMode.Tilt : VerificationMode.Full;
4800
- const stream = Stream.getInstance(captureMode);
4801
+ const stream = Stream.getNewInstance(captureMode);
4801
4802
  stream.updateHtmlElements(this.cameraVideo, this.cameraCanvas, this.component);
4802
4803
  if (this.captureMode == 'selfie') {
4803
4804
  stream.setFaceDetection(true);
@@ -5199,7 +5200,7 @@ const IdBackCapture = class {
5199
5200
  navigator.mediaDevices
5200
5201
  .getUserMedia(constraints)
5201
5202
  .then(stream => {
5202
- const superStream = Stream.getInstance(VerificationMode.Full);
5203
+ const superStream = Stream.getNewInstance(VerificationMode.Full);
5203
5204
  superStream.initStream(stream);
5204
5205
  })
5205
5206
  .catch(e => {
@@ -5210,7 +5211,7 @@ const IdBackCapture = class {
5210
5211
  }
5211
5212
  closeCamera() {
5212
5213
  if (Stream.instance) {
5213
- Stream.getInstance(VerificationMode.Full).dropStream();
5214
+ Stream.instance.dropStream();
5214
5215
  }
5215
5216
  }
5216
5217
  disconnectedCallback() {
@@ -5229,7 +5230,7 @@ const IdBackCapture = class {
5229
5230
  var loops = 0;
5230
5231
  this.demoVideo.src = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_id.mp4';
5231
5232
  this.demoVideo.loop = false;
5232
- while (loops < 5) {
5233
+ while (loops < 7) {
5233
5234
  this.demoVideo.play();
5234
5235
  await delay(this.translations.GlobalValues.VideoLenght);
5235
5236
  }
@@ -5239,8 +5240,13 @@ const IdBackCapture = class {
5239
5240
  if (this.captureTaken)
5240
5241
  return;
5241
5242
  this.captureTaken = true;
5242
- let res = await Stream.getInstance(VerificationMode.Full).takePhoto();
5243
- this.photoIsReady(res);
5243
+ if (Stream.instance) {
5244
+ let res = await Stream.instance.takePhoto();
5245
+ this.photoIsReady(res);
5246
+ }
5247
+ else {
5248
+ this.eventTimeElapsed.emit();
5249
+ }
5244
5250
  await this.baseComponent.logStep(TranslationUtils.FlowSteps.CiBackCapture, TranslationUtils.FlowMoments.Finalized);
5245
5251
  }
5246
5252
  render() {
@@ -5311,7 +5317,7 @@ const IdCapture = class {
5311
5317
  navigator.mediaDevices
5312
5318
  .getUserMedia(constraints)
5313
5319
  .then(stream => {
5314
- const superStream = Stream.getInstance(VerificationMode.Full);
5320
+ const superStream = Stream.getNewInstance(VerificationMode.Full);
5315
5321
  superStream.initStream(stream);
5316
5322
  })
5317
5323
  .catch(e => {
@@ -5322,7 +5328,7 @@ const IdCapture = class {
5322
5328
  }
5323
5329
  closeCamera() {
5324
5330
  if (Stream.instance) {
5325
- Stream.getInstance(VerificationMode.Full).dropStream();
5331
+ Stream.instance.dropStream();
5326
5332
  }
5327
5333
  }
5328
5334
  disconnectedCallback() {
@@ -5335,8 +5341,13 @@ const IdCapture = class {
5335
5341
  if (this.captureTaken)
5336
5342
  return;
5337
5343
  this.captureTaken = true;
5338
- let res = await Stream.getInstance(VerificationMode.Full).takePhoto();
5339
- this.photoIsReady(res);
5344
+ if (Stream.instance) {
5345
+ let res = await Stream.instance.takePhoto();
5346
+ this.photoIsReady(res);
5347
+ }
5348
+ else {
5349
+ this.eventTimeElapsed.emit();
5350
+ }
5340
5351
  await this.baseComponent.logStep(TranslationUtils.FlowSteps.CiFrontCapture, TranslationUtils.FlowMoments.Finalized);
5341
5352
  }
5342
5353
  async verificationFinished() {
@@ -5349,7 +5360,7 @@ const IdCapture = class {
5349
5360
  var loops = 0;
5350
5361
  this.demoVideo.src = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_id.mp4';
5351
5362
  this.demoVideo.loop = false;
5352
- while (loops < 5) {
5363
+ while (loops < 7) {
5353
5364
  this.demoVideo.play();
5354
5365
  await delay(this.translations.GlobalValues.VideoLenght);
5355
5366
  }
@@ -5428,7 +5439,7 @@ const IdTilt = class {
5428
5439
  navigator.mediaDevices
5429
5440
  .getUserMedia(constraints)
5430
5441
  .then(stream => {
5431
- const superStream = Stream.getInstance(VerificationMode.Full);
5442
+ const superStream = Stream.getNewInstance(VerificationMode.Tilt);
5432
5443
  superStream.initStream(stream);
5433
5444
  })
5434
5445
  .catch(e => {
@@ -5439,7 +5450,7 @@ const IdTilt = class {
5439
5450
  }
5440
5451
  closeCamera() {
5441
5452
  if (Stream.instance) {
5442
- Stream.getInstance(VerificationMode.Full).dropStream();
5453
+ Stream.instance.dropStream();
5443
5454
  }
5444
5455
  }
5445
5456
  disconnectedCallback() {
@@ -5452,8 +5463,13 @@ const IdTilt = class {
5452
5463
  if (this.captureTaken)
5453
5464
  return;
5454
5465
  this.captureTaken = true;
5455
- let res = await Stream.getInstance(VerificationMode.Full).takePhoto();
5456
- this.photoIsReady(res);
5466
+ if (Stream.instance) {
5467
+ let res = await Stream.instance.takePhoto();
5468
+ this.photoIsReady(res);
5469
+ }
5470
+ else {
5471
+ this.eventTimeElapsed.emit();
5472
+ }
5457
5473
  await this.baseComponent.logStep(TranslationUtils.FlowSteps.CiTilt, TranslationUtils.FlowMoments.Finalized);
5458
5474
  }
5459
5475
  async verificationFinished() {
@@ -5466,7 +5482,7 @@ const IdTilt = class {
5466
5482
  var loops = 0;
5467
5483
  this.demoVideo.src = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_id.mp4';
5468
5484
  this.demoVideo.loop = false;
5469
- while (loops < 5) {
5485
+ while (loops < 7) {
5470
5486
  this.demoVideo.play();
5471
5487
  await delay(this.translations.GlobalValues.VideoLenght);
5472
5488
  }
@@ -5559,7 +5575,7 @@ function v4(options, buf, offset) {
5559
5575
  }
5560
5576
 
5561
5577
  const name = "@ekyc_qoobiss/qbs-ect-cmp";
5562
- const version$1 = "3.6.35";
5578
+ const version$1 = "3.6.37";
5563
5579
  const description = "Person Identification Component";
5564
5580
  const main = "./dist/index.cjs.js";
5565
5581
  const module$1 = "./dist/index.js";
@@ -8958,6 +8974,9 @@ const ProcessId = class {
8958
8974
  }
8959
8975
  componentWillLoad() {
8960
8976
  this.captureRetryCount = 0;
8977
+ this.initFlow();
8978
+ }
8979
+ initFlow() {
8961
8980
  this.flow = {
8962
8981
  front: {
8963
8982
  photoDone: false,
@@ -9059,11 +9078,11 @@ const ProcessId = class {
9059
9078
  let frontRec = new File([idRecording], this.flow.front.recName + mimeType.extension, { type: mimeType.type });
9060
9079
  this.flow.front.recordingDone = await this.uploadRecording(this.flow.front.recType, frontRec);
9061
9080
  }
9062
- else if (this.captureStep == IdCaptureFlowStatus.IdBack) {
9081
+ else if (this.flow.back && this.captureStep == IdCaptureFlowStatus.IdBack) {
9063
9082
  let backRec = new File([idRecording], this.flow.back.recName + mimeType.extension, { type: mimeType.type });
9064
9083
  this.flow.back.recordingDone = await this.uploadRecording(this.flow.back.recType, backRec);
9065
9084
  }
9066
- else if (this.captureStep == IdCaptureFlowStatus.Tilt) {
9085
+ else if (this.flow.tilt && this.captureStep == IdCaptureFlowStatus.Tilt) {
9067
9086
  let tiltRec = new File([idRecording], this.flow.tilt.recName + mimeType.extension, { type: mimeType.type });
9068
9087
  this.flow.tilt.recordingDone = await this.uploadRecording(this.flow.tilt.recType, tiltRec);
9069
9088
  }
@@ -9108,17 +9127,19 @@ const ProcessId = class {
9108
9127
  restart = true;
9109
9128
  }
9110
9129
  if (restart) {
9111
- this.captureStep = IdCaptureFlowStatus.IdFront;
9130
+ this.initFlow();
9131
+ this.showInvalid = true;
9132
+ return;
9112
9133
  }
9113
- if (this.captureStep == IdCaptureFlowStatus.IdFront || restart) {
9134
+ if (this.captureStep == IdCaptureFlowStatus.IdFront) {
9114
9135
  this.flow.front.photoDone = false;
9115
9136
  this.flow.front.recordingDone = false;
9116
9137
  }
9117
- if (this.captureStep == IdCaptureFlowStatus.IdBack || restart) {
9138
+ if (this.flow.back && this.captureStep == IdCaptureFlowStatus.IdBack) {
9118
9139
  this.flow.back.photoDone = false;
9119
9140
  this.flow.back.recordingDone = false;
9120
9141
  }
9121
- if (this.captureStep == IdCaptureFlowStatus.Tilt || restart) {
9142
+ if (this.flow.tilt && this.captureStep == IdCaptureFlowStatus.Tilt) {
9122
9143
  this.flow.tilt.photoDone = true;
9123
9144
  this.flow.tilt.recordingDone = false;
9124
9145
  }
@@ -9141,7 +9162,7 @@ const ProcessId = class {
9141
9162
  return;
9142
9163
  }
9143
9164
  }
9144
- if (this.captureStep == IdCaptureFlowStatus.IdBack && TranslationUtils.state.hasIdBack) {
9165
+ if (this.flow.back && this.captureStep == IdCaptureFlowStatus.IdBack && TranslationUtils.state.hasIdBack) {
9145
9166
  if (this.flow.back.photoDone && this.flow.back.recordingDone) {
9146
9167
  if (TranslationUtils.state.hasIdTilt) {
9147
9168
  this.captureStep = IdCaptureFlowStatus.Tilt;
@@ -9154,7 +9175,7 @@ const ProcessId = class {
9154
9175
  return;
9155
9176
  }
9156
9177
  }
9157
- if (this.captureStep == IdCaptureFlowStatus.Tilt && TranslationUtils.state.hasIdTilt) {
9178
+ if (this.flow.tilt && this.captureStep == IdCaptureFlowStatus.Tilt && TranslationUtils.state.hasIdTilt) {
9158
9179
  if (this.flow.tilt.photoDone && this.flow.tilt.recordingDone) {
9159
9180
  this.captureStep = IdCaptureFlowStatus.End;
9160
9181
  }
@@ -9267,7 +9288,7 @@ const SelfieCapture = class {
9267
9288
  navigator.mediaDevices
9268
9289
  .getUserMedia(constraints)
9269
9290
  .then(stream => {
9270
- const superStream = Stream.getInstance(VerificationMode.Full);
9291
+ const superStream = Stream.getNewInstance(VerificationMode.Full);
9271
9292
  superStream.initStream(stream);
9272
9293
  })
9273
9294
  .catch(e => {
@@ -9278,7 +9299,7 @@ const SelfieCapture = class {
9278
9299
  }
9279
9300
  closeCamera() {
9280
9301
  if (Stream.instance) {
9281
- Stream.getInstance(VerificationMode.Full).dropStream();
9302
+ Stream.instance.dropStream();
9282
9303
  }
9283
9304
  }
9284
9305
  disconnectedCallback() {
@@ -9290,8 +9311,13 @@ const SelfieCapture = class {
9290
9311
  if (this.captureTaken)
9291
9312
  return;
9292
9313
  this.captureTaken = true;
9293
- let res = await Stream.getInstance(VerificationMode.Full).takePhoto();
9294
- this.photoIsReady(res);
9314
+ if (Stream.instance) {
9315
+ let res = await Stream.instance.takePhoto();
9316
+ this.photoIsReady(res);
9317
+ }
9318
+ else {
9319
+ this.eventTimeElapsed.emit();
9320
+ }
9295
9321
  await this.baseComponent.logStep(TranslationUtils.FlowSteps.SelfieCapture, TranslationUtils.FlowMoments.Finalized);
9296
9322
  }
9297
9323
  async verificationFinished() {
@@ -9304,7 +9330,7 @@ const SelfieCapture = class {
9304
9330
  var loops = 0;
9305
9331
  this.demoVideo.src = this.uploadingLink;
9306
9332
  this.demoVideo.loop = false;
9307
- while (loops < 5) {
9333
+ while (loops < 7) {
9308
9334
  this.demoVideo.play();
9309
9335
  await delay(this.translations.GlobalValues.VideoLenght);
9310
9336
  }
@@ -9376,7 +9402,7 @@ const SelfieTilt = class {
9376
9402
  }
9377
9403
  }
9378
9404
  async componentDidLoad() {
9379
- this.mainStream = Stream.getInstance(VerificationMode.Tilt);
9405
+ this.mainStream = Stream.getNewInstance(VerificationMode.Tilt);
9380
9406
  await this.baseComponent.logStep(TranslationUtils.FlowSteps.SelfieTilt, TranslationUtils.FlowMoments.Initialized);
9381
9407
  this.titleMesage = this.translations.SelfieCaptureValues.FacePoseMapping[this.mainStream.facePose];
9382
9408
  this.demoEnded = false;
@@ -9416,7 +9442,7 @@ const SelfieTilt = class {
9416
9442
  this.captureTaken = true;
9417
9443
  let res = this.mainStream.takePhoto();
9418
9444
  this.photoIsReady(res);
9419
- await this.baseComponent.logStep(TranslationUtils.FlowSteps.SelfieCapture, TranslationUtils.FlowMoments.Finalized);
9445
+ await this.baseComponent.logStep(TranslationUtils.FlowSteps.SelfieTilt, TranslationUtils.FlowMoments.Finalized);
9420
9446
  }
9421
9447
  async verificationFinished() {
9422
9448
  if (this.verified)
@@ -9428,7 +9454,7 @@ const SelfieTilt = class {
9428
9454
  var loops = 0;
9429
9455
  this.demoVideo.src = this.uploadingLink;
9430
9456
  this.demoVideo.loop = false;
9431
- while (loops < 5) {
9457
+ while (loops < 7) {
9432
9458
  this.demoVideo.play();
9433
9459
  await delay(this.translations.GlobalValues.VideoLenght);
9434
9460
  }
@@ -62,7 +62,7 @@ export class IdBackCapture {
62
62
  navigator.mediaDevices
63
63
  .getUserMedia(constraints)
64
64
  .then(stream => {
65
- const superStream = Stream.getInstance(VerificationMode.Full);
65
+ const superStream = Stream.getNewInstance(VerificationMode.Full);
66
66
  superStream.initStream(stream);
67
67
  })
68
68
  .catch(e => {
@@ -73,7 +73,7 @@ export class IdBackCapture {
73
73
  }
74
74
  closeCamera() {
75
75
  if (Stream.instance) {
76
- Stream.getInstance(VerificationMode.Full).dropStream();
76
+ Stream.instance.dropStream();
77
77
  }
78
78
  }
79
79
  disconnectedCallback() {
@@ -92,7 +92,7 @@ export class IdBackCapture {
92
92
  var loops = 0;
93
93
  this.demoVideo.src = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_id.mp4';
94
94
  this.demoVideo.loop = false;
95
- while (loops < 5) {
95
+ while (loops < 7) {
96
96
  this.demoVideo.play();
97
97
  await delay(this.translations.GlobalValues.VideoLenght);
98
98
  }
@@ -102,8 +102,13 @@ export class IdBackCapture {
102
102
  if (this.captureTaken)
103
103
  return;
104
104
  this.captureTaken = true;
105
- let res = await Stream.getInstance(VerificationMode.Full).takePhoto();
106
- this.photoIsReady(res);
105
+ if (Stream.instance) {
106
+ let res = await Stream.instance.takePhoto();
107
+ this.photoIsReady(res);
108
+ }
109
+ else {
110
+ this.eventTimeElapsed.emit();
111
+ }
107
112
  await this.baseComponent.logStep(FlowSteps.CiBackCapture, FlowMoments.Finalized);
108
113
  }
109
114
  render() {
@@ -58,7 +58,7 @@ export class IdCapture {
58
58
  navigator.mediaDevices
59
59
  .getUserMedia(constraints)
60
60
  .then(stream => {
61
- const superStream = Stream.getInstance(VerificationMode.Full);
61
+ const superStream = Stream.getNewInstance(VerificationMode.Full);
62
62
  superStream.initStream(stream);
63
63
  })
64
64
  .catch(e => {
@@ -69,7 +69,7 @@ export class IdCapture {
69
69
  }
70
70
  closeCamera() {
71
71
  if (Stream.instance) {
72
- Stream.getInstance(VerificationMode.Full).dropStream();
72
+ Stream.instance.dropStream();
73
73
  }
74
74
  }
75
75
  disconnectedCallback() {
@@ -82,8 +82,13 @@ export class IdCapture {
82
82
  if (this.captureTaken)
83
83
  return;
84
84
  this.captureTaken = true;
85
- let res = await Stream.getInstance(VerificationMode.Full).takePhoto();
86
- this.photoIsReady(res);
85
+ if (Stream.instance) {
86
+ let res = await Stream.instance.takePhoto();
87
+ this.photoIsReady(res);
88
+ }
89
+ else {
90
+ this.eventTimeElapsed.emit();
91
+ }
87
92
  await this.baseComponent.logStep(FlowSteps.CiFrontCapture, FlowMoments.Finalized);
88
93
  }
89
94
  async verificationFinished() {
@@ -96,7 +101,7 @@ export class IdCapture {
96
101
  var loops = 0;
97
102
  this.demoVideo.src = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_id.mp4';
98
103
  this.demoVideo.loop = false;
99
- while (loops < 5) {
104
+ while (loops < 7) {
100
105
  this.demoVideo.play();
101
106
  await delay(this.translations.GlobalValues.VideoLenght);
102
107
  }
@@ -58,7 +58,7 @@ export class IdTilt {
58
58
  navigator.mediaDevices
59
59
  .getUserMedia(constraints)
60
60
  .then(stream => {
61
- const superStream = Stream.getInstance(VerificationMode.Full);
61
+ const superStream = Stream.getNewInstance(VerificationMode.Tilt);
62
62
  superStream.initStream(stream);
63
63
  })
64
64
  .catch(e => {
@@ -69,7 +69,7 @@ export class IdTilt {
69
69
  }
70
70
  closeCamera() {
71
71
  if (Stream.instance) {
72
- Stream.getInstance(VerificationMode.Full).dropStream();
72
+ Stream.instance.dropStream();
73
73
  }
74
74
  }
75
75
  disconnectedCallback() {
@@ -82,8 +82,13 @@ export class IdTilt {
82
82
  if (this.captureTaken)
83
83
  return;
84
84
  this.captureTaken = true;
85
- let res = await Stream.getInstance(VerificationMode.Full).takePhoto();
86
- this.photoIsReady(res);
85
+ if (Stream.instance) {
86
+ let res = await Stream.instance.takePhoto();
87
+ this.photoIsReady(res);
88
+ }
89
+ else {
90
+ this.eventTimeElapsed.emit();
91
+ }
87
92
  await this.baseComponent.logStep(FlowSteps.CiTilt, FlowMoments.Finalized);
88
93
  }
89
94
  async verificationFinished() {
@@ -96,7 +101,7 @@ export class IdTilt {
96
101
  var loops = 0;
97
102
  this.demoVideo.src = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_id.mp4';
98
103
  this.demoVideo.loop = false;
99
- while (loops < 5) {
104
+ while (loops < 7) {
100
105
  this.demoVideo.play();
101
106
  await delay(this.translations.GlobalValues.VideoLenght);
102
107
  }
@@ -62,7 +62,7 @@ export class SelfieCapture {
62
62
  navigator.mediaDevices
63
63
  .getUserMedia(constraints)
64
64
  .then(stream => {
65
- const superStream = Stream.getInstance(VerificationMode.Full);
65
+ const superStream = Stream.getNewInstance(VerificationMode.Full);
66
66
  superStream.initStream(stream);
67
67
  })
68
68
  .catch(e => {
@@ -73,7 +73,7 @@ export class SelfieCapture {
73
73
  }
74
74
  closeCamera() {
75
75
  if (Stream.instance) {
76
- Stream.getInstance(VerificationMode.Full).dropStream();
76
+ Stream.instance.dropStream();
77
77
  }
78
78
  }
79
79
  disconnectedCallback() {
@@ -85,8 +85,13 @@ export class SelfieCapture {
85
85
  if (this.captureTaken)
86
86
  return;
87
87
  this.captureTaken = true;
88
- let res = await Stream.getInstance(VerificationMode.Full).takePhoto();
89
- this.photoIsReady(res);
88
+ if (Stream.instance) {
89
+ let res = await Stream.instance.takePhoto();
90
+ this.photoIsReady(res);
91
+ }
92
+ else {
93
+ this.eventTimeElapsed.emit();
94
+ }
90
95
  await this.baseComponent.logStep(FlowSteps.SelfieCapture, FlowMoments.Finalized);
91
96
  }
92
97
  async verificationFinished() {
@@ -99,7 +104,7 @@ export class SelfieCapture {
99
104
  var loops = 0;
100
105
  this.demoVideo.src = this.uploadingLink;
101
106
  this.demoVideo.loop = false;
102
- while (loops < 5) {
107
+ while (loops < 7) {
103
108
  this.demoVideo.play();
104
109
  await delay(this.translations.GlobalValues.VideoLenght);
105
110
  }
@@ -48,7 +48,7 @@ export class SelfieTilt {
48
48
  }
49
49
  }
50
50
  async componentDidLoad() {
51
- this.mainStream = Stream.getInstance(VerificationMode.Tilt);
51
+ this.mainStream = Stream.getNewInstance(VerificationMode.Tilt);
52
52
  await this.baseComponent.logStep(FlowSteps.SelfieTilt, FlowMoments.Initialized);
53
53
  this.titleMesage = this.translations.SelfieCaptureValues.FacePoseMapping[this.mainStream.facePose];
54
54
  this.demoEnded = false;
@@ -88,7 +88,7 @@ export class SelfieTilt {
88
88
  this.captureTaken = true;
89
89
  let res = this.mainStream.takePhoto();
90
90
  this.photoIsReady(res);
91
- await this.baseComponent.logStep(FlowSteps.SelfieCapture, FlowMoments.Finalized);
91
+ await this.baseComponent.logStep(FlowSteps.SelfieTilt, FlowMoments.Finalized);
92
92
  }
93
93
  async verificationFinished() {
94
94
  if (this.verified)
@@ -100,7 +100,7 @@ export class SelfieTilt {
100
100
  var loops = 0;
101
101
  this.demoVideo.src = this.uploadingLink;
102
102
  this.demoVideo.loop = false;
103
- while (loops < 5) {
103
+ while (loops < 7) {
104
104
  this.demoVideo.play();
105
105
  await delay(this.translations.GlobalValues.VideoLenght);
106
106
  }
@@ -60,7 +60,7 @@ export class Camera {
60
60
  }
61
61
  startStream() {
62
62
  var captureMode = this.captureMode == 'tilt' ? VerificationMode.Tilt : VerificationMode.Full;
63
- const stream = Stream.getInstance(captureMode);
63
+ const stream = Stream.getNewInstance(captureMode);
64
64
  stream.updateHtmlElements(this.cameraVideo, this.cameraCanvas, this.component);
65
65
  if (this.captureMode == 'selfie') {
66
66
  stream.setFaceDetection(true);
@@ -19,6 +19,9 @@ export class ProcessId {
19
19
  }
20
20
  componentWillLoad() {
21
21
  this.captureRetryCount = 0;
22
+ this.initFlow();
23
+ }
24
+ initFlow() {
22
25
  this.flow = {
23
26
  front: {
24
27
  photoDone: false,
@@ -120,11 +123,11 @@ export class ProcessId {
120
123
  let frontRec = new File([idRecording], this.flow.front.recName + mimeType.extension, { type: mimeType.type });
121
124
  this.flow.front.recordingDone = await this.uploadRecording(this.flow.front.recType, frontRec);
122
125
  }
123
- else if (this.captureStep == IdCaptureFlowStatus.IdBack) {
126
+ else if (this.flow.back && this.captureStep == IdCaptureFlowStatus.IdBack) {
124
127
  let backRec = new File([idRecording], this.flow.back.recName + mimeType.extension, { type: mimeType.type });
125
128
  this.flow.back.recordingDone = await this.uploadRecording(this.flow.back.recType, backRec);
126
129
  }
127
- else if (this.captureStep == IdCaptureFlowStatus.Tilt) {
130
+ else if (this.flow.tilt && this.captureStep == IdCaptureFlowStatus.Tilt) {
128
131
  let tiltRec = new File([idRecording], this.flow.tilt.recName + mimeType.extension, { type: mimeType.type });
129
132
  this.flow.tilt.recordingDone = await this.uploadRecording(this.flow.tilt.recType, tiltRec);
130
133
  }
@@ -169,17 +172,19 @@ export class ProcessId {
169
172
  restart = true;
170
173
  }
171
174
  if (restart) {
172
- this.captureStep = IdCaptureFlowStatus.IdFront;
175
+ this.initFlow();
176
+ this.showInvalid = true;
177
+ return;
173
178
  }
174
- if (this.captureStep == IdCaptureFlowStatus.IdFront || restart) {
179
+ if (this.captureStep == IdCaptureFlowStatus.IdFront) {
175
180
  this.flow.front.photoDone = false;
176
181
  this.flow.front.recordingDone = false;
177
182
  }
178
- if (this.captureStep == IdCaptureFlowStatus.IdBack || restart) {
183
+ if (this.flow.back && this.captureStep == IdCaptureFlowStatus.IdBack) {
179
184
  this.flow.back.photoDone = false;
180
185
  this.flow.back.recordingDone = false;
181
186
  }
182
- if (this.captureStep == IdCaptureFlowStatus.Tilt || restart) {
187
+ if (this.flow.tilt && this.captureStep == IdCaptureFlowStatus.Tilt) {
183
188
  this.flow.tilt.photoDone = true;
184
189
  this.flow.tilt.recordingDone = false;
185
190
  }
@@ -202,7 +207,7 @@ export class ProcessId {
202
207
  return;
203
208
  }
204
209
  }
205
- if (this.captureStep == IdCaptureFlowStatus.IdBack && store.hasIdBack) {
210
+ if (this.flow.back && this.captureStep == IdCaptureFlowStatus.IdBack && store.hasIdBack) {
206
211
  if (this.flow.back.photoDone && this.flow.back.recordingDone) {
207
212
  if (store.hasIdTilt) {
208
213
  this.captureStep = IdCaptureFlowStatus.Tilt;
@@ -215,7 +220,7 @@ export class ProcessId {
215
220
  return;
216
221
  }
217
222
  }
218
- if (this.captureStep == IdCaptureFlowStatus.Tilt && store.hasIdTilt) {
223
+ if (this.flow.tilt && this.captureStep == IdCaptureFlowStatus.Tilt && store.hasIdTilt) {
219
224
  if (this.flow.tilt.photoDone && this.flow.tilt.recordingDone) {
220
225
  this.captureStep = IdCaptureFlowStatus.End;
221
226
  }
@@ -62,7 +62,7 @@ export class Stream {
62
62
  this.faceML5Detector = FaceML5Detector.getInstance(this, store.device.isMobile);
63
63
  this.verificationMode = mode;
64
64
  }
65
- static getInstance(mode) {
65
+ static getNewInstance(mode) {
66
66
  if (!Stream.instance) {
67
67
  Stream.instance = new Stream(mode);
68
68
  }
@@ -175,6 +175,7 @@ export class FaceML5Detector {
175
175
  if (this.stream.facePose !== null) {
176
176
  await delay(3000);
177
177
  this.validFacePose = true;
178
+ this.stream.autoCapturing();
178
179
  await this.drawFrame('green', true);
179
180
  }
180
181
  }