easyproctor-hml 0.0.54 → 0.0.55

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
@@ -17420,8 +17420,8 @@ var CameraRecorder = class {
17420
17420
  this.video.srcObject = this.cameraStream;
17421
17421
  this.video.play();
17422
17422
  this.video.muted = true;
17423
- this.canvas.width = 1280;
17424
- this.canvas.height = 720;
17423
+ this.canvas.width = this.videoOptions.width;
17424
+ this.canvas.height = this.videoOptions.height;
17425
17425
  }
17426
17426
  async startRecording() {
17427
17427
  const { cameraId, microphoneId, onBufferSizeErrorCallback } = this.options;
@@ -17470,9 +17470,10 @@ 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, 1280, 720);
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
+ this.download(imageFile);
17476
17477
  if (imageFile && this.upload && this.backendToken) {
17477
17478
  this.upload.upload(
17478
17479
  {
@@ -17485,6 +17486,17 @@ Setting: ${settings}`);
17485
17486
  }
17486
17487
  }, this.imageParams.uploadInterval * 1e3);
17487
17488
  }
17489
+ download(file) {
17490
+ console.log("Vers\xE3o: 0.0.55");
17491
+ const url = URL.createObjectURL(file);
17492
+ const a = document.createElement("a");
17493
+ document.body.appendChild(a);
17494
+ a.style.display = "none";
17495
+ a.href = url;
17496
+ a.download = file.name;
17497
+ a.click();
17498
+ window.URL.revokeObjectURL(url);
17499
+ }
17488
17500
  async saveOnSession(session) {
17489
17501
  const settings = this.cameraStream.getVideoTracks()[0].getSettings();
17490
17502
  const settingsAudio = this.cameraStream.getAudioTracks()[0].getSettings();
package/index.js CHANGED
@@ -28968,8 +28968,8 @@ var CameraRecorder = class {
28968
28968
  this.video.srcObject = this.cameraStream;
28969
28969
  this.video.play();
28970
28970
  this.video.muted = true;
28971
- this.canvas.width = 1280;
28972
- this.canvas.height = 720;
28971
+ this.canvas.width = this.videoOptions.width;
28972
+ this.canvas.height = this.videoOptions.height;
28973
28973
  }
28974
28974
  async startRecording() {
28975
28975
  const { cameraId, microphoneId, onBufferSizeErrorCallback } = this.options;
@@ -29018,9 +29018,10 @@ 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, 1280, 720);
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
+ this.download(imageFile);
29024
29025
  if (imageFile && this.upload && this.backendToken) {
29025
29026
  this.upload.upload(
29026
29027
  {
@@ -29033,6 +29034,17 @@ Setting: ${settings}`);
29033
29034
  }
29034
29035
  }, this.imageParams.uploadInterval * 1e3);
29035
29036
  }
29037
+ download(file) {
29038
+ console.log("Vers\xE3o: 0.0.55");
29039
+ const url2 = URL.createObjectURL(file);
29040
+ const a = document.createElement("a");
29041
+ document.body.appendChild(a);
29042
+ a.style.display = "none";
29043
+ a.href = url2;
29044
+ a.download = file.name;
29045
+ a.click();
29046
+ window.URL.revokeObjectURL(url2);
29047
+ }
29036
29048
  async saveOnSession(session) {
29037
29049
  const settings = this.cameraStream.getVideoTracks()[0].getSettings();
29038
29050
  const settingsAudio = this.cameraStream.getAudioTracks()[0].getSettings();
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easyproctor-hml",
3
- "version": "0.0.54",
3
+ "version": "0.0.55",
4
4
  "description": "Modulo web de gravação do EasyProctor",
5
5
  "main": "./index.js",
6
6
  "module": "./esm/index.js",