easyproctor-hml 0.0.42 → 0.0.44
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/errors/errors.d.ts +2 -0
- package/esm/index.js +57 -16
- package/index.js +57 -16
- package/new-flow/recorders/ScreenRecorder.d.ts +1 -0
- package/package.json +1 -1
- package/plugins/insights.d.ts +2 -0
- package/proctoring/proctoring.d.ts +1 -0
- package/unpkg/easyproctor.min.js +27 -24
- package/utils/browserInformations.d.ts +1 -0
package/errors/errors.d.ts
CHANGED
|
@@ -9,3 +9,5 @@ export declare const PROCTORING_NOT_STARTED = "proctoring_not_started";
|
|
|
9
9
|
export declare const PROCTORING_RUNNING = "proctoring_running";
|
|
10
10
|
export declare const NO_VIDEOS_RECORDED = "no_videos_recorded";
|
|
11
11
|
export declare const PERMISSIONS_NOT_GRANTED = "permissions_not_granted";
|
|
12
|
+
export declare const ANOTHER_STREAM_ACTIVE = "another_stream_active";
|
|
13
|
+
export declare const BROWSER_NOT_SUPPORTED = "browser_not_supported";
|
package/esm/index.js
CHANGED
|
@@ -22429,7 +22429,9 @@ var eventNames = {
|
|
|
22429
22429
|
FINISH: "finish",
|
|
22430
22430
|
ERROR: "error",
|
|
22431
22431
|
UPLOAD_VIDEO: "upload_video",
|
|
22432
|
-
BUFFER_SIZE: "buffer_size"
|
|
22432
|
+
BUFFER_SIZE: "buffer_size",
|
|
22433
|
+
ANOTHER_STREAM: "another_stream",
|
|
22434
|
+
BROWSER_NOT_SUPPORTED: "browser_not_supported"
|
|
22433
22435
|
};
|
|
22434
22436
|
var trackError = (exception) => insights.trackException({ exception });
|
|
22435
22437
|
var registerCustomEvent = (eventName, properties) => insights.trackEvent({ name: eventName, properties });
|
|
@@ -22440,12 +22442,14 @@ var trackers = {
|
|
|
22440
22442
|
registerStart: (proctoringId, success, description) => registerCustomEvent(eventNames.START, { proctoringId, success, description }),
|
|
22441
22443
|
registerFinish: (proctoringId, success, description) => registerCustomEvent(eventNames.FINISH, { proctoringId, success, description }),
|
|
22442
22444
|
registerError: (proctoringId, description) => registerCustomEvent(eventNames.ERROR, { proctoringId, description }),
|
|
22445
|
+
registerBrowserNotSupported: (proctoringId, description) => registerCustomEvent(eventNames.BROWSER_NOT_SUPPORTED, { proctoringId, description }),
|
|
22443
22446
|
registerUpload: (proctoringId, success, description, serviceType, uploadTime) => registerCustomEvent(eventNames.UPLOAD_VIDEO, { proctoringId, success, description, serviceType, uploadTime }),
|
|
22444
22447
|
registerUploadFile: (proctoringId, description, fileType) => registerCustomEvent(eventNames.UPLOAD_VIDEO, { proctoringId, description, fileType }),
|
|
22445
22448
|
registerChangeDevice: (proctoringId, inOrOut, devicesChanged) => registerCustomEvent(eventNames.UPLOAD_VIDEO, { proctoringId, inOrOut, devicesChanged }),
|
|
22446
22449
|
registerStopSharingScreen: (proctoringId, description) => registerCustomEvent(eventNames.UPLOAD_VIDEO, { proctoringId, description }),
|
|
22447
22450
|
registerErrorRecorderRTC: (proctoringId, description) => registerCustomEvent(eventNames.UPLOAD_VIDEO, { proctoringId, description }),
|
|
22448
|
-
registerOnBufferSizeError: (proctoringId, description) => registerCustomEvent(eventNames.BUFFER_SIZE, { proctoringId, description })
|
|
22451
|
+
registerOnBufferSizeError: (proctoringId, description) => registerCustomEvent(eventNames.BUFFER_SIZE, { proctoringId, description }),
|
|
22452
|
+
registerAnotherStream: (proctoringId, description) => registerCustomEvent(eventNames.ANOTHER_STREAM, { proctoringId, description })
|
|
22449
22453
|
};
|
|
22450
22454
|
|
|
22451
22455
|
// src/plugins/recorder.ts
|
|
@@ -24393,6 +24397,15 @@ var AzureUploadService = class {
|
|
|
24393
24397
|
}
|
|
24394
24398
|
};
|
|
24395
24399
|
|
|
24400
|
+
// src/errors/errors.ts
|
|
24401
|
+
var NOT_SHARED_FIRST_SCREEN = "not_shared_first_screen";
|
|
24402
|
+
var NOT_SHARED_SCREEN = "not_shared_screen";
|
|
24403
|
+
var MULTIPLE_MONITORS_DETECTED = "multiple_monitors_detected";
|
|
24404
|
+
var PROCTORING_ALREADY_STARTED = "proctoring_already_started";
|
|
24405
|
+
var PROCTORING_NOT_STARTED = "proctoring_not_started";
|
|
24406
|
+
var ANOTHER_STREAM_ACTIVE = "another_stream_active";
|
|
24407
|
+
var BROWSER_NOT_SUPPORTED = "browser_not_supported";
|
|
24408
|
+
|
|
24396
24409
|
// src/new-flow/recorders/CameraRecorder.ts
|
|
24397
24410
|
var CameraRecorder = class {
|
|
24398
24411
|
constructor(options, videoOptions, imageProctoring, backend, backendToken) {
|
|
@@ -24458,10 +24471,14 @@ var CameraRecorder = class {
|
|
|
24458
24471
|
this.recordingPause = pauseRecording;
|
|
24459
24472
|
this.recordingResume = resumeRecording;
|
|
24460
24473
|
this.recordingStart();
|
|
24461
|
-
|
|
24462
|
-
|
|
24463
|
-
this.
|
|
24474
|
+
const settings = this.cameraStream.getVideoTracks()[0].getSettings();
|
|
24475
|
+
if (this.videoOptions.width !== settings.width || this.videoOptions.height !== settings.height) {
|
|
24476
|
+
trackers.registerAnotherStream(this.proctoringId, `Maybe have another stream active
|
|
24477
|
+
Video Options: ${this.videoOptions}
|
|
24478
|
+
Setting: ${settings}`);
|
|
24479
|
+
throw ANOTHER_STREAM_ACTIVE;
|
|
24464
24480
|
}
|
|
24481
|
+
this.imageProctoring.useUploadImage && this.photoShotsCycle();
|
|
24465
24482
|
}
|
|
24466
24483
|
async stopRecording() {
|
|
24467
24484
|
this.recordingStop && await this.recordingStop();
|
|
@@ -24475,6 +24492,7 @@ var CameraRecorder = class {
|
|
|
24475
24492
|
}
|
|
24476
24493
|
photoShotsCycle() {
|
|
24477
24494
|
let imageFile;
|
|
24495
|
+
this.configImageCapture();
|
|
24478
24496
|
this.imageInterval = setInterval(async () => {
|
|
24479
24497
|
this.canvas.getContext("2d").drawImage(this.video, 0, 0, 1280, 720);
|
|
24480
24498
|
const image_data_url = this.canvas.toDataURL("image/jpeg");
|
|
@@ -25164,13 +25182,6 @@ var DeviceChecker = class {
|
|
|
25164
25182
|
}
|
|
25165
25183
|
};
|
|
25166
25184
|
|
|
25167
|
-
// src/errors/errors.ts
|
|
25168
|
-
var NOT_SHARED_FIRST_SCREEN = "not_shared_first_screen";
|
|
25169
|
-
var NOT_SHARED_SCREEN = "not_shared_screen";
|
|
25170
|
-
var MULTIPLE_MONITORS_DETECTED = "multiple_monitors_detected";
|
|
25171
|
-
var PROCTORING_ALREADY_STARTED = "proctoring_already_started";
|
|
25172
|
-
var PROCTORING_NOT_STARTED = "proctoring_not_started";
|
|
25173
|
-
|
|
25174
25185
|
// src/extension/extension.ts
|
|
25175
25186
|
var Extension = class {
|
|
25176
25187
|
constructor() {
|
|
@@ -25749,7 +25760,7 @@ var ScreenRecorder = class {
|
|
|
25749
25760
|
}
|
|
25750
25761
|
async startRecording() {
|
|
25751
25762
|
this.startTime = new Date(Date.now());
|
|
25752
|
-
const { allowOnlyFirstMonitor, onStopSharingScreenCallback, onBufferSizeErrorCallback } = this.options;
|
|
25763
|
+
const { allowOnlyFirstMonitor, allowMultipleMonitors, onStopSharingScreenCallback, onBufferSizeErrorCallback } = this.options;
|
|
25753
25764
|
const displayMediaStreamConstraints = {
|
|
25754
25765
|
video: {
|
|
25755
25766
|
cursor: "always",
|
|
@@ -25764,7 +25775,7 @@ var ScreenRecorder = class {
|
|
|
25764
25775
|
const isFirefox = navigator.userAgent.indexOf("Firefox") > -1;
|
|
25765
25776
|
if (isFirefox) {
|
|
25766
25777
|
const hasMultipleMonitors = tracks.find((el) => el.label == "");
|
|
25767
|
-
if (hasMultipleMonitors && allowOnlyFirstMonitor) {
|
|
25778
|
+
if (hasMultipleMonitors && allowOnlyFirstMonitor || hasMultipleMonitors && !allowMultipleMonitors) {
|
|
25768
25779
|
throw MULTIPLE_MONITORS_DETECTED;
|
|
25769
25780
|
}
|
|
25770
25781
|
}
|
|
@@ -25931,6 +25942,26 @@ var AwsUploadService = class {
|
|
|
25931
25942
|
}
|
|
25932
25943
|
};
|
|
25933
25944
|
|
|
25945
|
+
// src/utils/browserInformations.ts
|
|
25946
|
+
function fnBrowserDetect() {
|
|
25947
|
+
const userAgent = navigator.userAgent;
|
|
25948
|
+
let browserName;
|
|
25949
|
+
if (userAgent.match(/chrome|chromium|crios/i)) {
|
|
25950
|
+
browserName = "chrome";
|
|
25951
|
+
} else if (userAgent.match(/firefox|fxios/i)) {
|
|
25952
|
+
browserName = "firefox";
|
|
25953
|
+
} else if (userAgent.match(/safari/i)) {
|
|
25954
|
+
browserName = "safari";
|
|
25955
|
+
} else if (userAgent.match(/opr\//i)) {
|
|
25956
|
+
browserName = "opera";
|
|
25957
|
+
} else if (userAgent.match(/edg/i)) {
|
|
25958
|
+
browserName = "edge";
|
|
25959
|
+
} else {
|
|
25960
|
+
browserName = "No browser detection";
|
|
25961
|
+
}
|
|
25962
|
+
return browserName;
|
|
25963
|
+
}
|
|
25964
|
+
|
|
25934
25965
|
// src/utils/verifyVersion.ts
|
|
25935
25966
|
function versionVerify() {
|
|
25936
25967
|
const agentStr = window.navigator.userAgent.split("SEB/");
|
|
@@ -25993,7 +26024,7 @@ var Proctoring = class {
|
|
|
25993
26024
|
this.onBufferSizeErrorCallback = () => cb();
|
|
25994
26025
|
}
|
|
25995
26026
|
createRecorders(options = getDefaultProctoringOptions) {
|
|
25996
|
-
var _a2;
|
|
26027
|
+
var _a2, _b;
|
|
25997
26028
|
const cameraRecorder = new CameraRecorder({
|
|
25998
26029
|
cameraId: this.sessionOptions.cameraId,
|
|
25999
26030
|
microphoneId: this.sessionOptions.microphoneId,
|
|
@@ -26006,6 +26037,7 @@ var Proctoring = class {
|
|
|
26006
26037
|
const audioRecorder = new AudioRecorder();
|
|
26007
26038
|
const screenRecorder = this.sessionOptions.captureScreen ? new ScreenRecorder({
|
|
26008
26039
|
allowOnlyFirstMonitor: (_a2 = this.sessionOptions.allowOnlyFirstMonitor) != null ? _a2 : true,
|
|
26040
|
+
allowMultipleMonitors: (_b = this.sessionOptions.allowMultipleMonitors) != null ? _b : true,
|
|
26009
26041
|
onStopSharingScreenCallback: () => this.onStopSharingScreenCallback(),
|
|
26010
26042
|
onBufferSizeError: this.sessionOptions.onBufferSizeError,
|
|
26011
26043
|
onBufferSizeErrorCallback: () => this.onBufferSizeErrorCallback()
|
|
@@ -26035,6 +26067,7 @@ var Proctoring = class {
|
|
|
26035
26067
|
this.sessionOptions = { ...getDefaultProctoringOptions, ...options };
|
|
26036
26068
|
this.videoOptions = validatePartialVideoOptions(_videoOptions);
|
|
26037
26069
|
await this.initConfig();
|
|
26070
|
+
await this.verifyBrowser();
|
|
26038
26071
|
this.sessionOptions.captureScreen && await this.verifyMultipleMonitors(this.sessionOptions);
|
|
26039
26072
|
if (this.state != "Stop" /* Stop */) {
|
|
26040
26073
|
throw PROCTORING_ALREADY_STARTED;
|
|
@@ -26064,7 +26097,6 @@ Navigator: ${navigator}`);
|
|
|
26064
26097
|
this.state = "Recording" /* Recording */;
|
|
26065
26098
|
return startResponse;
|
|
26066
26099
|
} catch (error) {
|
|
26067
|
-
console.log(error);
|
|
26068
26100
|
await this.cancel();
|
|
26069
26101
|
trackers.registerStart(this.proctoringId, false, `Token: ${this.context.token}
|
|
26070
26102
|
Version: ${versionVerify()}
|
|
@@ -26165,6 +26197,14 @@ Error: ` + error);
|
|
|
26165
26197
|
}
|
|
26166
26198
|
}
|
|
26167
26199
|
}
|
|
26200
|
+
async verifyBrowser() {
|
|
26201
|
+
const browserName = await fnBrowserDetect();
|
|
26202
|
+
if (browserName !== "chrome" && browserName !== "firefox") {
|
|
26203
|
+
trackers.registerBrowserNotSupported(this.proctoringId, `Browser n\xE3o suportado:
|
|
26204
|
+
Tentativa utilizando o browser ${browserName}`);
|
|
26205
|
+
throw BROWSER_NOT_SUPPORTED;
|
|
26206
|
+
}
|
|
26207
|
+
}
|
|
26168
26208
|
async initConfig() {
|
|
26169
26209
|
try {
|
|
26170
26210
|
this.insights = await this.backend.getInsights(this.context);
|
|
@@ -26202,6 +26242,7 @@ Error: ` + error);
|
|
|
26202
26242
|
if (this.state != "Paused" /* Paused */) {
|
|
26203
26243
|
throw PROCTORING_NOT_STARTED;
|
|
26204
26244
|
}
|
|
26245
|
+
await this.verifyBrowser();
|
|
26205
26246
|
await this.verifyMultipleMonitors(this.sessionOptions);
|
|
26206
26247
|
await this.recorder.startAll();
|
|
26207
26248
|
this.proctoringSession.recordings = [];
|
package/index.js
CHANGED
|
@@ -33356,7 +33356,9 @@ var eventNames = {
|
|
|
33356
33356
|
FINISH: "finish",
|
|
33357
33357
|
ERROR: "error",
|
|
33358
33358
|
UPLOAD_VIDEO: "upload_video",
|
|
33359
|
-
BUFFER_SIZE: "buffer_size"
|
|
33359
|
+
BUFFER_SIZE: "buffer_size",
|
|
33360
|
+
ANOTHER_STREAM: "another_stream",
|
|
33361
|
+
BROWSER_NOT_SUPPORTED: "browser_not_supported"
|
|
33360
33362
|
};
|
|
33361
33363
|
var trackError = (exception) => insights.trackException({ exception });
|
|
33362
33364
|
var registerCustomEvent = (eventName, properties) => insights.trackEvent({ name: eventName, properties });
|
|
@@ -33367,12 +33369,14 @@ var trackers = {
|
|
|
33367
33369
|
registerStart: (proctoringId, success, description) => registerCustomEvent(eventNames.START, { proctoringId, success, description }),
|
|
33368
33370
|
registerFinish: (proctoringId, success, description) => registerCustomEvent(eventNames.FINISH, { proctoringId, success, description }),
|
|
33369
33371
|
registerError: (proctoringId, description) => registerCustomEvent(eventNames.ERROR, { proctoringId, description }),
|
|
33372
|
+
registerBrowserNotSupported: (proctoringId, description) => registerCustomEvent(eventNames.BROWSER_NOT_SUPPORTED, { proctoringId, description }),
|
|
33370
33373
|
registerUpload: (proctoringId, success, description, serviceType, uploadTime) => registerCustomEvent(eventNames.UPLOAD_VIDEO, { proctoringId, success, description, serviceType, uploadTime }),
|
|
33371
33374
|
registerUploadFile: (proctoringId, description, fileType) => registerCustomEvent(eventNames.UPLOAD_VIDEO, { proctoringId, description, fileType }),
|
|
33372
33375
|
registerChangeDevice: (proctoringId, inOrOut, devicesChanged) => registerCustomEvent(eventNames.UPLOAD_VIDEO, { proctoringId, inOrOut, devicesChanged }),
|
|
33373
33376
|
registerStopSharingScreen: (proctoringId, description) => registerCustomEvent(eventNames.UPLOAD_VIDEO, { proctoringId, description }),
|
|
33374
33377
|
registerErrorRecorderRTC: (proctoringId, description) => registerCustomEvent(eventNames.UPLOAD_VIDEO, { proctoringId, description }),
|
|
33375
|
-
registerOnBufferSizeError: (proctoringId, description) => registerCustomEvent(eventNames.BUFFER_SIZE, { proctoringId, description })
|
|
33378
|
+
registerOnBufferSizeError: (proctoringId, description) => registerCustomEvent(eventNames.BUFFER_SIZE, { proctoringId, description }),
|
|
33379
|
+
registerAnotherStream: (proctoringId, description) => registerCustomEvent(eventNames.ANOTHER_STREAM, { proctoringId, description })
|
|
33376
33380
|
};
|
|
33377
33381
|
|
|
33378
33382
|
// src/plugins/recorder.ts
|
|
@@ -35927,6 +35931,15 @@ var AzureUploadService = class {
|
|
|
35927
35931
|
}
|
|
35928
35932
|
};
|
|
35929
35933
|
|
|
35934
|
+
// src/errors/errors.ts
|
|
35935
|
+
var NOT_SHARED_FIRST_SCREEN = "not_shared_first_screen";
|
|
35936
|
+
var NOT_SHARED_SCREEN = "not_shared_screen";
|
|
35937
|
+
var MULTIPLE_MONITORS_DETECTED = "multiple_monitors_detected";
|
|
35938
|
+
var PROCTORING_ALREADY_STARTED = "proctoring_already_started";
|
|
35939
|
+
var PROCTORING_NOT_STARTED = "proctoring_not_started";
|
|
35940
|
+
var ANOTHER_STREAM_ACTIVE = "another_stream_active";
|
|
35941
|
+
var BROWSER_NOT_SUPPORTED = "browser_not_supported";
|
|
35942
|
+
|
|
35930
35943
|
// src/new-flow/recorders/CameraRecorder.ts
|
|
35931
35944
|
var CameraRecorder = class {
|
|
35932
35945
|
constructor(options, videoOptions, imageProctoring, backend, backendToken) {
|
|
@@ -35992,10 +36005,14 @@ var CameraRecorder = class {
|
|
|
35992
36005
|
this.recordingPause = pauseRecording;
|
|
35993
36006
|
this.recordingResume = resumeRecording;
|
|
35994
36007
|
this.recordingStart();
|
|
35995
|
-
|
|
35996
|
-
|
|
35997
|
-
this.
|
|
36008
|
+
const settings = this.cameraStream.getVideoTracks()[0].getSettings();
|
|
36009
|
+
if (this.videoOptions.width !== settings.width || this.videoOptions.height !== settings.height) {
|
|
36010
|
+
trackers.registerAnotherStream(this.proctoringId, `Maybe have another stream active
|
|
36011
|
+
Video Options: ${this.videoOptions}
|
|
36012
|
+
Setting: ${settings}`);
|
|
36013
|
+
throw ANOTHER_STREAM_ACTIVE;
|
|
35998
36014
|
}
|
|
36015
|
+
this.imageProctoring.useUploadImage && this.photoShotsCycle();
|
|
35999
36016
|
}
|
|
36000
36017
|
async stopRecording() {
|
|
36001
36018
|
this.recordingStop && await this.recordingStop();
|
|
@@ -36009,6 +36026,7 @@ var CameraRecorder = class {
|
|
|
36009
36026
|
}
|
|
36010
36027
|
photoShotsCycle() {
|
|
36011
36028
|
let imageFile;
|
|
36029
|
+
this.configImageCapture();
|
|
36012
36030
|
this.imageInterval = setInterval(async () => {
|
|
36013
36031
|
this.canvas.getContext("2d").drawImage(this.video, 0, 0, 1280, 720);
|
|
36014
36032
|
const image_data_url = this.canvas.toDataURL("image/jpeg");
|
|
@@ -36698,13 +36716,6 @@ var DeviceChecker = class {
|
|
|
36698
36716
|
}
|
|
36699
36717
|
};
|
|
36700
36718
|
|
|
36701
|
-
// src/errors/errors.ts
|
|
36702
|
-
var NOT_SHARED_FIRST_SCREEN = "not_shared_first_screen";
|
|
36703
|
-
var NOT_SHARED_SCREEN = "not_shared_screen";
|
|
36704
|
-
var MULTIPLE_MONITORS_DETECTED = "multiple_monitors_detected";
|
|
36705
|
-
var PROCTORING_ALREADY_STARTED = "proctoring_already_started";
|
|
36706
|
-
var PROCTORING_NOT_STARTED = "proctoring_not_started";
|
|
36707
|
-
|
|
36708
36719
|
// src/extension/extension.ts
|
|
36709
36720
|
var Extension = class {
|
|
36710
36721
|
constructor() {
|
|
@@ -37283,7 +37294,7 @@ var ScreenRecorder = class {
|
|
|
37283
37294
|
}
|
|
37284
37295
|
async startRecording() {
|
|
37285
37296
|
this.startTime = new Date(Date.now());
|
|
37286
|
-
const { allowOnlyFirstMonitor, onStopSharingScreenCallback, onBufferSizeErrorCallback } = this.options;
|
|
37297
|
+
const { allowOnlyFirstMonitor, allowMultipleMonitors, onStopSharingScreenCallback, onBufferSizeErrorCallback } = this.options;
|
|
37287
37298
|
const displayMediaStreamConstraints = {
|
|
37288
37299
|
video: {
|
|
37289
37300
|
cursor: "always",
|
|
@@ -37298,7 +37309,7 @@ var ScreenRecorder = class {
|
|
|
37298
37309
|
const isFirefox = navigator.userAgent.indexOf("Firefox") > -1;
|
|
37299
37310
|
if (isFirefox) {
|
|
37300
37311
|
const hasMultipleMonitors = tracks.find((el) => el.label == "");
|
|
37301
|
-
if (hasMultipleMonitors && allowOnlyFirstMonitor) {
|
|
37312
|
+
if (hasMultipleMonitors && allowOnlyFirstMonitor || hasMultipleMonitors && !allowMultipleMonitors) {
|
|
37302
37313
|
throw MULTIPLE_MONITORS_DETECTED;
|
|
37303
37314
|
}
|
|
37304
37315
|
}
|
|
@@ -37465,6 +37476,26 @@ var AwsUploadService = class {
|
|
|
37465
37476
|
}
|
|
37466
37477
|
};
|
|
37467
37478
|
|
|
37479
|
+
// src/utils/browserInformations.ts
|
|
37480
|
+
function fnBrowserDetect() {
|
|
37481
|
+
const userAgent = navigator.userAgent;
|
|
37482
|
+
let browserName;
|
|
37483
|
+
if (userAgent.match(/chrome|chromium|crios/i)) {
|
|
37484
|
+
browserName = "chrome";
|
|
37485
|
+
} else if (userAgent.match(/firefox|fxios/i)) {
|
|
37486
|
+
browserName = "firefox";
|
|
37487
|
+
} else if (userAgent.match(/safari/i)) {
|
|
37488
|
+
browserName = "safari";
|
|
37489
|
+
} else if (userAgent.match(/opr\//i)) {
|
|
37490
|
+
browserName = "opera";
|
|
37491
|
+
} else if (userAgent.match(/edg/i)) {
|
|
37492
|
+
browserName = "edge";
|
|
37493
|
+
} else {
|
|
37494
|
+
browserName = "No browser detection";
|
|
37495
|
+
}
|
|
37496
|
+
return browserName;
|
|
37497
|
+
}
|
|
37498
|
+
|
|
37468
37499
|
// src/utils/verifyVersion.ts
|
|
37469
37500
|
function versionVerify() {
|
|
37470
37501
|
const agentStr = window.navigator.userAgent.split("SEB/");
|
|
@@ -37527,7 +37558,7 @@ var Proctoring = class {
|
|
|
37527
37558
|
this.onBufferSizeErrorCallback = () => cb();
|
|
37528
37559
|
}
|
|
37529
37560
|
createRecorders(options = getDefaultProctoringOptions) {
|
|
37530
|
-
var _a;
|
|
37561
|
+
var _a, _b;
|
|
37531
37562
|
const cameraRecorder = new CameraRecorder({
|
|
37532
37563
|
cameraId: this.sessionOptions.cameraId,
|
|
37533
37564
|
microphoneId: this.sessionOptions.microphoneId,
|
|
@@ -37540,6 +37571,7 @@ var Proctoring = class {
|
|
|
37540
37571
|
const audioRecorder = new AudioRecorder();
|
|
37541
37572
|
const screenRecorder = this.sessionOptions.captureScreen ? new ScreenRecorder({
|
|
37542
37573
|
allowOnlyFirstMonitor: (_a = this.sessionOptions.allowOnlyFirstMonitor) != null ? _a : true,
|
|
37574
|
+
allowMultipleMonitors: (_b = this.sessionOptions.allowMultipleMonitors) != null ? _b : true,
|
|
37543
37575
|
onStopSharingScreenCallback: () => this.onStopSharingScreenCallback(),
|
|
37544
37576
|
onBufferSizeError: this.sessionOptions.onBufferSizeError,
|
|
37545
37577
|
onBufferSizeErrorCallback: () => this.onBufferSizeErrorCallback()
|
|
@@ -37569,6 +37601,7 @@ var Proctoring = class {
|
|
|
37569
37601
|
this.sessionOptions = { ...getDefaultProctoringOptions, ...options };
|
|
37570
37602
|
this.videoOptions = validatePartialVideoOptions(_videoOptions);
|
|
37571
37603
|
await this.initConfig();
|
|
37604
|
+
await this.verifyBrowser();
|
|
37572
37605
|
this.sessionOptions.captureScreen && await this.verifyMultipleMonitors(this.sessionOptions);
|
|
37573
37606
|
if (this.state != "Stop" /* Stop */) {
|
|
37574
37607
|
throw PROCTORING_ALREADY_STARTED;
|
|
@@ -37598,7 +37631,6 @@ Navigator: ${navigator}`);
|
|
|
37598
37631
|
this.state = "Recording" /* Recording */;
|
|
37599
37632
|
return startResponse;
|
|
37600
37633
|
} catch (error) {
|
|
37601
|
-
console.log(error);
|
|
37602
37634
|
await this.cancel();
|
|
37603
37635
|
trackers.registerStart(this.proctoringId, false, `Token: ${this.context.token}
|
|
37604
37636
|
Version: ${versionVerify()}
|
|
@@ -37699,6 +37731,14 @@ Error: ` + error);
|
|
|
37699
37731
|
}
|
|
37700
37732
|
}
|
|
37701
37733
|
}
|
|
37734
|
+
async verifyBrowser() {
|
|
37735
|
+
const browserName = await fnBrowserDetect();
|
|
37736
|
+
if (browserName !== "chrome" && browserName !== "firefox") {
|
|
37737
|
+
trackers.registerBrowserNotSupported(this.proctoringId, `Browser n\xE3o suportado:
|
|
37738
|
+
Tentativa utilizando o browser ${browserName}`);
|
|
37739
|
+
throw BROWSER_NOT_SUPPORTED;
|
|
37740
|
+
}
|
|
37741
|
+
}
|
|
37702
37742
|
async initConfig() {
|
|
37703
37743
|
try {
|
|
37704
37744
|
this.insights = await this.backend.getInsights(this.context);
|
|
@@ -37736,6 +37776,7 @@ Error: ` + error);
|
|
|
37736
37776
|
if (this.state != "Paused" /* Paused */) {
|
|
37737
37777
|
throw PROCTORING_NOT_STARTED;
|
|
37738
37778
|
}
|
|
37779
|
+
await this.verifyBrowser();
|
|
37739
37780
|
await this.verifyMultipleMonitors(this.sessionOptions);
|
|
37740
37781
|
await this.recorder.startAll();
|
|
37741
37782
|
this.proctoringSession.recordings = [];
|
|
@@ -11,6 +11,7 @@ export declare class ScreenRecorder implements IRecorder {
|
|
|
11
11
|
startTime: Date | undefined;
|
|
12
12
|
constructor(options: {
|
|
13
13
|
allowOnlyFirstMonitor: boolean;
|
|
14
|
+
allowMultipleMonitors: boolean;
|
|
14
15
|
onStopSharingScreenCallback: () => void;
|
|
15
16
|
onBufferSizeError?: boolean;
|
|
16
17
|
onBufferSizeErrorCallback: () => void;
|
package/package.json
CHANGED
package/plugins/insights.d.ts
CHANGED
|
@@ -10,11 +10,13 @@ declare const trackers: {
|
|
|
10
10
|
registerStart: (proctoringId: string, success: boolean, description: string) => void;
|
|
11
11
|
registerFinish: (proctoringId: string, success: boolean, description: string) => void;
|
|
12
12
|
registerError: (proctoringId: string, description: string) => void;
|
|
13
|
+
registerBrowserNotSupported: (proctoringId: string, description: string) => void;
|
|
13
14
|
registerUpload: (proctoringId: string, success: boolean, description: string, serviceType: ServiceType, uploadTime?: number) => void;
|
|
14
15
|
registerUploadFile: (proctoringId: string, description: string, fileType: string) => void;
|
|
15
16
|
registerChangeDevice: (proctoringId: string, inOrOut: string, devicesChanged: DevicesChanged) => void;
|
|
16
17
|
registerStopSharingScreen: (proctoringId: string, description: string) => void;
|
|
17
18
|
registerErrorRecorderRTC: (proctoringId: string, description: string) => void;
|
|
18
19
|
registerOnBufferSizeError: (proctoringId: string, description: string) => void;
|
|
20
|
+
registerAnotherStream: (proctoringId: string, description: string) => void;
|
|
19
21
|
};
|
|
20
22
|
export { trackers, init };
|