easyproctor 1.1.8 → 1.1.10

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.
@@ -10,6 +10,7 @@ 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
12
  export declare const ANOTHER_STREAM_ACTIVE = "another_stream_active";
13
+ export declare const STREAM_UNDER_MINIMUM_PERMITTED = "stream_under_minimum_permitted";
13
14
  export declare const BROWSER_NOT_SUPPORTED = "browser_not_supported";
14
15
  export declare const TOKEN_MISSING = "token_missing";
15
16
  export declare const CREDENTIALS_MISSING = "credentials_missing";
package/esm/index.js CHANGED
@@ -17376,6 +17376,7 @@ var MULTIPLE_MONITORS_DETECTED = "multiple_monitors_detected";
17376
17376
  var PROCTORING_ALREADY_STARTED = "proctoring_already_started";
17377
17377
  var PROCTORING_NOT_STARTED = "proctoring_not_started";
17378
17378
  var ANOTHER_STREAM_ACTIVE = "another_stream_active";
17379
+ var STREAM_UNDER_MINIMUM_PERMITTED = "stream_under_minimum_permitted";
17379
17380
  var BROWSER_NOT_SUPPORTED = "browser_not_supported";
17380
17381
  var TOKEN_MISSING = "token_missing";
17381
17382
  var CREDENTIALS_MISSING = "credentials_missing";
@@ -17400,7 +17401,9 @@ var CameraRecorder = class {
17400
17401
  };
17401
17402
  this.videoOptions = {
17402
17403
  width: 640,
17403
- height: 480
17404
+ height: 480,
17405
+ minWidth: 0,
17406
+ minHeight: 0
17404
17407
  };
17405
17408
  this.blobsRTC = [];
17406
17409
  this.imageCount = 0;
@@ -17448,7 +17451,9 @@ var CameraRecorder = class {
17448
17451
  this.recordingResume = resumeRecording;
17449
17452
  this.recordingStart();
17450
17453
  const settings = this.cameraStream.getVideoTracks()[0].getSettings();
17451
- if (this.videoOptions.width !== settings.width || this.videoOptions.height !== settings.height) {
17454
+ if (this.videoOptions.minWidth > settings.width || this.videoOptions.minHeight > settings.height) {
17455
+ throw STREAM_UNDER_MINIMUM_PERMITTED;
17456
+ } else if (this.videoOptions.width !== settings.width || this.videoOptions.height !== settings.height) {
17452
17457
  trackers.registerAnotherStream(this.proctoringId, `Maybe have another stream active
17453
17458
  Video Options: ${this.videoOptions}
17454
17459
  Setting: ${settings}`);
@@ -17872,7 +17877,9 @@ function validatePartialVideoOptions(options) {
17872
17877
  if (!!options.width && !!options.height) {
17873
17878
  return {
17874
17879
  width: options.width,
17875
- height: options.height
17880
+ height: options.height,
17881
+ minWidth: options.minWidth,
17882
+ minHeight: options.minHeight
17876
17883
  };
17877
17884
  } else {
17878
17885
  return { width: 640, height: 480 };
@@ -18751,7 +18758,7 @@ var ScreenRecorder = class {
18751
18758
  const displayMediaStreamConstraints = {
18752
18759
  video: {
18753
18760
  cursor: "always",
18754
- width: 640,
18761
+ width: 854,
18755
18762
  height: 480,
18756
18763
  displaySurface: "monitor"
18757
18764
  },
@@ -19083,7 +19090,9 @@ var Proctoring = class {
19083
19090
  },
19084
19091
  {
19085
19092
  width: this.videoOptions.width,
19086
- height: this.videoOptions.height
19093
+ height: this.videoOptions.height,
19094
+ minWidth: this.videoOptions.minWidth,
19095
+ minHeight: this.videoOptions.minHeight
19087
19096
  },
19088
19097
  this.paramsConfig.imageParams,
19089
19098
  this.backend,
@@ -19147,8 +19156,6 @@ var Proctoring = class {
19147
19156
  this.proctoringSession = new ProctoringSession();
19148
19157
  this.allRecorders = this.createRecorders(this.sessionOptions);
19149
19158
  await this.recorder.startAll();
19150
- console.log("this.geolocation");
19151
- console.log(this.geolocation);
19152
19159
  const startResponse = await this.backend.confirmStart(
19153
19160
  {
19154
19161
  clientId: this.context.clientId,
package/index.js CHANGED
@@ -28924,6 +28924,7 @@ var MULTIPLE_MONITORS_DETECTED = "multiple_monitors_detected";
28924
28924
  var PROCTORING_ALREADY_STARTED = "proctoring_already_started";
28925
28925
  var PROCTORING_NOT_STARTED = "proctoring_not_started";
28926
28926
  var ANOTHER_STREAM_ACTIVE = "another_stream_active";
28927
+ var STREAM_UNDER_MINIMUM_PERMITTED = "stream_under_minimum_permitted";
28927
28928
  var BROWSER_NOT_SUPPORTED = "browser_not_supported";
28928
28929
  var TOKEN_MISSING = "token_missing";
28929
28930
  var CREDENTIALS_MISSING = "credentials_missing";
@@ -28948,7 +28949,9 @@ var CameraRecorder = class {
28948
28949
  };
28949
28950
  this.videoOptions = {
28950
28951
  width: 640,
28951
- height: 480
28952
+ height: 480,
28953
+ minWidth: 0,
28954
+ minHeight: 0
28952
28955
  };
28953
28956
  this.blobsRTC = [];
28954
28957
  this.imageCount = 0;
@@ -28996,7 +28999,9 @@ var CameraRecorder = class {
28996
28999
  this.recordingResume = resumeRecording;
28997
29000
  this.recordingStart();
28998
29001
  const settings = this.cameraStream.getVideoTracks()[0].getSettings();
28999
- if (this.videoOptions.width !== settings.width || this.videoOptions.height !== settings.height) {
29002
+ if (this.videoOptions.minWidth > settings.width || this.videoOptions.minHeight > settings.height) {
29003
+ throw STREAM_UNDER_MINIMUM_PERMITTED;
29004
+ } else if (this.videoOptions.width !== settings.width || this.videoOptions.height !== settings.height) {
29000
29005
  trackers.registerAnotherStream(this.proctoringId, `Maybe have another stream active
29001
29006
  Video Options: ${this.videoOptions}
29002
29007
  Setting: ${settings}`);
@@ -29420,7 +29425,9 @@ function validatePartialVideoOptions(options) {
29420
29425
  if (!!options.width && !!options.height) {
29421
29426
  return {
29422
29427
  width: options.width,
29423
- height: options.height
29428
+ height: options.height,
29429
+ minWidth: options.minWidth,
29430
+ minHeight: options.minHeight
29424
29431
  };
29425
29432
  } else {
29426
29433
  return { width: 640, height: 480 };
@@ -30299,7 +30306,7 @@ var ScreenRecorder = class {
30299
30306
  const displayMediaStreamConstraints = {
30300
30307
  video: {
30301
30308
  cursor: "always",
30302
- width: 640,
30309
+ width: 854,
30303
30310
  height: 480,
30304
30311
  displaySurface: "monitor"
30305
30312
  },
@@ -30631,7 +30638,9 @@ var Proctoring = class {
30631
30638
  },
30632
30639
  {
30633
30640
  width: this.videoOptions.width,
30634
- height: this.videoOptions.height
30641
+ height: this.videoOptions.height,
30642
+ minWidth: this.videoOptions.minWidth,
30643
+ minHeight: this.videoOptions.minHeight
30635
30644
  },
30636
30645
  this.paramsConfig.imageParams,
30637
30646
  this.backend,
@@ -30695,8 +30704,6 @@ var Proctoring = class {
30695
30704
  this.proctoringSession = new ProctoringSession();
30696
30705
  this.allRecorders = this.createRecorders(this.sessionOptions);
30697
30706
  await this.recorder.startAll();
30698
- console.log("this.geolocation");
30699
- console.log(this.geolocation);
30700
30707
  const startResponse = await this.backend.confirmStart(
30701
30708
  {
30702
30709
  clientId: this.context.clientId,
@@ -4,6 +4,7 @@ import { IRecorder } from "./IRecorder";
4
4
  import { BackendService } from "../backend/BackendService";
5
5
  import { UploadService } from "../upload/UploadService";
6
6
  import { ImageParams } from "../../interfaces/ParamsConfig";
7
+ import { ProctoringVideoOptions } from "../../proctoring/options/ProctoringVideoOptions";
7
8
  export declare class CameraRecorder implements IRecorder {
8
9
  private blobs;
9
10
  private imageParams;
@@ -27,10 +28,7 @@ export declare class CameraRecorder implements IRecorder {
27
28
  onBufferSizeError?: boolean;
28
29
  onBufferSizeErrorCallback: () => void;
29
30
  proctoringType?: "VIDEO" | "IMAGE";
30
- }, videoOptions: {
31
- width: number;
32
- height: number;
33
- }, imageParams?: ImageParams, backend?: BackendService, backendToken?: string);
31
+ }, videoOptions: ProctoringVideoOptions, imageParams?: ImageParams, backend?: BackendService, backendToken?: string);
34
32
  file?: File;
35
33
  recordingStart: () => any;
36
34
  recordingStop: () => any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easyproctor",
3
- "version": "1.1.8",
3
+ "version": "1.1.10",
4
4
  "description": "Modulo web de gravação do EasyProctor",
5
5
  "main": "./index.js",
6
6
  "module": "./esm/index.js",
@@ -1,5 +1,7 @@
1
1
  export interface ProctoringVideoOptions {
2
2
  width: number;
3
3
  height: number;
4
+ minWidth?: number;
5
+ minHeight?: number;
4
6
  }
5
7
  export declare function validatePartialVideoOptions(options: Partial<ProctoringVideoOptions>): ProctoringVideoOptions;