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