easyproctor 0.0.71 → 0.0.73
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/README.md +5 -0
- package/esm/index.js +30 -30
- package/index.js +30 -30
- package/package.json +2 -1
- package/unpkg/easyproctor.min.js +21 -23
package/README.md
CHANGED
package/esm/index.js
CHANGED
|
@@ -28561,8 +28561,6 @@ var containerName = "";
|
|
|
28561
28561
|
var sas = "";
|
|
28562
28562
|
var blobServiceClient;
|
|
28563
28563
|
var message = "";
|
|
28564
|
-
var loadingInterval;
|
|
28565
|
-
var loadingBoolean = true;
|
|
28566
28564
|
async function setConfiguration(_account, _cointainerName, _sas) {
|
|
28567
28565
|
account = _account;
|
|
28568
28566
|
containerName = _cointainerName;
|
|
@@ -28650,32 +28648,6 @@ async function uploadBackup(data, config2, proctoringToken) {
|
|
|
28650
28648
|
} catch (err) {
|
|
28651
28649
|
message += "\n\u2022 Error on AWS upload\n ";
|
|
28652
28650
|
message += err;
|
|
28653
|
-
try {
|
|
28654
|
-
download(data);
|
|
28655
|
-
} catch (err2) {
|
|
28656
|
-
throw err2;
|
|
28657
|
-
}
|
|
28658
|
-
throw err;
|
|
28659
|
-
}
|
|
28660
|
-
}
|
|
28661
|
-
function download(data) {
|
|
28662
|
-
try {
|
|
28663
|
-
const { file, onProgress } = data;
|
|
28664
|
-
const url = URL.createObjectURL(file);
|
|
28665
|
-
const a = document.createElement("a");
|
|
28666
|
-
document.body.appendChild(a);
|
|
28667
|
-
a.style.display = "none";
|
|
28668
|
-
a.href = url;
|
|
28669
|
-
a.download = file.name;
|
|
28670
|
-
a.click();
|
|
28671
|
-
window.URL.revokeObjectURL(url);
|
|
28672
|
-
loadingBoolean = false;
|
|
28673
|
-
clearInterval(loadingInterval);
|
|
28674
|
-
onProgress && onProgress(Math.round(100));
|
|
28675
|
-
} catch (err) {
|
|
28676
|
-
message += `
|
|
28677
|
-
\u2022 Error on machine download -> ${data.file.name}
|
|
28678
|
-
`;
|
|
28679
28651
|
throw err;
|
|
28680
28652
|
}
|
|
28681
28653
|
}
|
|
@@ -28801,7 +28773,7 @@ function useProctoring(proctoringOptions, homolConfig = false) {
|
|
|
28801
28773
|
if (!navigator.mediaDevices.getDisplayMedia || !window.indexedDB) {
|
|
28802
28774
|
throw INCOMPATIBLE_NAVIGATOR;
|
|
28803
28775
|
}
|
|
28804
|
-
function
|
|
28776
|
+
function download(file) {
|
|
28805
28777
|
const url = URL.createObjectURL(file);
|
|
28806
28778
|
const a = document.createElement("a");
|
|
28807
28779
|
document.body.appendChild(a);
|
|
@@ -28818,6 +28790,7 @@ function useProctoring(proctoringOptions, homolConfig = false) {
|
|
|
28818
28790
|
let startDate;
|
|
28819
28791
|
let alerts = [];
|
|
28820
28792
|
let onLostFocusCallback;
|
|
28793
|
+
let onChangeDevicesCallback;
|
|
28821
28794
|
let onFocusCallback;
|
|
28822
28795
|
let onStopSharingScreenCallback = void 0;
|
|
28823
28796
|
let cancelCallback = null;
|
|
@@ -28888,6 +28861,19 @@ function useProctoring(proctoringOptions, homolConfig = false) {
|
|
|
28888
28861
|
});
|
|
28889
28862
|
}
|
|
28890
28863
|
};
|
|
28864
|
+
const _onChangeDevices = () => {
|
|
28865
|
+
console.log("Hereeeee");
|
|
28866
|
+
navigator.mediaDevices.ondevicechange = (event) => {
|
|
28867
|
+
onChangeDevicesCallback && onChangeDevicesCallback();
|
|
28868
|
+
console.log("here");
|
|
28869
|
+
console.log(event);
|
|
28870
|
+
alerts.push({
|
|
28871
|
+
begin: Date.now() - startTime,
|
|
28872
|
+
alert: 25,
|
|
28873
|
+
end: 0
|
|
28874
|
+
});
|
|
28875
|
+
};
|
|
28876
|
+
};
|
|
28891
28877
|
const _onReturnFocus = () => {
|
|
28892
28878
|
const lastAlert = alerts[alerts.length - 1];
|
|
28893
28879
|
if (lastAlert) {
|
|
@@ -28898,6 +28884,7 @@ function useProctoring(proctoringOptions, homolConfig = false) {
|
|
|
28898
28884
|
const _addListeners = () => {
|
|
28899
28885
|
window.addEventListener("blur", _onLostFocus);
|
|
28900
28886
|
window.addEventListener("focus", _onReturnFocus);
|
|
28887
|
+
navigator.mediaDevices.ondevicechange = _onChangeDevices;
|
|
28901
28888
|
};
|
|
28902
28889
|
const _removeListeners = () => {
|
|
28903
28890
|
window.removeEventListener("blur", _onLostFocus);
|
|
@@ -29009,7 +28996,7 @@ function useProctoring(proctoringOptions, homolConfig = false) {
|
|
|
29009
28996
|
return { buffer, blob };
|
|
29010
28997
|
}
|
|
29011
28998
|
async function checkDevices(options = defaultProctoringOptions, videoOptions = { width: 640, height: 480 }) {
|
|
29012
|
-
const { cameraId, microphoneId, allowOnlyFirstMonitor = true,
|
|
28999
|
+
const { cameraId, microphoneId, allowOnlyFirstMonitor = true, captureScreen = true, proctoringType = "VIDEO" } = options;
|
|
29013
29000
|
checkPermissions();
|
|
29014
29001
|
startAudio();
|
|
29015
29002
|
const { cameraStream, _screenStream } = await _startCapture({ cameraId, microphoneId, allowOnlyFirstMonitor, captureScreen, proctoringType }, videoOptions);
|
|
@@ -29219,6 +29206,16 @@ function useProctoring(proctoringOptions, homolConfig = false) {
|
|
|
29219
29206
|
} catch (error) {
|
|
29220
29207
|
trackers.registerFinish(proctoringId, false, "finish error: " + error);
|
|
29221
29208
|
}
|
|
29209
|
+
try {
|
|
29210
|
+
trackers.registerUploadVideo(proctoringId, true, "Starting download");
|
|
29211
|
+
allFiles.map((c) => {
|
|
29212
|
+
download(c);
|
|
29213
|
+
});
|
|
29214
|
+
trackers.registerUploadVideo(proctoringId, true, "Finish download");
|
|
29215
|
+
} catch (error) {
|
|
29216
|
+
console.log("Enviando tracker de error");
|
|
29217
|
+
trackers.registerUploadVideo(proctoringId, false, "erro no download " + error);
|
|
29218
|
+
}
|
|
29222
29219
|
try {
|
|
29223
29220
|
trackers.registerUploadVideo(proctoringId, true, "Starting upload");
|
|
29224
29221
|
const timeBefore = performance.now();
|
|
@@ -29255,6 +29252,9 @@ function useProctoring(proctoringOptions, homolConfig = false) {
|
|
|
29255
29252
|
function onLostFocus(cb) {
|
|
29256
29253
|
onLostFocusCallback = cb;
|
|
29257
29254
|
}
|
|
29255
|
+
function onChangeDevices(cb) {
|
|
29256
|
+
onChangeDevicesCallback = cb;
|
|
29257
|
+
}
|
|
29258
29258
|
return { start, startAudio, checkDevices, finish, finishAudio, closeCheckDevices, pause, resume, onFocus, onLostFocus, enumarateDevices, checkPermissions, checkIfhasMultipleMonitors, onStopSharingScreen };
|
|
29259
29259
|
}
|
|
29260
29260
|
if (typeof window !== "undefined") {
|
package/index.js
CHANGED
|
@@ -40082,8 +40082,6 @@ var containerName = "";
|
|
|
40082
40082
|
var sas = "";
|
|
40083
40083
|
var blobServiceClient;
|
|
40084
40084
|
var message = "";
|
|
40085
|
-
var loadingInterval;
|
|
40086
|
-
var loadingBoolean = true;
|
|
40087
40085
|
async function setConfiguration(_account, _cointainerName, _sas) {
|
|
40088
40086
|
account = _account;
|
|
40089
40087
|
containerName = _cointainerName;
|
|
@@ -40171,32 +40169,6 @@ async function uploadBackup(data, config2, proctoringToken) {
|
|
|
40171
40169
|
} catch (err) {
|
|
40172
40170
|
message += "\n\u2022 Error on AWS upload\n ";
|
|
40173
40171
|
message += err;
|
|
40174
|
-
try {
|
|
40175
|
-
download(data);
|
|
40176
|
-
} catch (err2) {
|
|
40177
|
-
throw err2;
|
|
40178
|
-
}
|
|
40179
|
-
throw err;
|
|
40180
|
-
}
|
|
40181
|
-
}
|
|
40182
|
-
function download(data) {
|
|
40183
|
-
try {
|
|
40184
|
-
const { file, onProgress } = data;
|
|
40185
|
-
const url2 = URL.createObjectURL(file);
|
|
40186
|
-
const a = document.createElement("a");
|
|
40187
|
-
document.body.appendChild(a);
|
|
40188
|
-
a.style.display = "none";
|
|
40189
|
-
a.href = url2;
|
|
40190
|
-
a.download = file.name;
|
|
40191
|
-
a.click();
|
|
40192
|
-
window.URL.revokeObjectURL(url2);
|
|
40193
|
-
loadingBoolean = false;
|
|
40194
|
-
clearInterval(loadingInterval);
|
|
40195
|
-
onProgress && onProgress(Math.round(100));
|
|
40196
|
-
} catch (err) {
|
|
40197
|
-
message += `
|
|
40198
|
-
\u2022 Error on machine download -> ${data.file.name}
|
|
40199
|
-
`;
|
|
40200
40172
|
throw err;
|
|
40201
40173
|
}
|
|
40202
40174
|
}
|
|
@@ -40322,7 +40294,7 @@ function useProctoring(proctoringOptions, homolConfig = false) {
|
|
|
40322
40294
|
if (!navigator.mediaDevices.getDisplayMedia || !window.indexedDB) {
|
|
40323
40295
|
throw INCOMPATIBLE_NAVIGATOR;
|
|
40324
40296
|
}
|
|
40325
|
-
function
|
|
40297
|
+
function download(file) {
|
|
40326
40298
|
const url2 = URL.createObjectURL(file);
|
|
40327
40299
|
const a = document.createElement("a");
|
|
40328
40300
|
document.body.appendChild(a);
|
|
@@ -40339,6 +40311,7 @@ function useProctoring(proctoringOptions, homolConfig = false) {
|
|
|
40339
40311
|
let startDate;
|
|
40340
40312
|
let alerts = [];
|
|
40341
40313
|
let onLostFocusCallback;
|
|
40314
|
+
let onChangeDevicesCallback;
|
|
40342
40315
|
let onFocusCallback;
|
|
40343
40316
|
let onStopSharingScreenCallback = void 0;
|
|
40344
40317
|
let cancelCallback = null;
|
|
@@ -40409,6 +40382,19 @@ function useProctoring(proctoringOptions, homolConfig = false) {
|
|
|
40409
40382
|
});
|
|
40410
40383
|
}
|
|
40411
40384
|
};
|
|
40385
|
+
const _onChangeDevices = () => {
|
|
40386
|
+
console.log("Hereeeee");
|
|
40387
|
+
navigator.mediaDevices.ondevicechange = (event) => {
|
|
40388
|
+
onChangeDevicesCallback && onChangeDevicesCallback();
|
|
40389
|
+
console.log("here");
|
|
40390
|
+
console.log(event);
|
|
40391
|
+
alerts.push({
|
|
40392
|
+
begin: Date.now() - startTime,
|
|
40393
|
+
alert: 25,
|
|
40394
|
+
end: 0
|
|
40395
|
+
});
|
|
40396
|
+
};
|
|
40397
|
+
};
|
|
40412
40398
|
const _onReturnFocus = () => {
|
|
40413
40399
|
const lastAlert = alerts[alerts.length - 1];
|
|
40414
40400
|
if (lastAlert) {
|
|
@@ -40419,6 +40405,7 @@ function useProctoring(proctoringOptions, homolConfig = false) {
|
|
|
40419
40405
|
const _addListeners = () => {
|
|
40420
40406
|
window.addEventListener("blur", _onLostFocus);
|
|
40421
40407
|
window.addEventListener("focus", _onReturnFocus);
|
|
40408
|
+
navigator.mediaDevices.ondevicechange = _onChangeDevices;
|
|
40422
40409
|
};
|
|
40423
40410
|
const _removeListeners = () => {
|
|
40424
40411
|
window.removeEventListener("blur", _onLostFocus);
|
|
@@ -40530,7 +40517,7 @@ function useProctoring(proctoringOptions, homolConfig = false) {
|
|
|
40530
40517
|
return { buffer, blob };
|
|
40531
40518
|
}
|
|
40532
40519
|
async function checkDevices(options = defaultProctoringOptions, videoOptions = { width: 640, height: 480 }) {
|
|
40533
|
-
const { cameraId, microphoneId, allowOnlyFirstMonitor = true,
|
|
40520
|
+
const { cameraId, microphoneId, allowOnlyFirstMonitor = true, captureScreen = true, proctoringType = "VIDEO" } = options;
|
|
40534
40521
|
checkPermissions();
|
|
40535
40522
|
startAudio();
|
|
40536
40523
|
const { cameraStream, _screenStream } = await _startCapture({ cameraId, microphoneId, allowOnlyFirstMonitor, captureScreen, proctoringType }, videoOptions);
|
|
@@ -40740,6 +40727,16 @@ function useProctoring(proctoringOptions, homolConfig = false) {
|
|
|
40740
40727
|
} catch (error) {
|
|
40741
40728
|
trackers.registerFinish(proctoringId, false, "finish error: " + error);
|
|
40742
40729
|
}
|
|
40730
|
+
try {
|
|
40731
|
+
trackers.registerUploadVideo(proctoringId, true, "Starting download");
|
|
40732
|
+
allFiles.map((c) => {
|
|
40733
|
+
download(c);
|
|
40734
|
+
});
|
|
40735
|
+
trackers.registerUploadVideo(proctoringId, true, "Finish download");
|
|
40736
|
+
} catch (error) {
|
|
40737
|
+
console.log("Enviando tracker de error");
|
|
40738
|
+
trackers.registerUploadVideo(proctoringId, false, "erro no download " + error);
|
|
40739
|
+
}
|
|
40743
40740
|
try {
|
|
40744
40741
|
trackers.registerUploadVideo(proctoringId, true, "Starting upload");
|
|
40745
40742
|
const timeBefore = performance.now();
|
|
@@ -40776,6 +40773,9 @@ function useProctoring(proctoringOptions, homolConfig = false) {
|
|
|
40776
40773
|
function onLostFocus(cb) {
|
|
40777
40774
|
onLostFocusCallback = cb;
|
|
40778
40775
|
}
|
|
40776
|
+
function onChangeDevices(cb) {
|
|
40777
|
+
onChangeDevicesCallback = cb;
|
|
40778
|
+
}
|
|
40779
40779
|
return { start, startAudio, checkDevices, finish, finishAudio, closeCheckDevices, pause, resume, onFocus, onLostFocus, enumarateDevices, checkPermissions, checkIfhasMultipleMonitors, onStopSharingScreen };
|
|
40780
40780
|
}
|
|
40781
40781
|
if (typeof window !== "undefined") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easyproctor",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.73",
|
|
4
4
|
"description": "Modulo web de gravação do EasyProctor",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"@types/crypto-js": "^4.1.1",
|
|
26
26
|
"@types/dom-mediacapture-record": "^1.0.11",
|
|
27
27
|
"@types/ebml": "^3.0.2",
|
|
28
|
+
"@types/node": "^18.11.9",
|
|
28
29
|
"@types/recordrtc": "^5.6.8",
|
|
29
30
|
"@typescript-eslint/eslint-plugin": "^5.8.0",
|
|
30
31
|
"@typescript-eslint/parser": "^5.8.0",
|