@newtonschool/react_proctoring_library 0.0.98 → 0.0.100

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.
@@ -60,7 +60,8 @@ const ProctorApp = _ref => {
60
60
  const [askPermissionAction, setAskPermissionAction] = (0, _react.useState)({
61
61
  screenshare: () => {},
62
62
  fullscreen: () => {},
63
- video: () => {}
63
+ video: () => {},
64
+ audio: () => {}
64
65
  });
65
66
  (0, _react.useEffect)(() => {
66
67
  acquireWakeUpLock();
@@ -57,6 +57,9 @@ const WebWebCam = _ref => {
57
57
  setAskPermissionAction(onAskPermissionAction => _objectSpread(_objectSpread({}, onAskPermissionAction), {}, {
58
58
  video: () => {
59
59
  window.location.reload();
60
+ },
61
+ audio: () => {
62
+ window.location.reload();
60
63
  }
61
64
  }));
62
65
  }, [setAskPermissionAction]);
@@ -94,17 +97,15 @@ const WebWebCam = _ref => {
94
97
  }
95
98
  }, [breachData]);
96
99
  (0, _react.useEffect)(() => {
97
- if ((0, _browserUtils.isChrome)()) {
98
- if ((0, _breachUtils.isAudioRequired)()) {
99
- (0, _webcamMicrophoneUtils.updateAudioPermissions)(setAudioPermission);
100
- (0, _webcamMicrophoneUtils.getAudioPermissionQuery)().then(status => {
101
- status.onchange = evt => {
102
- (0, _webcamMicrophoneUtils.updateAudioPermissions)(setAudioPermission);
103
- };
104
- }).catch(err => {
105
- (0, _webcamMicrophoneUtils.updateAudioPermissions)('Audio Permission', err);
106
- });
107
- }
100
+ if ((0, _browserUtils.isChrome)() && proctorParams.audio) {
101
+ (0, _webcamMicrophoneUtils.updateAudioPermissions)(setAudioPermission);
102
+ (0, _webcamMicrophoneUtils.getAudioPermissionQuery)().then(status => {
103
+ status.onchange = evt => {
104
+ (0, _webcamMicrophoneUtils.updateAudioPermissions)(setAudioPermission);
105
+ };
106
+ }).catch(err => {
107
+ (0, _webcamMicrophoneUtils.updateAudioPermissions)('Audio Permission', err);
108
+ });
108
109
  }
109
110
  }, [setVideoPermission, setAudioPermission, proctorParams]);
110
111
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
@@ -41,7 +41,8 @@ const INITIAL_STATISTICS = exports.INITIAL_STATISTICS = {
41
41
  const proctorParamsToPermission = exports.proctorParamsToPermission = {
42
42
  fullscreenExit: 'fullscreen',
43
43
  webcamSnapshots: 'video',
44
- screenshareSnapshots: 'screenshare'
44
+ screenshareSnapshots: 'screenshare',
45
+ audio: 'audio'
45
46
  };
46
47
  const evaluateVideoIntervalInSeconds = exports.evaluateVideoIntervalInSeconds = 5;
47
48
  const gpuTypes = exports.gpuTypes = ['intel', 'apple', 'amd', 'radeon', 'nvidia', 'geforce'];
package/dist/index.js CHANGED
@@ -15,12 +15,6 @@ Object.defineProperty(exports, "ProctoredContextApp", {
15
15
  return _components.ProctoredContextApp;
16
16
  }
17
17
  });
18
- Object.defineProperty(exports, "useCleanupPermissions", {
19
- enumerable: true,
20
- get: function get() {
21
- return _useCleanupPermissions.useCleanupPermissions;
22
- }
23
- });
24
18
  Object.defineProperty(exports, "useIsElectron", {
25
19
  enumerable: true,
26
20
  get: function get() {
@@ -29,5 +23,4 @@ Object.defineProperty(exports, "useIsElectron", {
29
23
  });
30
24
  var _components = require("./components");
31
25
  var _useIsElectron = _interopRequireDefault(require("./hooks/electron/useIsElectron"));
32
- var _useCleanupPermissions = require("./hooks/useCleanupPermissions");
33
26
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "useCleanupPermissions", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _useCleanupPermissions.useCleanupPermissions;
10
+ }
11
+ });
12
+ var _useCleanupPermissions = require("./hooks/useCleanupPermissions");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newtonschool/react_proctoring_library",
3
- "version": "0.0.98",
3
+ "version": "0.0.100",
4
4
  "description": "Used to proctor online tests",
5
5
  "author": "ayushkagrawal,shreyachandra,weastel",
6
6
  "main": "dist/index.js",
@@ -52,5 +52,9 @@
52
52
  "@babel/core": "7.16.7",
53
53
  "@babel/preset-env": "7.16.7",
54
54
  "react-scripts": ">=5.0.0"
55
+ },
56
+ "exports": {
57
+ ".": "./dist/index.js",
58
+ "./useCleanupPermissions": "./dist/useCleanupPermissions.js"
55
59
  }
56
60
  }