agora-appbuilder-core 4.0.20-beta.3 → 4.0.20-beta.5
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/package.json +1 -1
- package/template/src/auth/AuthProvider.tsx +0 -5
- package/template/src/auth/config.ts +1 -9
- package/template/src/components/Controls.tsx +1 -0
- package/template/src/components/Navbar.tsx +3 -1
- package/template/src/components/chat/chatConfigure.tsx +0 -1
- package/template/src/components/participants/Participant.tsx +18 -8
- package/template/src/components/precall/joinWaitingRoomBtn.native.tsx +3 -3
- package/template/src/components/precall/joinWaitingRoomBtn.tsx +3 -3
- package/template/src/components/recordings/recording-table.tsx +1 -1
- package/template/src/language/default-labels/videoCallScreenLabels.ts +3 -1
- package/template/src/rtm-events/constants.ts +5 -12
- package/template/src/subComponents/recording/useRecording.tsx +101 -56
- package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +12 -4
package/package.json
CHANGED
|
@@ -493,11 +493,6 @@ const AuthProvider = (props: AuthProviderProps) => {
|
|
|
493
493
|
);
|
|
494
494
|
throw new Error('Token not received');
|
|
495
495
|
} else {
|
|
496
|
-
isWeb() &&
|
|
497
|
-
sessionStorage.setItem(
|
|
498
|
-
'user_id',
|
|
499
|
-
JSON.parse(atob(response.token?.split('.')[1]))?.user_id,
|
|
500
|
-
);
|
|
501
496
|
enableTokenAuth(response.token)
|
|
502
497
|
.then(() => {
|
|
503
498
|
//set auth enabled on useEffect
|
|
@@ -24,12 +24,6 @@ export const getPlatformId = (): string => {
|
|
|
24
24
|
return platformID;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
export const getUserId = (): string => {
|
|
28
|
-
if (!isWeb()) return null;
|
|
29
|
-
const userId = sessionStorage.getItem('user_id');
|
|
30
|
-
return userId;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
27
|
export const getRequestHeaders = () => {
|
|
34
28
|
return {
|
|
35
29
|
'X-Project-ID': $config.PROJECT_ID,
|
|
@@ -53,9 +47,7 @@ export const getOriginURL = () => {
|
|
|
53
47
|
};
|
|
54
48
|
|
|
55
49
|
export const GET_UNAUTH_FLOW_API_ENDPOINT = () => {
|
|
56
|
-
const userId = getUserId();
|
|
57
|
-
const userIdParam = userId ? `&user_id=${userId}` : '';
|
|
58
50
|
return `${$config.BACKEND_ENDPOINT}/v1/login?project_id=${
|
|
59
51
|
$config.PROJECT_ID
|
|
60
|
-
}&platform_id=${getPlatformId()}
|
|
52
|
+
}&platform_id=${getPlatformId()}`;
|
|
61
53
|
};
|
|
@@ -895,6 +895,7 @@ export const MoreButtonToolbarItem = () => {
|
|
|
895
895
|
$config.ENABLE_CAPTION &&
|
|
896
896
|
(isHost || (!isHost && isSTTActive))) ||
|
|
897
897
|
$config.ENABLE_NOISE_CANCELLATION ||
|
|
898
|
+
(isHost && $config.CLOUD_RECORDING && isWeb()) ||
|
|
898
899
|
($config.ENABLE_VIRTUAL_BACKGROUND && !$config.AUDIO_ROOM) ||
|
|
899
900
|
(isHost && $config.ENABLE_WHITEBOARD && isWebInternal()) ? (
|
|
900
901
|
<ToolbarItem testID="more-btn">
|
|
@@ -430,7 +430,9 @@ export const ParticipantCountToolbarItem = () => {
|
|
|
430
430
|
);
|
|
431
431
|
};
|
|
432
432
|
export const RecordingStatusToolbarItem = () => {
|
|
433
|
-
const recordingLabel = useString(videoRoomRecordingText)(
|
|
433
|
+
const recordingLabel = useString(videoRoomRecordingText)(
|
|
434
|
+
$config.RECORDING_MODE,
|
|
435
|
+
);
|
|
434
436
|
const {isRecordingActive} = useRecording();
|
|
435
437
|
return isRecordingActive ? (
|
|
436
438
|
<ToolbarItem>
|
|
@@ -135,8 +135,8 @@ const Participant = (props: ParticipantInterface) => {
|
|
|
135
135
|
ref={moreIconRef}
|
|
136
136
|
collapsable={false}
|
|
137
137
|
style={{
|
|
138
|
-
width:
|
|
139
|
-
height:
|
|
138
|
+
width: 28,
|
|
139
|
+
height: 28,
|
|
140
140
|
alignSelf: 'center',
|
|
141
141
|
justifyContent: 'center',
|
|
142
142
|
alignItems: 'center',
|
|
@@ -188,14 +188,14 @@ const Participant = (props: ParticipantInterface) => {
|
|
|
188
188
|
{!$config.AUDIO_ROOM &&
|
|
189
189
|
(isLocal
|
|
190
190
|
? !isAudienceUser && (
|
|
191
|
-
<View>
|
|
191
|
+
<View style={styles.mlIcon}>
|
|
192
192
|
<LocalVideoMute
|
|
193
193
|
plainIconHoverEffect={true}
|
|
194
194
|
iconProps={(isVideoEnabled, isPermissionDenied) => {
|
|
195
195
|
return {
|
|
196
196
|
iconSize: 20,
|
|
197
197
|
iconType: 'plain',
|
|
198
|
-
iconContainerStyle:
|
|
198
|
+
iconContainerStyle: styles.iconContainerStyle,
|
|
199
199
|
showWarningIcon: false,
|
|
200
200
|
tintColor: isVideoEnabled
|
|
201
201
|
? $config.PRIMARY_ACTION_BRAND_COLOR
|
|
@@ -208,7 +208,7 @@ const Participant = (props: ParticipantInterface) => {
|
|
|
208
208
|
</View>
|
|
209
209
|
)
|
|
210
210
|
: !isAudienceUser && (
|
|
211
|
-
<View>
|
|
211
|
+
<View style={styles.mlIcon}>
|
|
212
212
|
<RemoteVideoMute
|
|
213
213
|
uid={user.uid}
|
|
214
214
|
video={user.video}
|
|
@@ -219,14 +219,14 @@ const Participant = (props: ParticipantInterface) => {
|
|
|
219
219
|
))}
|
|
220
220
|
{isLocal
|
|
221
221
|
? !isAudienceUser && (
|
|
222
|
-
<View>
|
|
222
|
+
<View style={styles.mlIcon}>
|
|
223
223
|
<LocalAudioMute
|
|
224
224
|
plainIconHoverEffect={true}
|
|
225
225
|
iconProps={(isAudioEnabled, isPermissionDenied) => {
|
|
226
226
|
return {
|
|
227
227
|
iconSize: 20,
|
|
228
228
|
iconType: 'plain',
|
|
229
|
-
iconContainerStyle:
|
|
229
|
+
iconContainerStyle: styles.iconContainerStyle,
|
|
230
230
|
showWarningIcon: false,
|
|
231
231
|
tintColor: isAudioEnabled
|
|
232
232
|
? $config.PRIMARY_ACTION_BRAND_COLOR
|
|
@@ -239,7 +239,7 @@ const Participant = (props: ParticipantInterface) => {
|
|
|
239
239
|
</View>
|
|
240
240
|
)
|
|
241
241
|
: !isAudienceUser && (
|
|
242
|
-
<View>
|
|
242
|
+
<View style={styles.mlIcon}>
|
|
243
243
|
<RemoteAudioMute
|
|
244
244
|
uid={user.uid}
|
|
245
245
|
audio={user.audio}
|
|
@@ -289,6 +289,13 @@ const styles = StyleSheet.create({
|
|
|
289
289
|
height: 36,
|
|
290
290
|
borderRadius: 18,
|
|
291
291
|
},
|
|
292
|
+
iconContainerStyle: {
|
|
293
|
+
width: 30,
|
|
294
|
+
height: 30,
|
|
295
|
+
display: 'flex',
|
|
296
|
+
alignItems: 'center',
|
|
297
|
+
justifyContent: 'center',
|
|
298
|
+
},
|
|
292
299
|
textStyle: {
|
|
293
300
|
fontSize: ThemeConfig.FontSize.tiny,
|
|
294
301
|
lineHeight: 12,
|
|
@@ -327,4 +334,7 @@ const styles = StyleSheet.create({
|
|
|
327
334
|
controlsContainer: {
|
|
328
335
|
backgroundColor: 'red',
|
|
329
336
|
},
|
|
337
|
+
mlIcon: {
|
|
338
|
+
marginLeft: 8,
|
|
339
|
+
},
|
|
330
340
|
});
|
|
@@ -128,9 +128,9 @@ const JoinWaitingRoomBtn = (props: PreCallJoinWaitingRoomBtnProps) => {
|
|
|
128
128
|
screenShareUid: screenShare.uid,
|
|
129
129
|
whiteboard,
|
|
130
130
|
chat: {
|
|
131
|
-
user_token: chat
|
|
132
|
-
group_id: chat
|
|
133
|
-
is_group_owner: chat
|
|
131
|
+
user_token: chat?.userToken,
|
|
132
|
+
group_id: chat?.groupId,
|
|
133
|
+
is_group_owner: chat?.isGroupOwner,
|
|
134
134
|
},
|
|
135
135
|
},
|
|
136
136
|
};
|
|
@@ -134,9 +134,9 @@ const JoinWaitingRoomBtn = (props: PreCallJoinWaitingRoomBtnProps) => {
|
|
|
134
134
|
screenShareUid: screenShare.uid,
|
|
135
135
|
whiteboard,
|
|
136
136
|
chat: {
|
|
137
|
-
user_token: chat
|
|
138
|
-
group_id: chat
|
|
139
|
-
is_group_owner: chat
|
|
137
|
+
user_token: chat?.userToken,
|
|
138
|
+
group_id: chat?.groupId,
|
|
139
|
+
is_group_owner: chat?.isGroupOwner,
|
|
140
140
|
},
|
|
141
141
|
},
|
|
142
142
|
};
|
|
@@ -64,7 +64,7 @@ function RTableBody({status, recordings}) {
|
|
|
64
64
|
if (
|
|
65
65
|
recordingStatus === 'STOPPING' ||
|
|
66
66
|
recordingStatus === 'STARTED' ||
|
|
67
|
-
recordingStatus === 'INPROGRESS'
|
|
67
|
+
(recordingStatus === 'INPROGRESS' && !item?.download_url)
|
|
68
68
|
) {
|
|
69
69
|
return (
|
|
70
70
|
<View key={item.id} style={style.pt12}>
|
|
@@ -1254,7 +1254,9 @@ export const VideoCallScreenLabels: I18nVideoCallScreenLabelsInterface = {
|
|
|
1254
1254
|
[waitingRoomApprovalRejectionToastSubHeading]:
|
|
1255
1255
|
'Permission to enter the meeting was denied by the host',
|
|
1256
1256
|
|
|
1257
|
-
[videoRoomRecordingText]:
|
|
1257
|
+
[videoRoomRecordingText]: mode =>
|
|
1258
|
+
mode === 'MIX' ? 'Cloud recording' : 'Web recording',
|
|
1259
|
+
|
|
1258
1260
|
[videoRoomGoToActiveSpeakerText]: 'Go To Active Speaker',
|
|
1259
1261
|
[videoRoomScreenshareText]: username => `${username}'s screenshare`,
|
|
1260
1262
|
[videoRoomStartingCallText]: 'Starting Call. Just a second.',
|
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
/** ***** EVENTS ACTIONS BEGINS***** */
|
|
2
|
-
//
|
|
3
|
-
const RECORDING_STARTED = 'RECORDING_STARTED';
|
|
4
|
-
const RECORDING_STOPPED = 'RECORDING_STOPPED';
|
|
5
|
-
const RECORDING_STARTED_BY = 'RECORDING_STARTED_BY';
|
|
6
|
-
const REQUEST_TO_STOP_RECORDING = 'REQUEST_TO_STOP_RECORDING';
|
|
7
|
-
// 2. SCREENSHARE
|
|
2
|
+
// 1. SCREENSHARE
|
|
8
3
|
const SCREENSHARE_STARTED = 'SCREENSHARE_STARTED';
|
|
9
4
|
const SCREENSHARE_STOPPED = 'SCREENSHARE_STOPPED';
|
|
10
5
|
|
|
11
6
|
const EventActions = {
|
|
12
|
-
RECORDING_STARTED_BY,
|
|
13
|
-
RECORDING_STARTED,
|
|
14
|
-
RECORDING_STOPPED,
|
|
15
|
-
REQUEST_TO_STOP_RECORDING,
|
|
16
7
|
SCREENSHARE_STARTED,
|
|
17
8
|
SCREENSHARE_STOPPED,
|
|
18
9
|
};
|
|
@@ -21,7 +12,8 @@ const EventActions = {
|
|
|
21
12
|
|
|
22
13
|
/** ***** EVENT NAMES BEGINS ***** */
|
|
23
14
|
// 1. RECORDING
|
|
24
|
-
const
|
|
15
|
+
const RECORDING_STATE_ATTRIBUTE = 'recording_state';
|
|
16
|
+
const RECORDING_STARTED_BY_ATTRIBUTE = 'recording_started_by';
|
|
25
17
|
// 2. SCREENSHARE
|
|
26
18
|
const SCREENSHARE_ATTRIBUTE = 'screenshare';
|
|
27
19
|
// 2. LIVE STREAMING
|
|
@@ -48,7 +40,8 @@ const BOARD_COLOR_CHANGED = 'BOARD_COLOR_CHANGED';
|
|
|
48
40
|
const WHITEBOARD_LAST_IMAGE_UPLOAD_POSITION = 'WHITEBOARD_L_I_U_P';
|
|
49
41
|
|
|
50
42
|
const EventNames = {
|
|
51
|
-
|
|
43
|
+
RECORDING_STATE_ATTRIBUTE,
|
|
44
|
+
RECORDING_STARTED_BY_ATTRIBUTE,
|
|
52
45
|
RAISED_ATTRIBUTE,
|
|
53
46
|
ROLE_ATTRIBUTE,
|
|
54
47
|
PUBLIC_CHAT_MESSAGE,
|
|
@@ -23,7 +23,7 @@ import {createHook} from 'customization-implementation';
|
|
|
23
23
|
import {useString} from '../../utils/useString';
|
|
24
24
|
import ChatContext from '../../components/ChatContext';
|
|
25
25
|
import events, {PersistanceLevel} from '../../rtm-events-api';
|
|
26
|
-
import {
|
|
26
|
+
import {EventNames} from '../../rtm-events';
|
|
27
27
|
import {useContent} from 'customization-api';
|
|
28
28
|
import {trimText} from '../../utils/common';
|
|
29
29
|
import {useRoomInfo} from 'customization-api';
|
|
@@ -109,6 +109,17 @@ interface RecordingProviderProps {
|
|
|
109
109
|
* Sends a control message to all users in the channel over RTM to indicate that
|
|
110
110
|
* Cloud recording has started/stopped.
|
|
111
111
|
*/
|
|
112
|
+
enum RECORDING_REQUEST_STATE {
|
|
113
|
+
PENDING = 'PENDING',
|
|
114
|
+
STARTED_MIX = 'STARTED_MIX',
|
|
115
|
+
STARTED_WEB = 'STARTED_WEB',
|
|
116
|
+
STOPPED = 'STOPPED',
|
|
117
|
+
FAILED = 'FAILED',
|
|
118
|
+
}
|
|
119
|
+
const RecordingActions = {
|
|
120
|
+
RECORDING_REQUEST_STATE: RECORDING_REQUEST_STATE,
|
|
121
|
+
REQUEST_TO_STOP_RECORDING: 'REQUEST_TO_STOP_RECORDING',
|
|
122
|
+
};
|
|
112
123
|
|
|
113
124
|
const recordingMode = $config.RECORDING_MODE || 'MIX';
|
|
114
125
|
|
|
@@ -193,10 +204,18 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
193
204
|
leadingIcon: null,
|
|
194
205
|
});
|
|
195
206
|
}
|
|
196
|
-
}, [isRecordingActive, callActive, isHost]);
|
|
207
|
+
}, [isRecordingActive, callActive, isHost, uidWhoStarted]);
|
|
197
208
|
|
|
198
209
|
const startRecording = () => {
|
|
199
210
|
log('start recording API called');
|
|
211
|
+
if (inProgress) {
|
|
212
|
+
logger.error(
|
|
213
|
+
LogSource.Internals,
|
|
214
|
+
'RECORDING',
|
|
215
|
+
'start recording already in progress. Aborting..',
|
|
216
|
+
);
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
200
219
|
logger.log(
|
|
201
220
|
LogSource.NetworkRest,
|
|
202
221
|
'recording_start',
|
|
@@ -208,12 +227,6 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
208
227
|
let recordinghostURL = getOriginURL();
|
|
209
228
|
// let recordinghostURL =
|
|
210
229
|
// 'https://app-builder-core-git-hotfix-recording-bot-ends-r-253634-agoraio.vercel.app';
|
|
211
|
-
if (inProgress) {
|
|
212
|
-
console.error(
|
|
213
|
-
'web-recording - start recording API already in progress',
|
|
214
|
-
);
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
230
|
if (recordinghostURL.includes('localhost')) {
|
|
218
231
|
console.error(
|
|
219
232
|
'web-recording - Recording url cannot be localhost. It should be a valid deployed URL',
|
|
@@ -224,6 +237,14 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
224
237
|
url = `${recordinghostURL}/${passphrase}`;
|
|
225
238
|
}
|
|
226
239
|
setInProgress(true);
|
|
240
|
+
events.send(
|
|
241
|
+
EventNames.RECORDING_STATE_ATTRIBUTE,
|
|
242
|
+
JSON.stringify({
|
|
243
|
+
action: RecordingActions.RECORDING_REQUEST_STATE.PENDING,
|
|
244
|
+
value: `${localUid}`,
|
|
245
|
+
}),
|
|
246
|
+
PersistanceLevel.Session,
|
|
247
|
+
);
|
|
227
248
|
logger.debug(
|
|
228
249
|
LogSource.NetworkRest,
|
|
229
250
|
'recording_start',
|
|
@@ -256,24 +277,28 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
256
277
|
'start recording successfully',
|
|
257
278
|
res,
|
|
258
279
|
);
|
|
259
|
-
|
|
260
|
-
* 1. Once the backend sucessfuly starts recording, send message
|
|
261
|
-
* in the channel indicating that cloud/web recording is now active.
|
|
262
|
-
*/
|
|
280
|
+
// 1. set the local recording state to true to update the UI
|
|
263
281
|
events.send(
|
|
264
|
-
EventNames.
|
|
282
|
+
EventNames.RECORDING_STARTED_BY_ATTRIBUTE,
|
|
265
283
|
JSON.stringify({
|
|
266
|
-
action:
|
|
284
|
+
action: '',
|
|
267
285
|
value: `${localUid}`,
|
|
268
286
|
}),
|
|
269
287
|
PersistanceLevel.Session,
|
|
270
288
|
);
|
|
271
|
-
// 2. set the local recording state to true to update the UI
|
|
272
289
|
setUidWhoStarted(localUid);
|
|
273
|
-
//
|
|
290
|
+
// 2. Check if recording mode is cloud
|
|
274
291
|
if (recordingMode === 'MIX') {
|
|
275
292
|
setInProgress(false);
|
|
276
293
|
setRecordingActive(true);
|
|
294
|
+
events.send(
|
|
295
|
+
EventNames.RECORDING_STATE_ATTRIBUTE,
|
|
296
|
+
JSON.stringify({
|
|
297
|
+
action: RecordingActions.RECORDING_REQUEST_STATE.STARTED_MIX,
|
|
298
|
+
value: `${localUid}`,
|
|
299
|
+
}),
|
|
300
|
+
PersistanceLevel.Session,
|
|
301
|
+
);
|
|
277
302
|
// 3.a Set the presenter mode if screen share is active
|
|
278
303
|
// 3.b Get the most recent screenshare uid
|
|
279
304
|
const sorted = Object.entries(screenShareData)
|
|
@@ -292,21 +317,30 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
292
317
|
}
|
|
293
318
|
}
|
|
294
319
|
} else if (res.status === 500) {
|
|
295
|
-
setInProgress(false);
|
|
296
320
|
showErrorToast(headingStartError, subheadingError);
|
|
321
|
+
throw Error(`Internal server error ${res.status}`);
|
|
297
322
|
} else {
|
|
298
|
-
setInProgress(false);
|
|
299
323
|
showErrorToast(headingStartError);
|
|
324
|
+
throw Error(`Internal server error ${res.status}`);
|
|
300
325
|
}
|
|
301
326
|
})
|
|
302
327
|
.catch(err => {
|
|
328
|
+
setRecordingActive(false);
|
|
329
|
+
setInProgress(false);
|
|
330
|
+
events.send(
|
|
331
|
+
EventNames.RECORDING_STATE_ATTRIBUTE,
|
|
332
|
+
JSON.stringify({
|
|
333
|
+
action: RecordingActions.RECORDING_REQUEST_STATE.FAILED,
|
|
334
|
+
value: `${localUid}`,
|
|
335
|
+
}),
|
|
336
|
+
PersistanceLevel.Session,
|
|
337
|
+
);
|
|
303
338
|
logger.error(
|
|
304
339
|
LogSource.NetworkRest,
|
|
305
340
|
'recording_start',
|
|
306
341
|
'Error while start recording',
|
|
307
342
|
err,
|
|
308
343
|
);
|
|
309
|
-
setInProgress(false);
|
|
310
344
|
});
|
|
311
345
|
};
|
|
312
346
|
|
|
@@ -315,15 +349,6 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
315
349
|
* Any host in the channel can stop recording.
|
|
316
350
|
*/
|
|
317
351
|
logger.debug(LogSource.Internals, 'RECORDING', 'stop recording API called');
|
|
318
|
-
if (inProgress) {
|
|
319
|
-
logger.error(
|
|
320
|
-
LogSource.Internals,
|
|
321
|
-
'RECORDING',
|
|
322
|
-
'stop recording already in progress. Aborting..',
|
|
323
|
-
);
|
|
324
|
-
return;
|
|
325
|
-
}
|
|
326
|
-
setInProgress(true);
|
|
327
352
|
fetchRetry(`${$config.BACKEND_ENDPOINT}/v1/recording/stop`, {
|
|
328
353
|
method: 'POST',
|
|
329
354
|
headers: {
|
|
@@ -336,7 +361,6 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
336
361
|
}),
|
|
337
362
|
})
|
|
338
363
|
.then(res => {
|
|
339
|
-
// Bot when stops the recording, it does not reach here
|
|
340
364
|
setInProgress(false);
|
|
341
365
|
if (res.status === 200 || res.status === 202) {
|
|
342
366
|
logger.debug(
|
|
@@ -351,10 +375,10 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
351
375
|
*/
|
|
352
376
|
log('Recording-bot: recording stopped successfully');
|
|
353
377
|
events.send(
|
|
354
|
-
EventNames.
|
|
378
|
+
EventNames.RECORDING_STATE_ATTRIBUTE,
|
|
355
379
|
JSON.stringify({
|
|
356
|
-
action:
|
|
357
|
-
value:
|
|
380
|
+
action: RecordingActions.RECORDING_REQUEST_STATE.STOPPED,
|
|
381
|
+
value: `${localUid}`,
|
|
358
382
|
}),
|
|
359
383
|
PersistanceLevel.Session,
|
|
360
384
|
);
|
|
@@ -386,42 +410,50 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
386
410
|
setInProgress(false);
|
|
387
411
|
log('stop recording', err);
|
|
388
412
|
events.send(
|
|
389
|
-
EventNames.
|
|
413
|
+
EventNames.RECORDING_STATE_ATTRIBUTE,
|
|
390
414
|
JSON.stringify({
|
|
391
|
-
action:
|
|
392
|
-
value:
|
|
415
|
+
action: RecordingActions.RECORDING_REQUEST_STATE.FAILED,
|
|
416
|
+
value: `${localUid}`,
|
|
393
417
|
}),
|
|
394
418
|
PersistanceLevel.Session,
|
|
395
419
|
);
|
|
396
420
|
});
|
|
397
421
|
}, [
|
|
398
422
|
headingStopError,
|
|
399
|
-
inProgress,
|
|
400
423
|
roomId.host,
|
|
401
424
|
setRecordingActive,
|
|
402
425
|
store.token,
|
|
403
426
|
subheadingError,
|
|
427
|
+
localUid,
|
|
404
428
|
]);
|
|
405
429
|
|
|
406
430
|
const stopRecording = useCallback(() => {
|
|
431
|
+
setInProgress(true);
|
|
432
|
+
events.send(
|
|
433
|
+
EventNames.RECORDING_STATE_ATTRIBUTE,
|
|
434
|
+
JSON.stringify({
|
|
435
|
+
action: RecordingActions.RECORDING_REQUEST_STATE.PENDING,
|
|
436
|
+
value: `${localUid}`,
|
|
437
|
+
}),
|
|
438
|
+
PersistanceLevel.Session,
|
|
439
|
+
);
|
|
407
440
|
if (recordingMode === 'WEB') {
|
|
408
441
|
log('Stopping recording by sending event to bot');
|
|
409
442
|
// send stop request to bot
|
|
410
|
-
setInProgress(true);
|
|
411
443
|
events.send(
|
|
412
|
-
EventNames.
|
|
444
|
+
EventNames.RECORDING_STATE_ATTRIBUTE,
|
|
413
445
|
JSON.stringify({
|
|
414
|
-
action:
|
|
415
|
-
value:
|
|
446
|
+
action: RecordingActions.REQUEST_TO_STOP_RECORDING,
|
|
447
|
+
value: `${localUid}`,
|
|
416
448
|
}),
|
|
417
|
-
PersistanceLevel.
|
|
449
|
+
PersistanceLevel.None,
|
|
418
450
|
100000, // bot uid
|
|
419
451
|
);
|
|
420
452
|
} else {
|
|
421
453
|
log('Stopping recording by calling stop');
|
|
422
454
|
_stopRecording();
|
|
423
455
|
}
|
|
424
|
-
}, [_stopRecording]);
|
|
456
|
+
}, [_stopRecording, localUid]);
|
|
425
457
|
|
|
426
458
|
const fetchRecordings = useCallback(
|
|
427
459
|
(page: number) => {
|
|
@@ -483,35 +515,46 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
483
515
|
|
|
484
516
|
// Events
|
|
485
517
|
useEffect(() => {
|
|
486
|
-
events.on(EventNames.
|
|
487
|
-
log('
|
|
518
|
+
events.on(EventNames.RECORDING_STATE_ATTRIBUTE, data => {
|
|
519
|
+
log('recording_state attribute received', data);
|
|
488
520
|
const payload = JSON.parse(data.payload);
|
|
489
521
|
const action = payload.action;
|
|
490
|
-
const value = payload.value;
|
|
491
522
|
switch (action) {
|
|
492
|
-
case
|
|
493
|
-
|
|
494
|
-
if (recordingMode === 'MIX') {
|
|
495
|
-
setRecordingActive(true);
|
|
496
|
-
}
|
|
523
|
+
case RecordingActions.RECORDING_REQUEST_STATE.PENDING:
|
|
524
|
+
setInProgress(true);
|
|
497
525
|
break;
|
|
498
|
-
case
|
|
526
|
+
case RecordingActions.RECORDING_REQUEST_STATE.STARTED_MIX:
|
|
499
527
|
setInProgress(false);
|
|
500
528
|
setRecordingActive(true);
|
|
501
529
|
break;
|
|
502
|
-
case
|
|
530
|
+
case RecordingActions.RECORDING_REQUEST_STATE.STARTED_WEB:
|
|
531
|
+
setInProgress(false);
|
|
532
|
+
setRecordingActive(true);
|
|
533
|
+
break;
|
|
534
|
+
case RecordingActions.RECORDING_REQUEST_STATE.STOPPED:
|
|
503
535
|
setInProgress(false);
|
|
504
536
|
setRecordingActive(false);
|
|
505
537
|
break;
|
|
506
|
-
|
|
538
|
+
/**
|
|
539
|
+
* The below case is not persisted, hence we need not worry about whether the
|
|
540
|
+
* new user gets the correct state or not
|
|
541
|
+
*/
|
|
542
|
+
case RecordingActions.REQUEST_TO_STOP_RECORDING:
|
|
507
543
|
_stopRecording();
|
|
508
544
|
break;
|
|
509
545
|
default:
|
|
510
546
|
break;
|
|
511
547
|
}
|
|
512
548
|
});
|
|
549
|
+
events.on(EventNames.RECORDING_STARTED_BY_ATTRIBUTE, data => {
|
|
550
|
+
log('recording_started_by attribute received', data);
|
|
551
|
+
const payload = JSON.parse(data.payload);
|
|
552
|
+
const value = payload.value;
|
|
553
|
+
setUidWhoStarted(parseInt(value));
|
|
554
|
+
});
|
|
513
555
|
return () => {
|
|
514
|
-
events.off(EventNames.
|
|
556
|
+
events.off(EventNames.RECORDING_STATE_ATTRIBUTE);
|
|
557
|
+
events.off(EventNames.RECORDING_STARTED_BY_ATTRIBUTE);
|
|
515
558
|
};
|
|
516
559
|
}, [
|
|
517
560
|
roomId.host,
|
|
@@ -600,10 +643,12 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
600
643
|
'RECORDING',
|
|
601
644
|
'Recording-bot: sending event recording-started event to users in the call',
|
|
602
645
|
);
|
|
646
|
+
setInProgress(false);
|
|
647
|
+
setRecordingActive(true);
|
|
603
648
|
events.send(
|
|
604
|
-
EventNames.
|
|
649
|
+
EventNames.RECORDING_STATE_ATTRIBUTE,
|
|
605
650
|
JSON.stringify({
|
|
606
|
-
action:
|
|
651
|
+
action: RecordingActions.RECORDING_REQUEST_STATE.STARTED_WEB,
|
|
607
652
|
value: `${localUid}`,
|
|
608
653
|
}),
|
|
609
654
|
PersistanceLevel.Session,
|
|
@@ -277,11 +277,20 @@ export const ScreenshareConfigure = (props: {
|
|
|
277
277
|
|
|
278
278
|
const executeRecordingQuery = (isScreenActive: boolean) => {
|
|
279
279
|
if (isScreenActive) {
|
|
280
|
-
|
|
281
|
-
|
|
280
|
+
// If recording is going on, set the presenter query
|
|
281
|
+
logger.log(
|
|
282
|
+
LogSource.Internals,
|
|
283
|
+
'SCREENSHARE',
|
|
284
|
+
'Recording is going on set presenter query',
|
|
285
|
+
);
|
|
282
286
|
executePresenterQuery(screenShareUid);
|
|
283
287
|
} else {
|
|
284
|
-
|
|
288
|
+
logger.log(
|
|
289
|
+
LogSource.Internals,
|
|
290
|
+
'SCREENSHARE',
|
|
291
|
+
'Recording is NOT going on set normal query',
|
|
292
|
+
);
|
|
293
|
+
// If no recording is going on, set the normal query
|
|
285
294
|
executeNormalQuery();
|
|
286
295
|
}
|
|
287
296
|
};
|
|
@@ -313,7 +322,6 @@ export const ScreenshareConfigure = (props: {
|
|
|
313
322
|
try {
|
|
314
323
|
if (props.isRecordingActive) {
|
|
315
324
|
executeRecordingQuery(isActive);
|
|
316
|
-
console.log('screenshare recording layout query executed');
|
|
317
325
|
}
|
|
318
326
|
// @ts-ignore
|
|
319
327
|
await rtc.RtcEngineUnsafe.startScreenshare(
|