@newtonschool/react_proctoring_library 0.0.99 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newtonschool/react_proctoring_library",
3
- "version": "0.0.99",
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",