@newtonschool/react_proctoring_library 0.0.87 → 0.0.89
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.
|
@@ -13,11 +13,11 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
|
13
13
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
14
14
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
15
|
function ElectronScreenShare(_ref) {
|
|
16
|
+
var _config$fileUploadCon;
|
|
16
17
|
let {
|
|
17
18
|
setAskPermissionAction,
|
|
18
19
|
proctoredContext,
|
|
19
|
-
config
|
|
20
|
-
proctorParams
|
|
20
|
+
config
|
|
21
21
|
} = _ref;
|
|
22
22
|
const {
|
|
23
23
|
permissionSetter,
|
|
@@ -79,16 +79,19 @@ function ElectronScreenShare(_ref) {
|
|
|
79
79
|
streamId: newStreamId
|
|
80
80
|
});
|
|
81
81
|
};
|
|
82
|
+
const isRecurring = config === null || config === void 0 ? void 0 : config.recurring;
|
|
83
|
+
const screenShareConfig = config === null || config === void 0 ? void 0 : (_config$fileUploadCon = config.fileUploadConfig) === null || _config$fileUploadCon === void 0 ? void 0 : _config$fileUploadCon.screenShare;
|
|
82
84
|
(0, _react.useEffect)(() => {
|
|
83
|
-
|
|
84
|
-
if (streamDeviceId &&
|
|
85
|
+
console.log('streamDeviceId, isRecurring, screenShareConfig', streamDeviceId, isRecurring, screenShareConfig);
|
|
86
|
+
if (streamDeviceId && screenShareConfig && isRecurring) {
|
|
85
87
|
const snapshotIntervalID = startScreenShareSnapshot(streamDeviceId);
|
|
86
88
|
return () => {
|
|
87
89
|
endScreenShareSnapshot(snapshotIntervalID);
|
|
88
90
|
};
|
|
89
91
|
}
|
|
90
|
-
}, [streamDeviceId,
|
|
92
|
+
}, [streamDeviceId, isRecurring, screenShareConfig]);
|
|
91
93
|
(0, _react.useEffect)(() => {
|
|
94
|
+
console.log('streamDeviceId', streamDeviceId);
|
|
92
95
|
const permissionSetter = permission => {
|
|
93
96
|
setScreensharePermission(permission);
|
|
94
97
|
};
|
|
@@ -100,5 +103,6 @@ function ElectronScreenShare(_ref) {
|
|
|
100
103
|
window.electron.listener.removeListener(id, permissionSetter);
|
|
101
104
|
};
|
|
102
105
|
}, [streamDeviceId]);
|
|
106
|
+
console.log('streamDeviceId', isRecurring, screenShareConfig, streamDeviceId);
|
|
103
107
|
return null;
|
|
104
108
|
}
|
|
@@ -44,7 +44,7 @@ const WebWebCam = _ref => {
|
|
|
44
44
|
const recurringFetchIntervalRef = (0, _react.useRef)();
|
|
45
45
|
const {
|
|
46
46
|
recurring = false,
|
|
47
|
-
recurringFetchInterval =
|
|
47
|
+
recurringFetchInterval = 30000
|
|
48
48
|
} = config;
|
|
49
49
|
const setAudioPermission = permissionSetter.audio;
|
|
50
50
|
const setVideoPermission = permissionSetter.video;
|