@ekyc_qoobiss/qbs-ect-cmp 4.7.21 → 4.7.22

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.
@@ -533,7 +533,7 @@ const IdAutoCapture = class {
533
533
  this.opencvReady = true;
534
534
  console.log('OpenCV.js loaded. Ready to start detection.');
535
535
  await this.getMedia(); // Get camera media once OpenCV is ready
536
- this.handleStartDetection(); // Start processing video frames
536
+ await this.handleStartDetection(); // Start processing video frames
537
537
  };
538
538
  // Method to start video recording
539
539
  this.startRecording = () => {
@@ -690,7 +690,7 @@ const IdAutoCapture = class {
690
690
  }
691
691
  };
692
692
  // Handler for starting the ID detection process
693
- this.handleStartDetection = () => {
693
+ this.handleStartDetection = async () => {
694
694
  if (!this.mediaStream) {
695
695
  console.log('Camera not ready. Please allow camera access.');
696
696
  return;
@@ -705,6 +705,18 @@ const IdAutoCapture = class {
705
705
  this.recordedChunks = []; // Clear previous video chunks
706
706
  this.recordedVideoUrl = null; // Clear previous video URL
707
707
  this.startRecording();
708
+ if (this.videoElement && this.videoElement.readyState < 3) {
709
+ // Use readyState 3 (HAVE_FUTURE_DATA) or 4 (HAVE_ENOUGH_DATA) for more robust readiness
710
+ console.log('Waiting for video stream to fully load...');
711
+ await new Promise(resolve => {
712
+ const onCanPlayThrough = () => {
713
+ this.videoElement.removeEventListener('canplaythrough', onCanPlayThrough);
714
+ resolve();
715
+ };
716
+ this.videoElement.addEventListener('canplaythrough', onCanPlayThrough);
717
+ });
718
+ console.log('Video stream ready. Starting detection.');
719
+ }
708
720
  this.startFrameProcessing(); // Start the OpenCV frame processing loop
709
721
  };
710
722
  this.verified = false;
@@ -778,7 +790,7 @@ const IdAutoCapture = class {
778
790
  if (TranslationUtils.state.device.isDesktop) {
779
791
  cameraVideoClass = 'cameraVideoSelfieDesk';
780
792
  }
781
- return (index.h("div", { key: '239110026f2b86b4d21a04571130d29d402f273b', class: "container flex center" }, index.h("div", { key: 'd3c882b832b541ac902f01ecd7a79c23e2b22eb1', class: "px-2 w-100" }, index.h("h1", { key: '38452a0b19aa389e83f1a0010d869c9f41cb20e1', class: this.titleStyle, innerHTML: this.titleMesage }), index.h("div", { key: '5f846e0c702d388cc04e3fc305d194bbcae78fdc', hidden: this.verified }, index.h("div", { key: '0201a63cd53a9c7299422486174413f6a15553f0', class: "w-100 h-100 rounded" }, index.h("div", { key: '67f8c00e0ede3cc836f57deb8a15449bc15538e8', class: "camera rounded" }, index.h("video", { key: 'bd20436cc64cd7e0da4b3aee7909906563ae1ce7', id: "video", loop: true, autoplay: true, playsinline: true, muted: true, class: cameraVideoClass, ref: el => (this.videoElement = el) }), index.h("canvas", { key: '9d2910bcc563d1a6df51ad4304efed898f89c4fa', id: "output", ref: el => (this.canvasElement = el), style: { display: 'none' } }), index.h("canvas", { key: '44df5c5e8da34e233deb782443d472536f65b2e7', id: "processingCanvasElement", ref: el => (this.processingCanvasElement = el), style: { display: 'none' } }), index.h("div", { key: '2a35a0c7778e62b36095d56bc715d612ca17c752', class: "id-guide-rectangle" }), this.isCapturing && index.h("div", { key: 'b28c98ed3da1dcf8902f42df3f5758aec5cc8b82', class: "capture-flash-overlay" }), this.countdown > 0 && (index.h("div", { key: 'eafcaa2fb46ba675fd4a600318dd5fe7ba95641e', class: "absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center" }, index.h("span", { key: '6df1640462fb3cd6eb4b17f8feb011d7bdeb35f4', class: "text-white text-9xl font-bold animate-bounce" }, this.countdown)))))), index.h("div", { key: '09ad24e2c403c44db82d2790a39311d1c9120031', class: "footer text-center" }, index.h("img", { key: '6532d116449468609ac82fb2b7ab429f074a3069', src: Cameras.logoOntraceSvg })))));
793
+ return (index.h("div", { key: '4bb0f88b1af2b60c0340d193e5b55b20216959f4', class: "container flex center" }, index.h("div", { key: '91edb8cd88cc514d356f6dbc33d42a0fd4c59403', class: "px-2 w-100" }, index.h("h1", { key: 'ddfd52905a3f4e57140a77eead1019d0a5f8fd8d', class: this.titleStyle, innerHTML: this.titleMesage }), index.h("div", { key: '11a1eba365aa8cac67127daf11c8773c9ebb18d7', hidden: this.verified }, index.h("div", { key: '710dbd4a39607139ef8f9b9bfaa6e8a753e7cb84', class: "w-100 h-100 rounded" }, index.h("div", { key: 'b48ac855f6ea3c2244160bc8c2c0ed76c0eaaea0', class: "camera rounded" }, index.h("video", { key: '688fa43c1a703449cafae6b1039768dc271b65aa', id: "video", loop: true, autoplay: true, playsinline: true, muted: true, class: cameraVideoClass, ref: el => (this.videoElement = el) }), index.h("canvas", { key: 'ed924ec293a47f69a1a61d3b3d5e745e92a5419b', id: "output", ref: el => (this.canvasElement = el), style: { display: 'none' } }), index.h("canvas", { key: 'f6807b2574c3e981f915228b45af3f8bd7ee5c9d', id: "processingCanvasElement", ref: el => (this.processingCanvasElement = el), style: { display: 'none' } }), index.h("div", { key: '812da2b6ad46757f8af703ec236996019f40480d', class: "id-guide-rectangle" }), this.isCapturing && index.h("div", { key: 'aa58dc533dac04f7917c2dba9626ff2213a298bc', class: "capture-flash-overlay" }), this.countdown > 0 && (index.h("div", { key: 'f0a3e788cc150037b2a9540f4656ba733f276bd5', class: "absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center" }, index.h("span", { key: '8c22c9ef5dd0763cc6b0fb967e25759ca6a0f8f0', class: "text-white text-9xl font-bold animate-bounce" }, this.countdown)))))), index.h("div", { key: '0b7ee521152325ef637809a009a5ad719ed4286e', class: "footer text-center" }, index.h("img", { key: 'bbd817f0b9460e4be2121501a1b87e8bbc15831a', src: Cameras.logoOntraceSvg })))));
782
794
  }
783
795
  get el() { return index.getElement(this); }
784
796
  };
@@ -843,7 +855,7 @@ const IdSelection = class {
843
855
  };
844
856
  IdSelection.style = idSelectionCss;
845
857
 
846
- const version$1 = "4.7.21";
858
+ const version$1 = "4.7.22";
847
859
  var packageJson = {
848
860
  version: version$1};
849
861