easyproctor-hml 2.5.1 → 2.5.3

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/esm/index.js CHANGED
@@ -10117,7 +10117,7 @@ var CameraRecorder = class {
10117
10117
  }
10118
10118
  }
10119
10119
  async startRecording(options) {
10120
- var _a2, _b, _c2, _d, _e3, _f, _g;
10120
+ var _a2, _b, _c2, _d, _e3, _f, _g, _h;
10121
10121
  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)) {
10122
10122
  await this.initializeDetectors();
10123
10123
  }
@@ -10163,9 +10163,18 @@ var CameraRecorder = class {
10163
10163
  this.recordingStart();
10164
10164
  const tracks = this.cameraStream.getVideoTracks();
10165
10165
  const settings = tracks[0].getSettings();
10166
- if (this.videoOptions.minWidth > settings.width || this.videoOptions.minHeight > settings.height) {
10166
+ let { width = 0, height = 0 } = settings;
10167
+ const isPortrait = ((_d = screen.orientation) == null ? void 0 : _d.type.includes("portrait")) || window.innerHeight > window.innerWidth;
10168
+ if (isPortrait && width > height) {
10169
+ [width, height] = [height, width];
10170
+ }
10171
+ console.log("width -> ", width);
10172
+ console.log("height -> ", height);
10173
+ console.log("minWidth -> ", this.videoOptions.minWidth);
10174
+ console.log("minHeight -> ", this.videoOptions.minHeight);
10175
+ if (this.videoOptions.minWidth > width || this.videoOptions.minHeight > height) {
10167
10176
  throw STREAM_UNDER_MINIMUM_PERMITTED;
10168
- } else if (this.videoOptions.width !== settings.width || this.videoOptions.height !== settings.height) {
10177
+ } else if (this.videoOptions.width !== width || this.videoOptions.height !== height) {
10169
10178
  trackers.registerAnotherStream(
10170
10179
  this.proctoringId,
10171
10180
  `Maybe have another stream active
@@ -10178,11 +10187,11 @@ Setting: ${JSON.stringify(settings, null, 2)}`
10178
10187
  );
10179
10188
  throw ANOTHER_STREAM_ACTIVE;
10180
10189
  }
10181
- ((_d = this.paramsConfig.imageBehaviourParameters) == null ? void 0 : _d.useUploadImage) && this.options.proctoringType == "IMAGE" && this.photoShotsCycle();
10182
- if ((_e3 = this.paramsConfig.videoBehaviourParameters) == null ? void 0 : _e3.detectFace) {
10190
+ ((_e3 = this.paramsConfig.imageBehaviourParameters) == null ? void 0 : _e3.useUploadImage) && this.options.proctoringType == "IMAGE" && this.photoShotsCycle();
10191
+ if ((_f = this.paramsConfig.videoBehaviourParameters) == null ? void 0 : _f.detectFace) {
10183
10192
  await this.faceDetection.enableCam(this.cameraStream);
10184
10193
  }
10185
- if (((_f = this.paramsConfig.videoBehaviourParameters) == null ? void 0 : _f.detectPerson) || ((_g = this.paramsConfig.videoBehaviourParameters) == null ? void 0 : _g.detectCellPhone)) {
10194
+ if (((_g = this.paramsConfig.videoBehaviourParameters) == null ? void 0 : _g.detectPerson) || ((_h = this.paramsConfig.videoBehaviourParameters) == null ? void 0 : _h.detectCellPhone)) {
10186
10195
  await this.objectDetection.enableCam(this.cameraStream);
10187
10196
  }
10188
10197
  this.filesToUpload = [];
@@ -18953,7 +18962,8 @@ Upload Services: ${uploaderServices}`,
18953
18962
  });
18954
18963
  if (this.appChecker) {
18955
18964
  const externalSessionId = this.appChecker.getExternalCameraSessionId();
18956
- if (externalSessionId != null) {
18965
+ console.log("externalSessionId -> ", externalSessionId);
18966
+ if (externalSessionId != "null") {
18957
18967
  await this.backend.externalCameraFinish(externalSessionId);
18958
18968
  }
18959
18969
  }
package/index.js CHANGED
@@ -28214,7 +28214,7 @@ var CameraRecorder = class {
28214
28214
  }
28215
28215
  }
28216
28216
  async startRecording(options) {
28217
- var _a2, _b, _c2, _d, _e3, _f, _g;
28217
+ var _a2, _b, _c2, _d, _e3, _f, _g, _h;
28218
28218
  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)) {
28219
28219
  await this.initializeDetectors();
28220
28220
  }
@@ -28260,9 +28260,18 @@ var CameraRecorder = class {
28260
28260
  this.recordingStart();
28261
28261
  const tracks = this.cameraStream.getVideoTracks();
28262
28262
  const settings = tracks[0].getSettings();
28263
- if (this.videoOptions.minWidth > settings.width || this.videoOptions.minHeight > settings.height) {
28263
+ let { width = 0, height = 0 } = settings;
28264
+ const isPortrait = ((_d = screen.orientation) == null ? void 0 : _d.type.includes("portrait")) || window.innerHeight > window.innerWidth;
28265
+ if (isPortrait && width > height) {
28266
+ [width, height] = [height, width];
28267
+ }
28268
+ console.log("width -> ", width);
28269
+ console.log("height -> ", height);
28270
+ console.log("minWidth -> ", this.videoOptions.minWidth);
28271
+ console.log("minHeight -> ", this.videoOptions.minHeight);
28272
+ if (this.videoOptions.minWidth > width || this.videoOptions.minHeight > height) {
28264
28273
  throw STREAM_UNDER_MINIMUM_PERMITTED;
28265
- } else if (this.videoOptions.width !== settings.width || this.videoOptions.height !== settings.height) {
28274
+ } else if (this.videoOptions.width !== width || this.videoOptions.height !== height) {
28266
28275
  trackers.registerAnotherStream(
28267
28276
  this.proctoringId,
28268
28277
  `Maybe have another stream active
@@ -28275,11 +28284,11 @@ Setting: ${JSON.stringify(settings, null, 2)}`
28275
28284
  );
28276
28285
  throw ANOTHER_STREAM_ACTIVE;
28277
28286
  }
28278
- ((_d = this.paramsConfig.imageBehaviourParameters) == null ? void 0 : _d.useUploadImage) && this.options.proctoringType == "IMAGE" && this.photoShotsCycle();
28279
- if ((_e3 = this.paramsConfig.videoBehaviourParameters) == null ? void 0 : _e3.detectFace) {
28287
+ ((_e3 = this.paramsConfig.imageBehaviourParameters) == null ? void 0 : _e3.useUploadImage) && this.options.proctoringType == "IMAGE" && this.photoShotsCycle();
28288
+ if ((_f = this.paramsConfig.videoBehaviourParameters) == null ? void 0 : _f.detectFace) {
28280
28289
  await this.faceDetection.enableCam(this.cameraStream);
28281
28290
  }
28282
- if (((_f = this.paramsConfig.videoBehaviourParameters) == null ? void 0 : _f.detectPerson) || ((_g = this.paramsConfig.videoBehaviourParameters) == null ? void 0 : _g.detectCellPhone)) {
28291
+ if (((_g = this.paramsConfig.videoBehaviourParameters) == null ? void 0 : _g.detectPerson) || ((_h = this.paramsConfig.videoBehaviourParameters) == null ? void 0 : _h.detectCellPhone)) {
28283
28292
  await this.objectDetection.enableCam(this.cameraStream);
28284
28293
  }
28285
28294
  this.filesToUpload = [];
@@ -34202,7 +34211,8 @@ Upload Services: ${uploaderServices}`,
34202
34211
  });
34203
34212
  if (this.appChecker) {
34204
34213
  const externalSessionId = this.appChecker.getExternalCameraSessionId();
34205
- if (externalSessionId != null) {
34214
+ console.log("externalSessionId -> ", externalSessionId);
34215
+ if (externalSessionId != "null") {
34206
34216
  await this.backend.externalCameraFinish(externalSessionId);
34207
34217
  }
34208
34218
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easyproctor-hml",
3
- "version": "2.5.1",
3
+ "version": "2.5.3",
4
4
  "description": "Modulo web de gravação do EasyProctor",
5
5
  "main": "./index.js",
6
6
  "module": "./esm/index.js",