easyproctor 1.1.7 → 1.1.9
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 +13 -2
- package/index.js +13 -2
- package/new-flow/recorders/CameraRecorder.d.ts +1 -0
- package/package.json +1 -1
- package/plugins/mouseTracker.d.ts +15 -0
- package/unpkg/easyproctor.min.js +22 -22
- package/unpkg/easyproctor.min.js.map +1 -1
package/esm/index.js
CHANGED
|
@@ -17470,7 +17470,7 @@ Setting: ${settings}`);
|
|
|
17470
17470
|
let imageFile;
|
|
17471
17471
|
this.configImageCapture();
|
|
17472
17472
|
this.imageInterval = setInterval(async () => {
|
|
17473
|
-
this.canvas.getContext("2d").drawImage(this.video, 0, 0,
|
|
17473
|
+
this.canvas.getContext("2d").drawImage(this.video, 0, 0, this.videoOptions.width, this.videoOptions.height);
|
|
17474
17474
|
const image_data_url = this.canvas.toDataURL("image/jpeg");
|
|
17475
17475
|
imageFile = await this.getFile(image_data_url, `${this.proctoringId}_${this.imageCount + 1}.jpg`, "image/jpeg");
|
|
17476
17476
|
if (imageFile && this.upload && this.backendToken) {
|
|
@@ -17485,6 +17485,16 @@ Setting: ${settings}`);
|
|
|
17485
17485
|
}
|
|
17486
17486
|
}, this.imageParams.uploadInterval * 1e3);
|
|
17487
17487
|
}
|
|
17488
|
+
download(file) {
|
|
17489
|
+
const url = URL.createObjectURL(file);
|
|
17490
|
+
const a = document.createElement("a");
|
|
17491
|
+
document.body.appendChild(a);
|
|
17492
|
+
a.style.display = "none";
|
|
17493
|
+
a.href = url;
|
|
17494
|
+
a.download = file.name;
|
|
17495
|
+
a.click();
|
|
17496
|
+
window.URL.revokeObjectURL(url);
|
|
17497
|
+
}
|
|
17488
17498
|
async saveOnSession(session) {
|
|
17489
17499
|
const settings = this.cameraStream.getVideoTracks()[0].getSettings();
|
|
17490
17500
|
const settingsAudio = this.cameraStream.getAudioTracks()[0].getSettings();
|
|
@@ -17953,6 +17963,7 @@ var DeviceChecker = class {
|
|
|
17953
17963
|
divCamera.style.justifyContent = "space-between";
|
|
17954
17964
|
divCamera.style.borderBottom = "2px solid rgba(0, 0, 0, .1)";
|
|
17955
17965
|
divCamera.style.paddingBottom = "15px";
|
|
17966
|
+
divCamera.style.transform = "rotateY(180deg)";
|
|
17956
17967
|
video.style.width = "20rem";
|
|
17957
17968
|
video.style.backgroundColor = "#000";
|
|
17958
17969
|
video.style.borderRadius = "10px";
|
|
@@ -18740,7 +18751,7 @@ var ScreenRecorder = class {
|
|
|
18740
18751
|
const displayMediaStreamConstraints = {
|
|
18741
18752
|
video: {
|
|
18742
18753
|
cursor: "always",
|
|
18743
|
-
width:
|
|
18754
|
+
width: 854,
|
|
18744
18755
|
height: 480,
|
|
18745
18756
|
displaySurface: "monitor"
|
|
18746
18757
|
},
|
package/index.js
CHANGED
|
@@ -29018,7 +29018,7 @@ Setting: ${settings}`);
|
|
|
29018
29018
|
let imageFile;
|
|
29019
29019
|
this.configImageCapture();
|
|
29020
29020
|
this.imageInterval = setInterval(async () => {
|
|
29021
|
-
this.canvas.getContext("2d").drawImage(this.video, 0, 0,
|
|
29021
|
+
this.canvas.getContext("2d").drawImage(this.video, 0, 0, this.videoOptions.width, this.videoOptions.height);
|
|
29022
29022
|
const image_data_url = this.canvas.toDataURL("image/jpeg");
|
|
29023
29023
|
imageFile = await this.getFile(image_data_url, `${this.proctoringId}_${this.imageCount + 1}.jpg`, "image/jpeg");
|
|
29024
29024
|
if (imageFile && this.upload && this.backendToken) {
|
|
@@ -29033,6 +29033,16 @@ Setting: ${settings}`);
|
|
|
29033
29033
|
}
|
|
29034
29034
|
}, this.imageParams.uploadInterval * 1e3);
|
|
29035
29035
|
}
|
|
29036
|
+
download(file) {
|
|
29037
|
+
const url2 = URL.createObjectURL(file);
|
|
29038
|
+
const a = document.createElement("a");
|
|
29039
|
+
document.body.appendChild(a);
|
|
29040
|
+
a.style.display = "none";
|
|
29041
|
+
a.href = url2;
|
|
29042
|
+
a.download = file.name;
|
|
29043
|
+
a.click();
|
|
29044
|
+
window.URL.revokeObjectURL(url2);
|
|
29045
|
+
}
|
|
29036
29046
|
async saveOnSession(session) {
|
|
29037
29047
|
const settings = this.cameraStream.getVideoTracks()[0].getSettings();
|
|
29038
29048
|
const settingsAudio = this.cameraStream.getAudioTracks()[0].getSettings();
|
|
@@ -29501,6 +29511,7 @@ var DeviceChecker = class {
|
|
|
29501
29511
|
divCamera.style.justifyContent = "space-between";
|
|
29502
29512
|
divCamera.style.borderBottom = "2px solid rgba(0, 0, 0, .1)";
|
|
29503
29513
|
divCamera.style.paddingBottom = "15px";
|
|
29514
|
+
divCamera.style.transform = "rotateY(180deg)";
|
|
29504
29515
|
video.style.width = "20rem";
|
|
29505
29516
|
video.style.backgroundColor = "#000";
|
|
29506
29517
|
video.style.borderRadius = "10px";
|
|
@@ -30288,7 +30299,7 @@ var ScreenRecorder = class {
|
|
|
30288
30299
|
const displayMediaStreamConstraints = {
|
|
30289
30300
|
video: {
|
|
30290
30301
|
cursor: "always",
|
|
30291
|
-
width:
|
|
30302
|
+
width: 854,
|
|
30292
30303
|
height: 480,
|
|
30293
30304
|
displaySurface: "monitor"
|
|
30294
30305
|
},
|
|
@@ -43,6 +43,7 @@ export declare class CameraRecorder implements IRecorder {
|
|
|
43
43
|
pauseRecording(): Promise<void>;
|
|
44
44
|
resumeRecording(): Promise<void>;
|
|
45
45
|
photoShotsCycle(): void;
|
|
46
|
+
download(file: File): void;
|
|
46
47
|
saveOnSession(session: ProctoringSession): Promise<void>;
|
|
47
48
|
getFile(file: string, name: string, type: string): Promise<File>;
|
|
48
49
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BackendService } from "../new-flow/backend/BackendService";
|
|
2
|
+
interface mousePosition {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
}
|
|
6
|
+
export declare class MouseTracker {
|
|
7
|
+
backend: BackendService;
|
|
8
|
+
tracking: boolean;
|
|
9
|
+
mousePositions: mousePosition[];
|
|
10
|
+
constructor();
|
|
11
|
+
init(): void;
|
|
12
|
+
stop(): void;
|
|
13
|
+
send(): any;
|
|
14
|
+
}
|
|
15
|
+
export {};
|