@ekyc_qoobiss/qbs-ect-cmp 3.6.38 → 3.6.40

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.
@@ -4520,24 +4520,12 @@ class Stream {
4520
4520
  this.idDetection = val;
4521
4521
  this.faceDetection = !val;
4522
4522
  }
4523
- // public setProbabilityThreshold(val: number): void {
4524
- // Detector.getInstance().setProbabilityThreshold(val);
4525
- // }
4526
- setCallbackChangeTitle(fun) {
4527
- this.callbackChangeTitle = fun;
4528
- }
4529
4523
  setCallbackVideoStarted(fun) {
4530
4524
  this.callbackVideoStarted = fun;
4531
4525
  }
4532
- setCallbackErrors(fun) {
4533
- this.callbackErrors = fun;
4534
- }
4535
4526
  setCallbackAutoCapturing(fun) {
4536
4527
  this.callbackAutoCapturing = fun;
4537
4528
  }
4538
- // public setCallbackFaceDetectionErrors(fun: (e: PipelineResult) => void): void {
4539
- // this.callbackFaceDetectionErrors = fun;
4540
- // }
4541
4529
  setCallbackRecordingReady(fun) {
4542
4530
  this.callbackRecordingReady = fun;
4543
4531
  }
@@ -4551,13 +4539,6 @@ class Stream {
4551
4539
  this.streamPaused = false;
4552
4540
  this.recordedChunks = [];
4553
4541
  this.videoSize = { width: 0, height: 0 };
4554
- this.pauseStream = () => {
4555
- this.streamPaused = true;
4556
- this.mediaRecorder.pause();
4557
- this.videoElement.pause();
4558
- // this.dropMask();
4559
- // if (this.faceDetection) Detector.getInstance().stopDetector();
4560
- };
4561
4542
  this.initFacePose();
4562
4543
  this.idML5Detector = IDML5Detector.getInstance(this, TranslationUtils.state.device.isMobile);
4563
4544
  this.faceML5Detector = FaceML5Detector.getInstance(this, TranslationUtils.state.device.isMobile);
@@ -4569,9 +4550,6 @@ class Stream {
4569
4550
  }
4570
4551
  return Stream.instance;
4571
4552
  }
4572
- // public returnErrors(errors: PipelineResult) {
4573
- // this.callbackFaceDetectionErrors(errors);
4574
- // }
4575
4553
  autoCapturing() {
4576
4554
  this.callbackAutoCapturing();
4577
4555
  }
@@ -4587,7 +4565,6 @@ class Stream {
4587
4565
  this.idML5Detector.updateHtmlElements(this.videoElement, this.canvasElement, component);
4588
4566
  this.faceML5Detector.updateHtmlElements(this.videoElement, this.canvasElement, component);
4589
4567
  }
4590
- static orientationChange() { }
4591
4568
  startStream(stream) {
4592
4569
  if (this.stream)
4593
4570
  this.stream.getTracks().forEach((track) => track.stop());
@@ -4619,13 +4596,6 @@ class Stream {
4619
4596
  this.startStream(stream);
4620
4597
  this.recordStream();
4621
4598
  }
4622
- async resumeStream() {
4623
- this.streamPaused = false;
4624
- this.mediaRecorder.resume();
4625
- await this.videoElement.play();
4626
- // this.drawMask();
4627
- // if (this.faceDetection) await Detector.getInstance().startDetector();
4628
- }
4629
4599
  recordStream() {
4630
4600
  if (this.mediaRecorder && this.mediaRecorder.state == 'recording')
4631
4601
  return;
@@ -4665,7 +4635,6 @@ class Stream {
4665
4635
  if (this.mediaRecorder && this.mediaRecorder.state != 'inactive') {
4666
4636
  this.mediaRecorder.stop();
4667
4637
  }
4668
- // if (this.faceDetection) Detector.getInstance().stopDetector();
4669
4638
  }
4670
4639
  streamStopped() {
4671
4640
  return !(this.stream && this.stream.getTracks && this.stream.getTracks().length > 0);
@@ -4688,15 +4657,13 @@ class Stream {
4688
4657
  }
4689
4658
  catch (e) {
4690
4659
  resolve(frame);
4691
- this.callbackErrors(e, false);
4660
+ this.timeElapsed();
4692
4661
  }
4693
4662
  }
4694
4663
  else {
4695
4664
  resolve(frame);
4696
4665
  }
4697
4666
  }, ImageFormat.PNG, 1);
4698
- //let outCanvContext = this.canvasElement.getContext('2d');
4699
- //outCanvContext.drawImage(this.videoElement, 0, 0, this.canvasElement.width, this.canvasElement.height);
4700
4667
  });
4701
4668
  }
4702
4669
  async startIdDetection() {
@@ -4712,22 +4679,9 @@ class Stream {
4712
4679
  initFacePose() {
4713
4680
  this.facePose = FacePosePick.randomEnum(FacePose);
4714
4681
  }
4715
- requestFacePose() {
4716
- // var pose = FacePose.TiltLeft;
4717
- this.callbackChangeTitle(this.facePose);
4718
- return this.facePose;
4719
- }
4720
- changeFacePose() {
4721
- this.callbackChangeTitle(null);
4722
- }
4723
- changeIDPose(pose) {
4724
- this.callbackChangeTitle(pose);
4725
- }
4726
4682
  }
4727
4683
  Stream.mp4MimeType = { type: 'video/mp4', codec: 'codecs:h264', extension: 'mp4', mime: 'video/mp4;codecs:h264' };
4728
- Stream.webmMimeType = { type: 'video/webm', codec: 'codecs=vp8', extension: 'webm', mime: 'video/webm;codecs=vp8' };
4729
- window.addEventListener('resize', Stream.orientationChange, false);
4730
- window.addEventListener('orientationchange', Stream.orientationChange, false);
4684
+ Stream.webmMimeType = { type: 'video/webm', codec: 'codecs=vp8', extension: 'webm', mime: 'video/webm;codecs=vp8' };
4731
4685
 
4732
4686
  const cameraCss = ".camera{width:100%;height:100%;color:white;display:flex;align-items:center;justify-content:center;position:relative}.cameraCanvas,.cameraCanvasSelfie,.cameraCanvasSelfieDesk{z-index:3;max-width:100%;max-height:100%;border-radius:10px}.cameraCanvasSelfie,.cameraCanvasSelfieDesk{transform:scale(-1, 1);-webkit-transform:scale(-1, 1)}.cameraVideo,.cameraVideoSelfie,.cameraVideoSelfieDesk{z-index:2;position:absolute;max-width:100%;max-height:100%;border-radius:10px}.cameraVideoSelfie,.cameraVideoSelfieDesk{transform:scale(-1, 1);-webkit-transform:scale(-1, 1)}.cameraMobile{position:fixed;top:0;left:0;background:black}";
4733
4687
 
@@ -4735,23 +4689,11 @@ const Camera = class {
4735
4689
  constructor(hostRef) {
4736
4690
  index.registerInstance(this, hostRef);
4737
4691
  this.eventVideoStarted = index.createEvent(this, "videoStarted", 7);
4738
- this.eventCloseCamera = index.createEvent(this, "closeCamera", 7);
4739
- this.errorCameraEvent = index.createEvent(this, "errorCamera", 7);
4740
4692
  this.eventTakePhoto = index.createEvent(this, "takePhoto", 7);
4741
4693
  this.eventRecordingSelfieReady = index.createEvent(this, "recordingSelfieCapture", 7);
4742
4694
  this.eventRecordingIdReady = index.createEvent(this, "recordingIdCapture", 7);
4743
4695
  this.eventTimeElapsed = index.createEvent(this, "timeElapsed", 7);
4744
- this.eventChangeTitle = index.createEvent(this, "changeTitle", 7);
4745
4696
  this.verificationFinished = index.createEvent(this, "verificationFinished", 7);
4746
- this.callbackErrors = (error, isError) => {
4747
- if (isError) {
4748
- this.errorCameraEvent.emit(error);
4749
- this.eventCloseCamera.emit();
4750
- }
4751
- else {
4752
- this.errorCameraEvent.emit(error);
4753
- }
4754
- };
4755
4697
  this.callbackAutoCapturing = () => {
4756
4698
  this.eventTakePhoto.emit();
4757
4699
  };
@@ -4767,9 +4709,6 @@ const Camera = class {
4767
4709
  this.callbackTimeElapsed = () => {
4768
4710
  this.eventTimeElapsed.emit();
4769
4711
  };
4770
- this.callbackChangeTitle = (message) => {
4771
- this.eventChangeTitle.emit(message);
4772
- };
4773
4712
  this.callbackVideoStarted = () => {
4774
4713
  this.eventVideoStarted.emit(this.component.getBoundingClientRect());
4775
4714
  };
@@ -4812,9 +4751,7 @@ const Camera = class {
4812
4751
  stream.setCallbackRecordingReady(this.callbackIdRecordingReady);
4813
4752
  // stream.setShowMask(false);
4814
4753
  }
4815
- stream.setCallbackErrors(this.callbackErrors);
4816
4754
  stream.setCallbackAutoCapturing(this.callbackAutoCapturing);
4817
- stream.setCallbackChangeTitle(this.callbackChangeTitle);
4818
4755
  stream.setCallbackVideoStarted(this.callbackVideoStarted);
4819
4756
  stream.setCallbackTimeElapsed(this.callbackTimeElapsed);
4820
4757
  stream.setVerificationFinished(this.callbackVerificationFinished);
@@ -5578,7 +5515,7 @@ function v4(options, buf, offset) {
5578
5515
  }
5579
5516
 
5580
5517
  const name = "@ekyc_qoobiss/qbs-ect-cmp";
5581
- const version$1 = "3.6.38";
5518
+ const version$1 = "3.6.40";
5582
5519
  const description = "Person Identification Component";
5583
5520
  const main = "./dist/index.cjs.js";
5584
5521
  const module$1 = "./dist/index.js";
@@ -9081,11 +9018,11 @@ const ProcessId = class {
9081
9018
  let frontRec = new File([idRecording], this.flow.front.recName + mimeType.extension, { type: mimeType.type });
9082
9019
  this.flow.front.recordingDone = await this.uploadRecording(this.flow.front.recType, frontRec);
9083
9020
  }
9084
- else if (this.flow.back && this.captureStep == IdCaptureFlowStatus.IdBack) {
9021
+ else if (this.captureStep == IdCaptureFlowStatus.IdBack) {
9085
9022
  let backRec = new File([idRecording], this.flow.back.recName + mimeType.extension, { type: mimeType.type });
9086
9023
  this.flow.back.recordingDone = await this.uploadRecording(this.flow.back.recType, backRec);
9087
9024
  }
9088
- else if (this.flow.tilt && this.captureStep == IdCaptureFlowStatus.Tilt) {
9025
+ else if (this.captureStep == IdCaptureFlowStatus.Tilt) {
9089
9026
  let tiltRec = new File([idRecording], this.flow.tilt.recName + mimeType.extension, { type: mimeType.type });
9090
9027
  this.flow.tilt.recordingDone = await this.uploadRecording(this.flow.tilt.recType, tiltRec);
9091
9028
  }
@@ -9138,11 +9075,11 @@ const ProcessId = class {
9138
9075
  this.flow.front.photoDone = false;
9139
9076
  this.flow.front.recordingDone = false;
9140
9077
  }
9141
- if (this.flow.back && this.captureStep == IdCaptureFlowStatus.IdBack) {
9078
+ if (this.captureStep == IdCaptureFlowStatus.IdBack) {
9142
9079
  this.flow.back.photoDone = false;
9143
9080
  this.flow.back.recordingDone = false;
9144
9081
  }
9145
- if (this.flow.tilt && this.captureStep == IdCaptureFlowStatus.Tilt) {
9082
+ if (this.captureStep == IdCaptureFlowStatus.Tilt) {
9146
9083
  this.flow.tilt.photoDone = true;
9147
9084
  this.flow.tilt.recordingDone = false;
9148
9085
  }
@@ -9165,7 +9102,7 @@ const ProcessId = class {
9165
9102
  return;
9166
9103
  }
9167
9104
  }
9168
- if (this.flow.back && this.captureStep == IdCaptureFlowStatus.IdBack && TranslationUtils.state.hasIdBack) {
9105
+ if (this.captureStep == IdCaptureFlowStatus.IdBack && TranslationUtils.state.hasIdBack) {
9169
9106
  if (this.flow.back.photoDone && this.flow.back.recordingDone) {
9170
9107
  if (TranslationUtils.state.hasIdTilt) {
9171
9108
  this.captureStep = IdCaptureFlowStatus.Tilt;
@@ -9178,7 +9115,7 @@ const ProcessId = class {
9178
9115
  return;
9179
9116
  }
9180
9117
  }
9181
- if (this.flow.tilt && this.captureStep == IdCaptureFlowStatus.Tilt && TranslationUtils.state.hasIdTilt) {
9118
+ if (this.captureStep == IdCaptureFlowStatus.Tilt && TranslationUtils.state.hasIdTilt) {
9182
9119
  if (this.flow.tilt.photoDone && this.flow.tilt.recordingDone) {
9183
9120
  this.captureStep = IdCaptureFlowStatus.End;
9184
9121
  }
@@ -9229,6 +9166,7 @@ const ProcessId = class {
9229
9166
  if (this.captureStep == IdCaptureFlowStatus.Tilt) {
9230
9167
  return tiltCapture;
9231
9168
  }
9169
+ return index.h("div", null);
9232
9170
  }
9233
9171
  };
9234
9172
  ProcessId.style = processIdCss;
@@ -9686,7 +9624,7 @@ const UserLiveness = class {
9686
9624
  else {
9687
9625
  this.triggerErrorFlow();
9688
9626
  }
9689
- await this.endFlow();
9627
+ this.endFlow();
9690
9628
  }
9691
9629
  catch (e) {
9692
9630
  if (this.recordingRetryCount < 3) {
@@ -9699,7 +9637,7 @@ const UserLiveness = class {
9699
9637
  }
9700
9638
  }
9701
9639
  async verificationFinished(_event) {
9702
- await this.endFlow();
9640
+ this.endFlow();
9703
9641
  }
9704
9642
  async disconnectedCallback() {
9705
9643
  await this.baseComponent.finalize();
@@ -9710,7 +9648,7 @@ const UserLiveness = class {
9710
9648
  }
9711
9649
  this.flow.front.photoDone = await this.baseComponent.apiCall.UploadFileForRequestB64(TranslationUtils.state.requestId, photoType, photoFile);
9712
9650
  if (this.flow.front.photoDone) {
9713
- await this.endFlow();
9651
+ this.endFlow();
9714
9652
  }
9715
9653
  else {
9716
9654
  this.triggerErrorFlow();
@@ -9729,7 +9667,7 @@ const UserLiveness = class {
9729
9667
  triggerErrorFlow() {
9730
9668
  this.showError = true;
9731
9669
  }
9732
- async endFlow() {
9670
+ endFlow() {
9733
9671
  if (this.captureStep == SelfieFlowStatus.Selfie) {
9734
9672
  if (this.flow.front.photoDone && this.flow.front.recordingDone) {
9735
9673
  if (TranslationUtils.state.hasSelfieGesture) {
@@ -9773,7 +9711,7 @@ const UserLiveness = class {
9773
9711
  if (this.captureStep == SelfieFlowStatus.Gesture) {
9774
9712
  return tilt;
9775
9713
  }
9776
- return capture;
9714
+ return index.h("div", null);
9777
9715
  }
9778
9716
  };
9779
9717
  UserLiveness.style = userLivenessCss;
@@ -5,15 +5,6 @@ import { VerificationMode } from '../../../models/IVerificationMode';
5
5
  // import { PipelineResult } from '../../../libs/FaceDetector/PipelineResult';
6
6
  export class Camera {
7
7
  constructor() {
8
- this.callbackErrors = (error, isError) => {
9
- if (isError) {
10
- this.errorCameraEvent.emit(error);
11
- this.eventCloseCamera.emit();
12
- }
13
- else {
14
- this.errorCameraEvent.emit(error);
15
- }
16
- };
17
8
  this.callbackAutoCapturing = () => {
18
9
  this.eventTakePhoto.emit();
19
10
  };
@@ -29,9 +20,6 @@ export class Camera {
29
20
  this.callbackTimeElapsed = () => {
30
21
  this.eventTimeElapsed.emit();
31
22
  };
32
- this.callbackChangeTitle = (message) => {
33
- this.eventChangeTitle.emit(message);
34
- };
35
23
  this.callbackVideoStarted = () => {
36
24
  this.eventVideoStarted.emit(this.component.getBoundingClientRect());
37
25
  };
@@ -74,9 +62,7 @@ export class Camera {
74
62
  stream.setCallbackRecordingReady(this.callbackIdRecordingReady);
75
63
  // stream.setShowMask(false);
76
64
  }
77
- stream.setCallbackErrors(this.callbackErrors);
78
65
  stream.setCallbackAutoCapturing(this.callbackAutoCapturing);
79
- stream.setCallbackChangeTitle(this.callbackChangeTitle);
80
66
  stream.setCallbackVideoStarted(this.callbackVideoStarted);
81
67
  stream.setCallbackTimeElapsed(this.callbackTimeElapsed);
82
68
  stream.setVerificationFinished(this.callbackVerificationFinished);
@@ -163,36 +149,6 @@ export class Camera {
163
149
  "resolved": "any",
164
150
  "references": {}
165
151
  }
166
- }, {
167
- "method": "eventCloseCamera",
168
- "name": "closeCamera",
169
- "bubbles": true,
170
- "cancelable": true,
171
- "composed": true,
172
- "docs": {
173
- "tags": [],
174
- "text": ""
175
- },
176
- "complexType": {
177
- "original": "any",
178
- "resolved": "any",
179
- "references": {}
180
- }
181
- }, {
182
- "method": "errorCameraEvent",
183
- "name": "errorCamera",
184
- "bubbles": true,
185
- "cancelable": true,
186
- "composed": true,
187
- "docs": {
188
- "tags": [],
189
- "text": ""
190
- },
191
- "complexType": {
192
- "original": "any",
193
- "resolved": "any",
194
- "references": {}
195
- }
196
152
  }, {
197
153
  "method": "eventTakePhoto",
198
154
  "name": "takePhoto",
@@ -253,21 +209,6 @@ export class Camera {
253
209
  "resolved": "any",
254
210
  "references": {}
255
211
  }
256
- }, {
257
- "method": "eventChangeTitle",
258
- "name": "changeTitle",
259
- "bubbles": true,
260
- "cancelable": true,
261
- "composed": true,
262
- "docs": {
263
- "tags": [],
264
- "text": ""
265
- },
266
- "complexType": {
267
- "original": "any",
268
- "resolved": "any",
269
- "references": {}
270
- }
271
212
  }, {
272
213
  "method": "verificationFinished",
273
214
  "name": "verificationFinished",
@@ -123,11 +123,11 @@ export class ProcessId {
123
123
  let frontRec = new File([idRecording], this.flow.front.recName + mimeType.extension, { type: mimeType.type });
124
124
  this.flow.front.recordingDone = await this.uploadRecording(this.flow.front.recType, frontRec);
125
125
  }
126
- else if (this.flow.back && this.captureStep == IdCaptureFlowStatus.IdBack) {
126
+ else if (this.captureStep == IdCaptureFlowStatus.IdBack) {
127
127
  let backRec = new File([idRecording], this.flow.back.recName + mimeType.extension, { type: mimeType.type });
128
128
  this.flow.back.recordingDone = await this.uploadRecording(this.flow.back.recType, backRec);
129
129
  }
130
- else if (this.flow.tilt && this.captureStep == IdCaptureFlowStatus.Tilt) {
130
+ else if (this.captureStep == IdCaptureFlowStatus.Tilt) {
131
131
  let tiltRec = new File([idRecording], this.flow.tilt.recName + mimeType.extension, { type: mimeType.type });
132
132
  this.flow.tilt.recordingDone = await this.uploadRecording(this.flow.tilt.recType, tiltRec);
133
133
  }
@@ -180,11 +180,11 @@ export class ProcessId {
180
180
  this.flow.front.photoDone = false;
181
181
  this.flow.front.recordingDone = false;
182
182
  }
183
- if (this.flow.back && this.captureStep == IdCaptureFlowStatus.IdBack) {
183
+ if (this.captureStep == IdCaptureFlowStatus.IdBack) {
184
184
  this.flow.back.photoDone = false;
185
185
  this.flow.back.recordingDone = false;
186
186
  }
187
- if (this.flow.tilt && this.captureStep == IdCaptureFlowStatus.Tilt) {
187
+ if (this.captureStep == IdCaptureFlowStatus.Tilt) {
188
188
  this.flow.tilt.photoDone = true;
189
189
  this.flow.tilt.recordingDone = false;
190
190
  }
@@ -207,7 +207,7 @@ export class ProcessId {
207
207
  return;
208
208
  }
209
209
  }
210
- if (this.flow.back && this.captureStep == IdCaptureFlowStatus.IdBack && store.hasIdBack) {
210
+ if (this.captureStep == IdCaptureFlowStatus.IdBack && store.hasIdBack) {
211
211
  if (this.flow.back.photoDone && this.flow.back.recordingDone) {
212
212
  if (store.hasIdTilt) {
213
213
  this.captureStep = IdCaptureFlowStatus.Tilt;
@@ -220,7 +220,7 @@ export class ProcessId {
220
220
  return;
221
221
  }
222
222
  }
223
- if (this.flow.tilt && this.captureStep == IdCaptureFlowStatus.Tilt && store.hasIdTilt) {
223
+ if (this.captureStep == IdCaptureFlowStatus.Tilt && store.hasIdTilt) {
224
224
  if (this.flow.tilt.photoDone && this.flow.tilt.recordingDone) {
225
225
  this.captureStep = IdCaptureFlowStatus.End;
226
226
  }
@@ -271,6 +271,7 @@ export class ProcessId {
271
271
  if (this.captureStep == IdCaptureFlowStatus.Tilt) {
272
272
  return tiltCapture;
273
273
  }
274
+ return h("div", null);
274
275
  }
275
276
  static get is() { return "process-id"; }
276
277
  static get originalStyleUrls() {
@@ -101,7 +101,7 @@ export class UserLiveness {
101
101
  else {
102
102
  this.triggerErrorFlow();
103
103
  }
104
- await this.endFlow();
104
+ this.endFlow();
105
105
  }
106
106
  catch (e) {
107
107
  if (this.recordingRetryCount < 3) {
@@ -114,7 +114,7 @@ export class UserLiveness {
114
114
  }
115
115
  }
116
116
  async verificationFinished(_event) {
117
- await this.endFlow();
117
+ this.endFlow();
118
118
  }
119
119
  async disconnectedCallback() {
120
120
  await this.baseComponent.finalize();
@@ -125,7 +125,7 @@ export class UserLiveness {
125
125
  }
126
126
  this.flow.front.photoDone = await this.baseComponent.apiCall.UploadFileForRequestB64(store.requestId, photoType, photoFile);
127
127
  if (this.flow.front.photoDone) {
128
- await this.endFlow();
128
+ this.endFlow();
129
129
  }
130
130
  else {
131
131
  this.triggerErrorFlow();
@@ -144,7 +144,7 @@ export class UserLiveness {
144
144
  triggerErrorFlow() {
145
145
  this.showError = true;
146
146
  }
147
- async endFlow() {
147
+ endFlow() {
148
148
  if (this.captureStep == SelfieFlowStatus.Selfie) {
149
149
  if (this.flow.front.photoDone && this.flow.front.recordingDone) {
150
150
  if (store.hasSelfieGesture) {
@@ -188,7 +188,7 @@ export class UserLiveness {
188
188
  if (this.captureStep == SelfieFlowStatus.Gesture) {
189
189
  return tilt;
190
190
  }
191
- return capture;
191
+ return h("div", null);
192
192
  }
193
193
  static get is() { return "user-liveness"; }
194
194
  static get originalStyleUrls() {
@@ -19,24 +19,12 @@ export class Stream {
19
19
  this.idDetection = val;
20
20
  this.faceDetection = !val;
21
21
  }
22
- // public setProbabilityThreshold(val: number): void {
23
- // Detector.getInstance().setProbabilityThreshold(val);
24
- // }
25
- setCallbackChangeTitle(fun) {
26
- this.callbackChangeTitle = fun;
27
- }
28
22
  setCallbackVideoStarted(fun) {
29
23
  this.callbackVideoStarted = fun;
30
24
  }
31
- setCallbackErrors(fun) {
32
- this.callbackErrors = fun;
33
- }
34
25
  setCallbackAutoCapturing(fun) {
35
26
  this.callbackAutoCapturing = fun;
36
27
  }
37
- // public setCallbackFaceDetectionErrors(fun: (e: PipelineResult) => void): void {
38
- // this.callbackFaceDetectionErrors = fun;
39
- // }
40
28
  setCallbackRecordingReady(fun) {
41
29
  this.callbackRecordingReady = fun;
42
30
  }
@@ -50,13 +38,6 @@ export class Stream {
50
38
  this.streamPaused = false;
51
39
  this.recordedChunks = [];
52
40
  this.videoSize = { width: 0, height: 0 };
53
- this.pauseStream = () => {
54
- this.streamPaused = true;
55
- this.mediaRecorder.pause();
56
- this.videoElement.pause();
57
- // this.dropMask();
58
- // if (this.faceDetection) Detector.getInstance().stopDetector();
59
- };
60
41
  this.initFacePose();
61
42
  this.idML5Detector = IDML5Detector.getInstance(this, store.device.isMobile);
62
43
  this.faceML5Detector = FaceML5Detector.getInstance(this, store.device.isMobile);
@@ -68,9 +49,6 @@ export class Stream {
68
49
  }
69
50
  return Stream.instance;
70
51
  }
71
- // public returnErrors(errors: PipelineResult) {
72
- // this.callbackFaceDetectionErrors(errors);
73
- // }
74
52
  autoCapturing() {
75
53
  this.callbackAutoCapturing();
76
54
  }
@@ -86,7 +64,6 @@ export class Stream {
86
64
  this.idML5Detector.updateHtmlElements(this.videoElement, this.canvasElement, component);
87
65
  this.faceML5Detector.updateHtmlElements(this.videoElement, this.canvasElement, component);
88
66
  }
89
- static orientationChange() { }
90
67
  startStream(stream) {
91
68
  if (this.stream)
92
69
  this.stream.getTracks().forEach((track) => track.stop());
@@ -118,13 +95,6 @@ export class Stream {
118
95
  this.startStream(stream);
119
96
  this.recordStream();
120
97
  }
121
- async resumeStream() {
122
- this.streamPaused = false;
123
- this.mediaRecorder.resume();
124
- await this.videoElement.play();
125
- // this.drawMask();
126
- // if (this.faceDetection) await Detector.getInstance().startDetector();
127
- }
128
98
  recordStream() {
129
99
  if (this.mediaRecorder && this.mediaRecorder.state == 'recording')
130
100
  return;
@@ -164,7 +134,6 @@ export class Stream {
164
134
  if (this.mediaRecorder && this.mediaRecorder.state != 'inactive') {
165
135
  this.mediaRecorder.stop();
166
136
  }
167
- // if (this.faceDetection) Detector.getInstance().stopDetector();
168
137
  }
169
138
  streamStopped() {
170
139
  return !(this.stream && this.stream.getTracks && this.stream.getTracks().length > 0);
@@ -187,15 +156,13 @@ export class Stream {
187
156
  }
188
157
  catch (e) {
189
158
  resolve(frame);
190
- this.callbackErrors(e, false);
159
+ this.timeElapsed();
191
160
  }
192
161
  }
193
162
  else {
194
163
  resolve(frame);
195
164
  }
196
165
  }, ImageFormat.PNG, 1);
197
- //let outCanvContext = this.canvasElement.getContext('2d');
198
- //outCanvContext.drawImage(this.videoElement, 0, 0, this.canvasElement.width, this.canvasElement.height);
199
166
  });
200
167
  }
201
168
  async startIdDetection() {
@@ -211,19 +178,6 @@ export class Stream {
211
178
  initFacePose() {
212
179
  this.facePose = FacePosePick.randomEnum(FacePose);
213
180
  }
214
- requestFacePose() {
215
- // var pose = FacePose.TiltLeft;
216
- this.callbackChangeTitle(this.facePose);
217
- return this.facePose;
218
- }
219
- changeFacePose() {
220
- this.callbackChangeTitle(null);
221
- }
222
- changeIDPose(pose) {
223
- this.callbackChangeTitle(pose);
224
- }
225
181
  }
226
182
  Stream.mp4MimeType = { type: 'video/mp4', codec: 'codecs:h264', extension: 'mp4', mime: 'video/mp4;codecs:h264' };
227
183
  Stream.webmMimeType = { type: 'video/webm', codec: 'codecs=vp8', extension: 'webm', mime: 'video/webm;codecs=vp8' };
228
- window.addEventListener('resize', Stream.orientationChange, false);
229
- window.addEventListener('orientationchange', Stream.orientationChange, false);