easyproctor 2.3.4 → 2.4.0

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.
package/index.js CHANGED
@@ -27643,6 +27643,35 @@ var getDefaultProctoringVideoOptions = {
27643
27643
  minHeight: 480
27644
27644
  };
27645
27645
 
27646
+ // src/utils/browserInformations.ts
27647
+ function fnBrowserDetect() {
27648
+ const userAgent = navigator.userAgent;
27649
+ let browserName;
27650
+ if (userAgent.match(/chrome|chromium|crios/i)) {
27651
+ browserName = "chrome";
27652
+ } else if (userAgent.match(/firefox|fxios/i)) {
27653
+ browserName = "firefox";
27654
+ } else if (userAgent.match(/safari/i)) {
27655
+ browserName = "safari";
27656
+ } else if (userAgent.match(/opr\//i)) {
27657
+ browserName = "opera";
27658
+ } else if (userAgent.match(/edg/i)) {
27659
+ browserName = "edge";
27660
+ } else {
27661
+ browserName = "No browser detection";
27662
+ }
27663
+ return browserName;
27664
+ }
27665
+ function isMobileDevice() {
27666
+ if ("userAgentData" in navigator) {
27667
+ const navUAData = navigator.userAgentData;
27668
+ const mobile = navUAData.mobile || false;
27669
+ const platform = navUAData.platform || "";
27670
+ return mobile || /Android|iOS/i.test(platform);
27671
+ }
27672
+ return /Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
27673
+ }
27674
+
27646
27675
  // src/plugins/insights.ts
27647
27676
  var backendService;
27648
27677
  var init = (backend) => {
@@ -28191,7 +28220,7 @@ var CameraRecorder = class {
28191
28220
  }
28192
28221
  }
28193
28222
  async startRecording(options) {
28194
- var _a2, _b, _c2, _d, _e3, _f, _g;
28223
+ var _a2, _b, _c2, _d, _e3, _f, _g, _h;
28195
28224
  if ((((_a2 = this.paramsConfig.videoBehaviourParameters) == null ? void 0 : _a2.detectPerson) || ((_b = this.paramsConfig.videoBehaviourParameters) == null ? void 0 : _b.detectCellPhone) || ((_c2 = this.paramsConfig.videoBehaviourParameters) == null ? void 0 : _c2.detectFace)) && !(options == null ? void 0 : options.retry)) {
28196
28225
  await this.initializeDetectors();
28197
28226
  }
@@ -28237,9 +28266,26 @@ var CameraRecorder = class {
28237
28266
  this.recordingStart();
28238
28267
  const tracks = this.cameraStream.getVideoTracks();
28239
28268
  const settings = tracks[0].getSettings();
28240
- if (this.videoOptions.minWidth > settings.width || this.videoOptions.minHeight > settings.height) {
28269
+ let { width = 0, height = 0 } = settings;
28270
+ const isPortrait = (_d = screen.orientation) == null ? void 0 : _d.type.includes("portrait");
28271
+ if (isPortrait && isMobileDevice()) {
28272
+ if (this.videoOptions.width == height && this.videoOptions.height == width) {
28273
+ [width, height] = [height, width];
28274
+ }
28275
+ }
28276
+ console.log("isPortrait -> ", isPortrait);
28277
+ console.log("this.isMobileDevice() -> ", isMobileDevice());
28278
+ console.log("width -> ", width);
28279
+ console.log("height -> ", height);
28280
+ console.log("minWidth -> ", this.videoOptions.minWidth);
28281
+ console.log("minHeight -> ", this.videoOptions.minHeight);
28282
+ console.log("this.videoOptions.width -> ", this.videoOptions.width);
28283
+ console.log("this.videoOptions.height -> ", this.videoOptions.height);
28284
+ console.log("settings.width -> ", settings.width);
28285
+ console.log("settings.height -> ", settings.height);
28286
+ if (this.videoOptions.minWidth > width || this.videoOptions.minHeight > height) {
28241
28287
  throw STREAM_UNDER_MINIMUM_PERMITTED;
28242
- } else if (this.videoOptions.width !== settings.width || this.videoOptions.height !== settings.height) {
28288
+ } else if (this.videoOptions.width !== width || this.videoOptions.height !== height) {
28243
28289
  trackers.registerAnotherStream(
28244
28290
  this.proctoringId,
28245
28291
  `Maybe have another stream active
@@ -28252,11 +28298,11 @@ Setting: ${JSON.stringify(settings, null, 2)}`
28252
28298
  );
28253
28299
  throw ANOTHER_STREAM_ACTIVE;
28254
28300
  }
28255
- ((_d = this.paramsConfig.imageBehaviourParameters) == null ? void 0 : _d.useUploadImage) && this.options.proctoringType == "IMAGE" && this.photoShotsCycle();
28256
- if ((_e3 = this.paramsConfig.videoBehaviourParameters) == null ? void 0 : _e3.detectFace) {
28301
+ ((_e3 = this.paramsConfig.imageBehaviourParameters) == null ? void 0 : _e3.useUploadImage) && this.options.proctoringType == "IMAGE" && this.photoShotsCycle();
28302
+ if ((_f = this.paramsConfig.videoBehaviourParameters) == null ? void 0 : _f.detectFace) {
28257
28303
  await this.faceDetection.enableCam(this.cameraStream);
28258
28304
  }
28259
- if (((_f = this.paramsConfig.videoBehaviourParameters) == null ? void 0 : _f.detectPerson) || ((_g = this.paramsConfig.videoBehaviourParameters) == null ? void 0 : _g.detectCellPhone)) {
28305
+ if (((_g = this.paramsConfig.videoBehaviourParameters) == null ? void 0 : _g.detectPerson) || ((_h = this.paramsConfig.videoBehaviourParameters) == null ? void 0 : _h.detectCellPhone)) {
28260
28306
  await this.objectDetection.enableCam(this.cameraStream);
28261
28307
  }
28262
28308
  this.filesToUpload = [];
@@ -28494,11 +28540,17 @@ var DeviceCheckerUI = class {
28494
28540
  display: inline-block;
28495
28541
  width: 22px;
28496
28542
  height: 22px;
28543
+ min-width: 22px;
28544
+ max-width: 22px;
28545
+ min-height: 22px;
28546
+ max-height: 22px;
28547
+ flex-shrink: 0;
28497
28548
  -ms-transform: rotate(45deg); /* IE 9 */
28498
28549
  -webkit-transform: rotate(45deg); /* Chrome, Safari, Opera */
28499
28550
  transform: rotate(45deg);
28500
28551
  border: 1px solid #16A34A;
28501
28552
  border-radius: 22px;
28553
+ box-sizing: border-box;
28502
28554
  }
28503
28555
 
28504
28556
  .checkmark_stem {
@@ -28523,11 +28575,17 @@ var DeviceCheckerUI = class {
28523
28575
  display: inline-block;
28524
28576
  width: 22px;
28525
28577
  height: 22px;
28578
+ min-width: 22px;
28579
+ max-width: 22px;
28580
+ min-height: 22px;
28581
+ max-height: 22px;
28582
+ flex-shrink: 0;
28526
28583
  -ms-transform: rotate(45deg); /* IE 9 */
28527
28584
  -webkit-transform: rotate(45deg); /* Chrome, Safari, Opera */
28528
28585
  transform: rotate(45deg);
28529
28586
  border: 1px solid #FF0000;
28530
28587
  border-radius: 22px;
28588
+ box-sizing: border-box;
28531
28589
  }
28532
28590
 
28533
28591
  .checkmark_stem_error {
@@ -28578,6 +28636,179 @@ var DeviceCheckerUI = class {
28578
28636
  left: 5px;
28579
28637
  top: 2px;
28580
28638
  }
28639
+
28640
+ /* Responsive styles */
28641
+ #checkDevices .modal-responsive {
28642
+ box-sizing: border-box !important;
28643
+ }
28644
+
28645
+ #checkDevices .modal-responsive * {
28646
+ box-sizing: border-box;
28647
+ }
28648
+
28649
+ /* Desktop screens - maintain gap between checks and camera */
28650
+ @media (min-width: 769px) {
28651
+ #checkDevices .modal-responsive .camera-container-responsive {
28652
+ gap: 20px !important;
28653
+ }
28654
+ }
28655
+
28656
+ @media (max-width: 768px) {
28657
+ #checkDevices .modal-responsive {
28658
+ width: 95% !important;
28659
+ max-width: 95% !important;
28660
+ margin: 10px !important;
28661
+ }
28662
+
28663
+ #checkDevices .modal-responsive h3 {
28664
+ font-size: 18px !important;
28665
+ padding: 15px 0px !important;
28666
+ }
28667
+
28668
+ #checkDevices .modal-responsive .camera-header-responsive,
28669
+ #checkDevices .modal-responsive .mic-header-responsive {
28670
+ flex-direction: column !important;
28671
+ gap: 10px !important;
28672
+ align-items: flex-start !important;
28673
+ }
28674
+
28675
+ #checkDevices .modal-responsive .camera-header-responsive select,
28676
+ #checkDevices .modal-responsive .mic-header-responsive select {
28677
+ max-width: 100% !important;
28678
+ width: 100% !important;
28679
+ }
28680
+
28681
+ #checkDevices .modal-responsive .camera-container-responsive {
28682
+ flex-direction: row !important;
28683
+ align-items: flex-start !important;
28684
+ gap: 15px !important;
28685
+ padding-left: 10px !important;
28686
+ padding-right: 10px !important;
28687
+ }
28688
+
28689
+ #checkDevices .modal-responsive .video-responsive {
28690
+ width: auto !important;
28691
+ max-width: 320px !important;
28692
+ flex-shrink: 0 !important;
28693
+ max-height: 240px !important;
28694
+ }
28695
+
28696
+ #checkDevices .modal-responsive .video-responsive video {
28697
+ width: 100% !important;
28698
+ max-width: 320px !important;
28699
+ max-height: 200px !important;
28700
+ height: auto !important;
28701
+ object-fit: contain !important;
28702
+ }
28703
+
28704
+ #checkDevices .modal-responsive .mic-container-responsive {
28705
+ flex-direction: column !important;
28706
+ padding: 0px 20px !important;
28707
+ }
28708
+
28709
+ #checkDevices .modal-responsive .mic-meter-responsive {
28710
+ width: 100% !important;
28711
+ }
28712
+
28713
+ #checkDevices .modal-responsive .range-responsive {
28714
+ width: 100% !important;
28715
+ }
28716
+
28717
+ #checkDevices .modal-responsive .pronounce-responsive {
28718
+ margin-left: 10px !important;
28719
+ margin-right: 10px !important;
28720
+ width: calc(100% - 20px) !important;
28721
+ }
28722
+
28723
+ #checkDevices .modal-responsive .button-responsive {
28724
+ height: 60px !important;
28725
+ font-size: 14px !important;
28726
+ }
28727
+
28728
+ #checkDevices .modal-responsive .divider-responsive {
28729
+ height: 60px !important;
28730
+ }
28731
+ }
28732
+
28733
+ @media (max-width: 480px) {
28734
+ #checkDevices .modal-responsive {
28735
+ width: 98% !important;
28736
+ max-width: 98% !important;
28737
+ border-radius: 8px !important;
28738
+ margin: 5px !important;
28739
+ }
28740
+
28741
+ #checkDevices .modal-responsive .camera-header-responsive,
28742
+ #checkDevices .modal-responsive .mic-header-responsive {
28743
+ gap: 0px !important;
28744
+ }
28745
+
28746
+ #checkDevices .modal-responsive .camera-header-responsive h3,
28747
+ #checkDevices .modal-responsive .mic-header-responsive h3 {
28748
+ margin: 0 !important;
28749
+ margin-top: 0 !important;
28750
+ margin-bottom: 0 !important;
28751
+ margin-left: 0 !important;
28752
+ margin-right: 0 !important;
28753
+ padding: 0 !important;
28754
+ padding-top: 0 !important;
28755
+ padding-bottom: 0 !important;
28756
+ }
28757
+
28758
+ #checkDevices .modal-responsive .camera-header-responsive select,
28759
+ #checkDevices .modal-responsive .mic-header-responsive select {
28760
+ margin: 0 !important;
28761
+ margin-top: 0 !important;
28762
+ margin-bottom: 0 !important;
28763
+ margin-left: 0 !important;
28764
+ margin-right: 0 !important;
28765
+ padding-top: 0 !important;
28766
+ }
28767
+
28768
+ #checkDevices .modal-responsive .camera-container-responsive {
28769
+ flex-direction: row !important;
28770
+ gap: 10px !important;
28771
+ padding-left: 5px !important;
28772
+ padding-right: 5px !important;
28773
+ }
28774
+
28775
+ #checkDevices .modal-responsive .video-responsive {
28776
+ max-width: 200px !important;
28777
+ max-height: 150px !important;
28778
+ }
28779
+
28780
+ #checkDevices .modal-responsive .video-responsive video {
28781
+ max-width: 200px !important;
28782
+ max-height: 150px !important;
28783
+ }
28784
+
28785
+ #checkDevices .modal-responsive .pronounce-responsive {
28786
+ margin-left: 5px !important;
28787
+ margin-right: 5px !important;
28788
+ width: calc(100% - 10px) !important;
28789
+ padding: 0 5px !important;
28790
+ }
28791
+
28792
+ #checkDevices .modal-responsive h3 {
28793
+ font-size: 16px !important;
28794
+ padding: 12px 0px !important;
28795
+ margin-bottom: 10px !important;
28796
+ }
28797
+
28798
+ #checkDevices .modal-responsive .camera-header-responsive h3,
28799
+ #checkDevices .modal-responsive .mic-header-responsive h3 {
28800
+ font-size: 14px !important;
28801
+ }
28802
+
28803
+ #checkDevices .modal-responsive .button-responsive {
28804
+ height: 50px !important;
28805
+ font-size: 13px !important;
28806
+ }
28807
+
28808
+ #checkDevices .modal-responsive .divider-responsive {
28809
+ height: 50px !important;
28810
+ }
28811
+ }
28581
28812
  `;
28582
28813
  document.getElementsByTagName("head")[0].appendChild(style);
28583
28814
  const fullBg = document.createElement("div");
@@ -28590,24 +28821,31 @@ var DeviceCheckerUI = class {
28590
28821
  left: "0",
28591
28822
  height: "100vh",
28592
28823
  width: "100%",
28824
+ maxWidth: "100vw",
28593
28825
  display: "flex",
28594
28826
  alignItems: "center",
28595
- justifyContent: "center"
28827
+ justifyContent: "center",
28828
+ overflow: "auto",
28829
+ boxSizing: "border-box"
28596
28830
  };
28597
28831
  this.applyStyles(fullBg, fullBgStyles);
28598
28832
  const modal = document.createElement("div");
28833
+ modal.setAttribute("class", "modal-responsive");
28599
28834
  const modalStyles = {
28600
28835
  backgroundColor: "#fff",
28601
28836
  zIndex: "1001",
28602
- width: "600px",
28837
+ width: "90%",
28838
+ maxWidth: "600px",
28603
28839
  borderRadius: "10px",
28604
28840
  display: "flex",
28605
28841
  flexDirection: "column",
28606
- alignItems: "center"
28842
+ alignItems: "center",
28843
+ boxSizing: "border-box",
28844
+ overflow: "hidden"
28607
28845
  };
28608
28846
  this.applyStyles(modal, modalStyles);
28609
28847
  const h3 = document.createElement("h3");
28610
- h3.innerText = "Para iniciar configure a c\xE2mera e o microfone";
28848
+ h3.innerText = "Checagem de dispositivos";
28611
28849
  const h3Styles = {
28612
28850
  color: "rgba(0, 0, 0, .7)",
28613
28851
  fontWeight: "bold",
@@ -28621,6 +28859,7 @@ var DeviceCheckerUI = class {
28621
28859
  this.applyStyles(h3, h3Styles);
28622
28860
  modal.appendChild(h3);
28623
28861
  const divCameraHeader = document.createElement("div");
28862
+ divCameraHeader.setAttribute("class", "camera-header-responsive");
28624
28863
  const h3Camera = document.createElement("h3");
28625
28864
  const selectCamera = document.createElement("select");
28626
28865
  selectCamera.setAttribute("id", "cameraSelect");
@@ -28640,33 +28879,46 @@ var DeviceCheckerUI = class {
28640
28879
  };
28641
28880
  this.applyStyles(h3Camera, h3CameraStyles);
28642
28881
  selectCamera.style.maxWidth = "400px";
28882
+ selectCamera.style.minWidth = "150px";
28883
+ selectCamera.style.width = "100%";
28884
+ selectCamera.style.boxSizing = "border-box";
28643
28885
  divCameraHeader.appendChild(h3Camera);
28644
28886
  divCameraHeader.appendChild(selectCamera);
28645
28887
  modal.appendChild(divCameraHeader);
28646
28888
  const divCamera = document.createElement("div");
28647
28889
  divCamera.setAttribute("id", "liveCheckDevices");
28890
+ divCamera.setAttribute("class", "camera-container-responsive");
28648
28891
  const videoDiv = document.createElement("div");
28892
+ videoDiv.setAttribute("class", "video-responsive");
28649
28893
  const video = document.createElement("video");
28650
28894
  const center = document.createElement("div");
28651
28895
  video.setAttribute("id", "cameraStream");
28652
28896
  video.muted = true;
28653
28897
  const divCameraStyles = {
28654
- width: "calc(100% - 40px)",
28898
+ width: "100%",
28655
28899
  display: "flex",
28656
28900
  justifyContent: "space-between",
28901
+ gap: "20px",
28657
28902
  borderBottom: "2px solid rgba(0, 0, 0, .1)",
28658
28903
  paddingBottom: "15px",
28904
+ paddingLeft: "20px",
28905
+ paddingRight: "20px",
28906
+ boxSizing: "border-box",
28659
28907
  transform: "rotateY(180deg)"
28660
28908
  };
28661
28909
  this.applyStyles(divCamera, divCameraStyles);
28662
28910
  const videoStyles = {
28663
- width: "20rem",
28911
+ width: "100%",
28912
+ maxWidth: "320px",
28913
+ height: "auto",
28914
+ maxHeight: "240px",
28915
+ objectFit: "contain",
28664
28916
  backgroundColor: "#000",
28665
28917
  borderRadius: "10px",
28666
28918
  marginBottom: "15px"
28667
28919
  };
28668
28920
  this.applyStyles(video, videoStyles);
28669
- this.applyStyles(videoDiv, { position: "relative" });
28921
+ this.applyStyles(videoDiv, { position: "relative", width: "100%", maxWidth: "320px", maxHeight: "240px", boxSizing: "border-box" });
28670
28922
  const alertDivResolution = document.createElement("div");
28671
28923
  alertDivResolution.setAttribute("class", "alert-div");
28672
28924
  alertDivResolution.setAttribute("id", "alertDivResolution");
@@ -28760,12 +29012,17 @@ var DeviceCheckerUI = class {
28760
29012
  alertDivSpyCam.appendChild(checkmark_SpyCam);
28761
29013
  alertDivSpyCam.appendChild(SpyCamAlert);
28762
29014
  center.style.transform = "rotateY(180deg)";
29015
+ center.style.display = "flex";
29016
+ center.style.flexDirection = "column";
29017
+ center.style.flex = "1";
29018
+ center.style.minWidth = "0";
28763
29019
  center.appendChild(alertDivResolution);
28764
29020
  center.appendChild(alertDivFacePosition);
28765
29021
  center.appendChild(alertDivAmbientVerify);
28766
29022
  center.appendChild(alertDivSpyCam);
28767
29023
  divCamera.appendChild(center);
28768
29024
  videoDiv.appendChild(video);
29025
+ videoDiv.style.flexShrink = "0";
28769
29026
  divCamera.appendChild(videoDiv);
28770
29027
  const mask = document.createElement("div");
28771
29028
  mask.setAttribute("class", "facial-biometry__mask");
@@ -28788,6 +29045,7 @@ var DeviceCheckerUI = class {
28788
29045
  videoDiv.appendChild(frame);
28789
29046
  modal.appendChild(divCamera);
28790
29047
  const divMicHeader = document.createElement("div");
29048
+ divMicHeader.setAttribute("class", "mic-header-responsive");
28791
29049
  const h3Mic = document.createElement("h3");
28792
29050
  const selectMic = document.createElement("select");
28793
29051
  selectMic.setAttribute("id", "micSelect");
@@ -28807,18 +29065,24 @@ var DeviceCheckerUI = class {
28807
29065
  };
28808
29066
  this.applyStyles(h3Mic, h3MicStyles);
28809
29067
  selectMic.style.maxWidth = "400px";
29068
+ selectMic.style.minWidth = "150px";
29069
+ selectMic.style.width = "100%";
29070
+ selectMic.style.boxSizing = "border-box";
28810
29071
  divMicHeader.appendChild(h3Mic);
28811
29072
  divMicHeader.appendChild(selectMic);
28812
29073
  modal.appendChild(divMicHeader);
28813
29074
  const divMic = document.createElement("div");
29075
+ divMic.setAttribute("class", "mic-container-responsive");
28814
29076
  const divMicStyles = {
28815
29077
  width: "100%",
28816
- padding: "0px 40px",
28817
- display: "flex"
29078
+ padding: "0px 20px",
29079
+ display: "flex",
29080
+ boxSizing: "border-box"
28818
29081
  // justifyContent: "space-between",
28819
29082
  };
28820
29083
  this.applyStyles(divMic, divMicStyles);
28821
29084
  const divMicMeter = document.createElement("div");
29085
+ divMicMeter.setAttribute("class", "mic-meter-responsive");
28822
29086
  const divMicMeterStyles = {
28823
29087
  // width: "calc(100% - 40px)",
28824
29088
  display: "flex",
@@ -28847,13 +29111,16 @@ var DeviceCheckerUI = class {
28847
29111
  divMeter.appendChild(pill);
28848
29112
  }
28849
29113
  const divRange = document.createElement("div");
29114
+ divRange.setAttribute("class", "range-responsive");
28850
29115
  const pRange0 = document.createElement("p");
28851
29116
  const pRange50 = document.createElement("p");
28852
29117
  const pRange100 = document.createElement("p");
28853
29118
  const divRangeStyles = {
28854
- width: "250px",
29119
+ width: "100%",
29120
+ maxWidth: "250px",
28855
29121
  display: "flex",
28856
- justifyContent: "space-between"
29122
+ justifyContent: "space-between",
29123
+ boxSizing: "border-box"
28857
29124
  };
28858
29125
  this.applyStyles(divRange, divRangeStyles);
28859
29126
  pRange0.innerText = "0";
@@ -28866,10 +29133,10 @@ var DeviceCheckerUI = class {
28866
29133
  alertDivMicrophone.setAttribute("class", "alert-div");
28867
29134
  alertDivMicrophone.setAttribute("id", "alertDivMicrophone");
28868
29135
  const alertDivMicrophoneStyles = {
28869
- // display: "flex",
28870
- alignItems: "start",
28871
- justifyContent: "end",
28872
- width: "inherit"
29136
+ display: "flex",
29137
+ alignItems: "center",
29138
+ justifyContent: "center",
29139
+ width: "100%"
28873
29140
  };
28874
29141
  this.applyStyles(alertDivMicrophone, alertDivMicrophoneStyles);
28875
29142
  const microphoneAlert = document.createElement("error");
@@ -28889,12 +29156,16 @@ var DeviceCheckerUI = class {
28889
29156
  divMicMeter.appendChild(divMeter);
28890
29157
  divMicMeter.appendChild(divRange);
28891
29158
  const pronunceMic = document.createElement("p");
28892
- pronunceMic.innerText = 'Pronuncie em voz alta: "um, dois, tr\xEAs, quatro".';
29159
+ pronunceMic.setAttribute("class", "pronounce-responsive");
29160
+ pronunceMic.innerText = 'Pronuncie em voz alta: "Testando..."';
28893
29161
  pronunceMic.style.textAlign = "start";
28894
29162
  const pronunceMicStyles = {
28895
- width: "100%",
28896
- marginLeft: "40px",
28897
- marginBottom: "15px"
29163
+ width: "calc(100% - 40px)",
29164
+ marginLeft: "20px",
29165
+ marginRight: "20px",
29166
+ marginBottom: "15px",
29167
+ boxSizing: "border-box",
29168
+ padding: "0 10px"
28898
29169
  };
28899
29170
  this.applyStyles(pronunceMic, pronunceMicStyles);
28900
29171
  divMic.appendChild(divMicMeter);
@@ -28907,11 +29178,13 @@ var DeviceCheckerUI = class {
28907
29178
  display: "flex",
28908
29179
  alignItems: "center",
28909
29180
  justifyContent: "center",
28910
- borderTop: "2px solid rgba(0, 0, 0, .1)"
29181
+ borderTop: "2px solid rgba(0, 0, 0, .1)",
29182
+ boxSizing: "border-box"
28911
29183
  };
28912
29184
  this.applyStyles(divBtn, divBtnStyles);
28913
29185
  const buttonCancel = document.createElement("button");
28914
29186
  buttonCancel.setAttribute("id", "cancelBtn");
29187
+ buttonCancel.setAttribute("class", "button-responsive");
28915
29188
  buttonCancel.innerText = "Cancelar";
28916
29189
  const buttonCancelStyles = {
28917
29190
  width: "100%",
@@ -28926,6 +29199,7 @@ var DeviceCheckerUI = class {
28926
29199
  };
28927
29200
  this.applyStyles(buttonCancel, buttonCancelStyles);
28928
29201
  const divider = document.createElement("span");
29202
+ divider.setAttribute("class", "divider-responsive");
28929
29203
  const dividerStyles = {
28930
29204
  width: "3px",
28931
29205
  height: "70px",
@@ -28936,6 +29210,7 @@ var DeviceCheckerUI = class {
28936
29210
  const button = document.createElement("button");
28937
29211
  button.innerText = "Continuar";
28938
29212
  button.setAttribute("id", "confirmBtn");
29213
+ button.setAttribute("class", "button-responsive");
28939
29214
  const buttonStyles = {
28940
29215
  width: "100%",
28941
29216
  height: "70px",
@@ -29260,6 +29535,7 @@ Para iniciar um exame utilize uma outra c\xE2mera.`);
29260
29535
  // src/new-flow/checkers/DeviceCheckerService.ts
29261
29536
  var _DeviceCheckerService = class _DeviceCheckerService {
29262
29537
  constructor(context) {
29538
+ this.deviceCheckResult = null;
29263
29539
  this.videoOptions = {
29264
29540
  width: 1080,
29265
29541
  height: 720,
@@ -29290,6 +29566,9 @@ var _DeviceCheckerService = class _DeviceCheckerService {
29290
29566
  token: context.token
29291
29567
  });
29292
29568
  }
29569
+ getDeviceCheckResult() {
29570
+ return this.deviceCheckResult;
29571
+ }
29293
29572
  async runCheckDevicesFlow(options, _videoOptions, onModalConfirm, onModalCancel, onUpdate) {
29294
29573
  if (_DeviceCheckerService.isModalOpen) {
29295
29574
  return Promise.reject("Modal j\xE1 est\xE1 aberto");
@@ -29338,6 +29617,7 @@ var _DeviceCheckerService = class _DeviceCheckerService {
29338
29617
  });
29339
29618
  }
29340
29619
  );
29620
+ this.deviceCheckResult = { ...returnData, result: resultPromise };
29341
29621
  return { ...returnData, result: resultPromise };
29342
29622
  } catch (error) {
29343
29623
  this.closeCheckDevices();
@@ -29383,7 +29663,7 @@ var _DeviceCheckerService = class _DeviceCheckerService {
29383
29663
  await this.checkSpyScan();
29384
29664
  const { cameraId, microphoneId, result } = await this.DeviceCheckerUI.modalActions(() => this.closeCheckDevices());
29385
29665
  return new Promise((resolve) => {
29386
- resolve({
29666
+ const response = {
29387
29667
  result,
29388
29668
  cameraId,
29389
29669
  microphoneId,
@@ -29394,7 +29674,9 @@ var _DeviceCheckerService = class _DeviceCheckerService {
29394
29674
  allowedMicrophone: this.allowedMicrophone,
29395
29675
  allowedSpyScan: this.allowedSpyScan,
29396
29676
  faceDetectionAlerts: this.faceDetectionAlerts
29397
- });
29677
+ };
29678
+ this.deviceCheckResult = response;
29679
+ resolve(response);
29398
29680
  });
29399
29681
  } catch (error) {
29400
29682
  this.closeCheckDevices();
@@ -29403,8 +29685,16 @@ var _DeviceCheckerService = class _DeviceCheckerService {
29403
29685
  }
29404
29686
  }
29405
29687
  isUnderResolution() {
29688
+ var _a2;
29406
29689
  const settings = this.cameraRecorder.cameraStream.getVideoTracks()[0].getSettings();
29407
- if (this.videoOptions.minWidth > settings.width || this.videoOptions.minHeight > settings.height) {
29690
+ let { width = 0, height = 0 } = settings;
29691
+ const isPortrait = (_a2 = screen.orientation) == null ? void 0 : _a2.type.includes("portrait");
29692
+ if (isPortrait && isMobileDevice()) {
29693
+ if (this.videoOptions.width == height && this.videoOptions.height == width) {
29694
+ [width, height] = [height, width];
29695
+ }
29696
+ }
29697
+ if (this.videoOptions.minWidth > width || this.videoOptions.minHeight > height) {
29408
29698
  this.allowedResolution = false;
29409
29699
  } else {
29410
29700
  this.allowedResolution = true;
@@ -32803,26 +33093,6 @@ var IndexDbSessionRepository = class {
32803
33093
  }
32804
33094
  };
32805
33095
 
32806
- // src/utils/browserInformations.ts
32807
- function fnBrowserDetect() {
32808
- const userAgent = navigator.userAgent;
32809
- let browserName;
32810
- if (userAgent.match(/chrome|chromium|crios/i)) {
32811
- browserName = "chrome";
32812
- } else if (userAgent.match(/firefox|fxios/i)) {
32813
- browserName = "firefox";
32814
- } else if (userAgent.match(/safari/i)) {
32815
- browserName = "safari";
32816
- } else if (userAgent.match(/opr\//i)) {
32817
- browserName = "opera";
32818
- } else if (userAgent.match(/edg/i)) {
32819
- browserName = "edge";
32820
- } else {
32821
- browserName = "No browser detection";
32822
- }
32823
- return browserName;
32824
- }
32825
-
32826
33096
  // src/utils/geolocation.ts
32827
33097
  function getGeolocation() {
32828
33098
  return new Promise((resolve, reject) => {
@@ -34015,7 +34285,7 @@ Upload Services: ${uploaderServices}`,
34015
34285
  });
34016
34286
  if (this.appChecker) {
34017
34287
  const externalSessionId = this.appChecker.getExternalCameraSessionId();
34018
- if (externalSessionId != null) {
34288
+ if (externalSessionId != "null") {
34019
34289
  await this.backend.externalCameraFinish(externalSessionId);
34020
34290
  }
34021
34291
  }
@@ -34046,7 +34316,7 @@ Error: ` + error
34046
34316
  }
34047
34317
  async verifyBrowser() {
34048
34318
  const browserName = await fnBrowserDetect();
34049
- if (browserName !== "chrome" && browserName !== "firefox") {
34319
+ if (browserName !== "chrome" && browserName !== "firefox" && !isMobileDevice()) {
34050
34320
  trackers.registerBrowserNotSupported(
34051
34321
  this.proctoringId,
34052
34322
  `Browser n\xE3o suportado:
@@ -17,6 +17,7 @@ export interface checkDevicesReturn {
17
17
  };
18
18
  }
19
19
  export declare class DeviceCheckerService {
20
+ private deviceCheckResult;
20
21
  private static isModalOpen;
21
22
  private options;
22
23
  private videoOptions;
@@ -41,6 +42,7 @@ export declare class DeviceCheckerService {
41
42
  private spycam;
42
43
  private spydevices;
43
44
  constructor(context: ProctoringContext);
45
+ getDeviceCheckResult(): any;
44
46
  runCheckDevicesFlow(options: ProctoringSessionOptions, _videoOptions: Partial<ProctoringVideoOptions>, onModalConfirm: (resolve: (cameraId: string, microphoneId: string) => void) => void, onModalCancel: (reject: (error: Error) => void) => void, onUpdate: (feedback: any) => void): Promise<any>;
45
47
  private onUpdateCallback;
46
48
  checkDevices(options?: ProctoringSessionOptions, _videoOptions?: ProctoringVideoOptions): Promise<checkDevicesReturn>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easyproctor",
3
- "version": "2.3.4",
3
+ "version": "2.4.0",
4
4
  "description": "Modulo web de gravação do EasyProctor",
5
5
  "main": "./index.js",
6
6
  "module": "./esm/index.js",