easyproctor-hml 2.5.2 → 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,13 +10163,18 @@ var CameraRecorder = class {
10163
10163
  this.recordingStart();
10164
10164
  const tracks = this.cameraStream.getVideoTracks();
10165
10165
  const settings = tracks[0].getSettings();
10166
- console.log("settings -> ", settings.width, settings.height);
10167
- console.log("videoOptions -> ", this.videoOptions.width, this.videoOptions.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);
10168
10173
  console.log("minWidth -> ", this.videoOptions.minWidth);
10169
10174
  console.log("minHeight -> ", this.videoOptions.minHeight);
10170
- if (this.videoOptions.minWidth > settings.width || this.videoOptions.minHeight > settings.height) {
10175
+ if (this.videoOptions.minWidth > width || this.videoOptions.minHeight > height) {
10171
10176
  throw STREAM_UNDER_MINIMUM_PERMITTED;
10172
- } else if (this.videoOptions.width !== settings.width || this.videoOptions.height !== settings.height) {
10177
+ } else if (this.videoOptions.width !== width || this.videoOptions.height !== height) {
10173
10178
  trackers.registerAnotherStream(
10174
10179
  this.proctoringId,
10175
10180
  `Maybe have another stream active
@@ -10182,11 +10187,11 @@ Setting: ${JSON.stringify(settings, null, 2)}`
10182
10187
  );
10183
10188
  throw ANOTHER_STREAM_ACTIVE;
10184
10189
  }
10185
- ((_d = this.paramsConfig.imageBehaviourParameters) == null ? void 0 : _d.useUploadImage) && this.options.proctoringType == "IMAGE" && this.photoShotsCycle();
10186
- 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) {
10187
10192
  await this.faceDetection.enableCam(this.cameraStream);
10188
10193
  }
10189
- 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)) {
10190
10195
  await this.objectDetection.enableCam(this.cameraStream);
10191
10196
  }
10192
10197
  this.filesToUpload = [];
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,13 +28260,18 @@ var CameraRecorder = class {
28260
28260
  this.recordingStart();
28261
28261
  const tracks = this.cameraStream.getVideoTracks();
28262
28262
  const settings = tracks[0].getSettings();
28263
- console.log("settings -> ", settings.width, settings.height);
28264
- console.log("videoOptions -> ", this.videoOptions.width, this.videoOptions.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);
28265
28270
  console.log("minWidth -> ", this.videoOptions.minWidth);
28266
28271
  console.log("minHeight -> ", this.videoOptions.minHeight);
28267
- if (this.videoOptions.minWidth > settings.width || this.videoOptions.minHeight > settings.height) {
28272
+ if (this.videoOptions.minWidth > width || this.videoOptions.minHeight > height) {
28268
28273
  throw STREAM_UNDER_MINIMUM_PERMITTED;
28269
- } else if (this.videoOptions.width !== settings.width || this.videoOptions.height !== settings.height) {
28274
+ } else if (this.videoOptions.width !== width || this.videoOptions.height !== height) {
28270
28275
  trackers.registerAnotherStream(
28271
28276
  this.proctoringId,
28272
28277
  `Maybe have another stream active
@@ -28279,11 +28284,11 @@ Setting: ${JSON.stringify(settings, null, 2)}`
28279
28284
  );
28280
28285
  throw ANOTHER_STREAM_ACTIVE;
28281
28286
  }
28282
- ((_d = this.paramsConfig.imageBehaviourParameters) == null ? void 0 : _d.useUploadImage) && this.options.proctoringType == "IMAGE" && this.photoShotsCycle();
28283
- 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) {
28284
28289
  await this.faceDetection.enableCam(this.cameraStream);
28285
28290
  }
28286
- 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)) {
28287
28292
  await this.objectDetection.enableCam(this.cameraStream);
28288
28293
  }
28289
28294
  this.filesToUpload = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easyproctor-hml",
3
- "version": "2.5.2",
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",