easyproctor 1.1.14 → 1.1.15

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
@@ -15153,7 +15153,7 @@ var eventNames = {
15153
15153
  ANOTHER_STREAM: "another_stream",
15154
15154
  BROWSER_NOT_SUPPORTED: "browser_not_supported"
15155
15155
  };
15156
- var log = (eventName, properties) => backendService.log(eventName, properties);
15156
+ var log = (eventName, properties) => backendService && backendService.log(eventName, properties);
15157
15157
  var trackers = {
15158
15158
  registerStart: (proctoringId, success, description) => log(eventNames.START, { proctoringId, success, description }),
15159
15159
  registerFinish: (proctoringId, success, description) => log(eventNames.FINISH, { proctoringId, success, description }),
@@ -17457,6 +17457,8 @@ var CameraRecorder = class {
17457
17457
  if (this.videoOptions.minWidth > settings.width || this.videoOptions.minHeight > settings.height) {
17458
17458
  throw STREAM_UNDER_MINIMUM_PERMITTED;
17459
17459
  } else if (this.videoOptions.width !== settings.width || this.videoOptions.height !== settings.height) {
17460
+ console.log("this.videoOptions: ", this.videoOptions);
17461
+ console.log("settings: ", settings);
17460
17462
  trackers.registerAnotherStream(this.proctoringId, `Maybe have another stream active
17461
17463
  Video Options: ${this.videoOptions}
17462
17464
  Setting: ${settings}`);
@@ -17899,24 +17901,29 @@ var DeviceChecker = class {
17899
17901
  this.allowedResolution = true;
17900
17902
  }
17901
17903
  async checkDevices(options = getDefaultProctoringOptions, _videoOptions) {
17902
- this.options = {
17903
- ...getDefaultProctoringOptions,
17904
- ...options,
17905
- captureScreen: false,
17906
- allowMultipleMonitors: true,
17907
- allowOnlyFirstMonitor: false
17908
- };
17909
- this.videoOptions = { ...this.videoOptions, ..._videoOptions };
17910
- const { cameraId, microphoneId, result } = await this.checkDevicesInterface();
17911
- return new Promise((resolve) => {
17912
- resolve({
17913
- result,
17914
- cameraId,
17915
- microphoneId,
17916
- volumeRange: this.volumeMedia,
17917
- allowedResolution: this.allowedResolution
17904
+ try {
17905
+ this.options = {
17906
+ ...getDefaultProctoringOptions,
17907
+ ...options,
17908
+ captureScreen: false,
17909
+ allowMultipleMonitors: true,
17910
+ allowOnlyFirstMonitor: false
17911
+ };
17912
+ this.videoOptions = { ...this.videoOptions, ..._videoOptions };
17913
+ const { cameraId, microphoneId, result } = await this.checkDevicesInterface();
17914
+ return new Promise((resolve) => {
17915
+ resolve({
17916
+ result,
17917
+ cameraId,
17918
+ microphoneId,
17919
+ volumeRange: this.volumeMedia,
17920
+ allowedResolution: this.allowedResolution
17921
+ });
17918
17922
  });
17919
- });
17923
+ } catch (error) {
17924
+ this.closeCheckDevices();
17925
+ return Promise.reject(error);
17926
+ }
17920
17927
  }
17921
17928
  isUnderResolution() {
17922
17929
  const settings = this.cameraRecorder.cameraStream.getVideoTracks()[0].getSettings();
@@ -17928,7 +17935,7 @@ Para iniciar um exame utilize uma outra c\xE2mera.`;
17928
17935
  }
17929
17936
  }
17930
17937
  checkDevicesInterface() {
17931
- return new Promise((resolve) => {
17938
+ return new Promise((resolve, reject) => {
17932
17939
  const fullBg = document.createElement("div");
17933
17940
  fullBg.setAttribute("id", "checkDevices");
17934
17941
  fullBg.style.backgroundColor = "rgba(0,0,0,0.4)";
@@ -18113,7 +18120,7 @@ Para iniciar um exame utilize uma outra c\xE2mera.`;
18113
18120
  modal.appendChild(divBtn);
18114
18121
  fullBg.appendChild(modal);
18115
18122
  document.body.appendChild(fullBg);
18116
- this.startCheckDevices(this.options, this.videoOptions);
18123
+ this.startCheckDevices(this.options, this.videoOptions).catch((e) => reject(e));
18117
18124
  });
18118
18125
  }
18119
18126
  videoDeviceInterface(stream) {
package/index.js CHANGED
@@ -25873,7 +25873,7 @@ var eventNames = {
25873
25873
  ANOTHER_STREAM: "another_stream",
25874
25874
  BROWSER_NOT_SUPPORTED: "browser_not_supported"
25875
25875
  };
25876
- var log = (eventName, properties) => backendService.log(eventName, properties);
25876
+ var log = (eventName, properties) => backendService && backendService.log(eventName, properties);
25877
25877
  var trackers = {
25878
25878
  registerStart: (proctoringId, success, description) => log(eventNames.START, { proctoringId, success, description }),
25879
25879
  registerFinish: (proctoringId, success, description) => log(eventNames.FINISH, { proctoringId, success, description }),
@@ -29005,6 +29005,8 @@ var CameraRecorder = class {
29005
29005
  if (this.videoOptions.minWidth > settings.width || this.videoOptions.minHeight > settings.height) {
29006
29006
  throw STREAM_UNDER_MINIMUM_PERMITTED;
29007
29007
  } else if (this.videoOptions.width !== settings.width || this.videoOptions.height !== settings.height) {
29008
+ console.log("this.videoOptions: ", this.videoOptions);
29009
+ console.log("settings: ", settings);
29008
29010
  trackers.registerAnotherStream(this.proctoringId, `Maybe have another stream active
29009
29011
  Video Options: ${this.videoOptions}
29010
29012
  Setting: ${settings}`);
@@ -29447,24 +29449,29 @@ var DeviceChecker = class {
29447
29449
  this.allowedResolution = true;
29448
29450
  }
29449
29451
  async checkDevices(options = getDefaultProctoringOptions, _videoOptions) {
29450
- this.options = {
29451
- ...getDefaultProctoringOptions,
29452
- ...options,
29453
- captureScreen: false,
29454
- allowMultipleMonitors: true,
29455
- allowOnlyFirstMonitor: false
29456
- };
29457
- this.videoOptions = { ...this.videoOptions, ..._videoOptions };
29458
- const { cameraId, microphoneId, result } = await this.checkDevicesInterface();
29459
- return new Promise((resolve) => {
29460
- resolve({
29461
- result,
29462
- cameraId,
29463
- microphoneId,
29464
- volumeRange: this.volumeMedia,
29465
- allowedResolution: this.allowedResolution
29452
+ try {
29453
+ this.options = {
29454
+ ...getDefaultProctoringOptions,
29455
+ ...options,
29456
+ captureScreen: false,
29457
+ allowMultipleMonitors: true,
29458
+ allowOnlyFirstMonitor: false
29459
+ };
29460
+ this.videoOptions = { ...this.videoOptions, ..._videoOptions };
29461
+ const { cameraId, microphoneId, result } = await this.checkDevicesInterface();
29462
+ return new Promise((resolve) => {
29463
+ resolve({
29464
+ result,
29465
+ cameraId,
29466
+ microphoneId,
29467
+ volumeRange: this.volumeMedia,
29468
+ allowedResolution: this.allowedResolution
29469
+ });
29466
29470
  });
29467
- });
29471
+ } catch (error) {
29472
+ this.closeCheckDevices();
29473
+ return Promise.reject(error);
29474
+ }
29468
29475
  }
29469
29476
  isUnderResolution() {
29470
29477
  const settings = this.cameraRecorder.cameraStream.getVideoTracks()[0].getSettings();
@@ -29476,7 +29483,7 @@ Para iniciar um exame utilize uma outra c\xE2mera.`;
29476
29483
  }
29477
29484
  }
29478
29485
  checkDevicesInterface() {
29479
- return new Promise((resolve) => {
29486
+ return new Promise((resolve, reject) => {
29480
29487
  const fullBg = document.createElement("div");
29481
29488
  fullBg.setAttribute("id", "checkDevices");
29482
29489
  fullBg.style.backgroundColor = "rgba(0,0,0,0.4)";
@@ -29661,7 +29668,7 @@ Para iniciar um exame utilize uma outra c\xE2mera.`;
29661
29668
  modal.appendChild(divBtn);
29662
29669
  fullBg.appendChild(modal);
29663
29670
  document.body.appendChild(fullBg);
29664
- this.startCheckDevices(this.options, this.videoOptions);
29671
+ this.startCheckDevices(this.options, this.videoOptions).catch((e) => reject(e));
29665
29672
  });
29666
29673
  }
29667
29674
  videoDeviceInterface(stream4) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easyproctor",
3
- "version": "1.1.14",
3
+ "version": "1.1.15",
4
4
  "description": "Modulo web de gravação do EasyProctor",
5
5
  "main": "./index.js",
6
6
  "module": "./esm/index.js",