agora-appbuilder-core 4.0.7 → 4.0.8
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/_package-lock.json +82 -0
- package/template/android/app/build.gradle +8 -0
- package/template/android/build.gradle +3 -0
- package/template/bridge/rtc/webNg/RtcEngine.ts +581 -31
- package/template/bridge/rtc/webNg/RtcSurfaceView.tsx +2 -1
- package/template/bridge/rtm/web/index.ts +2 -1
- package/template/customization-api/customize.ts +29 -10
- package/template/index.js +17 -1
- package/template/index.web.js +2 -2
- package/template/package.json +3 -0
- package/template/src/SDKAppWrapper.tsx +44 -2
- package/template/src/app-state/useNoiseSupression.native.tsx +6 -0
- package/template/src/app-state/useNoiseSupression.tsx +17 -0
- package/template/src/auth/AuthProvider.tsx +145 -8
- package/template/src/auth/IDPAuth.electron.tsx +2 -1
- package/template/src/auth/IDPAuth.tsx +8 -2
- package/template/src/auth/openIDPURL.native.tsx +14 -3
- package/template/src/auth/useTokenAuth.tsx +7 -1
- package/template/src/components/Controls.tsx +2 -1
- package/template/src/components/DeviceConfigure.tsx +67 -17
- package/template/src/components/Precall.tsx +21 -0
- package/template/src/components/RTMConfigure.tsx +188 -24
- package/template/src/components/SettingsView.tsx +2 -0
- package/template/src/components/Share.tsx +11 -0
- package/template/src/components/StorageContext.tsx +32 -2
- package/template/src/components/chat-messages/useChatMessages.tsx +65 -5
- package/template/src/components/contexts/WaitingRoomContext.tsx +5 -1
- package/template/src/components/precall/joinCallBtn.tsx +6 -0
- package/template/src/components/precall/usePreCall.tsx +18 -2
- package/template/src/components/room-info/useRoomInfo.tsx +28 -25
- package/template/src/components/useUserPreference.tsx +13 -2
- package/template/src/components/useWakeLock.tsx +18 -4
- package/template/src/components/virtual-background/VBCard.tsx +40 -1
- package/template/src/components/virtual-background/VButils.native.ts +24 -5
- package/template/src/components/virtual-background/VButils.ts +29 -5
- package/template/src/components/virtual-background/VideoPreview.tsx +11 -1
- package/template/src/components/virtual-background/useVB.native.tsx +19 -3
- package/template/src/components/whiteboard/WhiteboardConfigure.tsx +32 -5
- package/template/src/components/whiteboard/WhiteboardToolBox.tsx +38 -8
- package/template/src/components/whiteboard/WhiteboardView.native.tsx +37 -13
- package/template/src/language/useLanguage.tsx +10 -4
- package/template/src/logger/AppBuilderLogger.tsx +215 -0
- package/template/src/logger/constants.ts +18 -0
- package/template/src/logger/transports/agora-transport.native.ts +58 -0
- package/template/src/logger/transports/agora-transport.ts +28 -0
- package/template/src/logger/transports/customer-transport.ts +115 -0
- package/template/src/pages/Create.tsx +27 -2
- package/template/src/pages/Endcall.tsx +6 -1
- package/template/src/pages/Join.tsx +31 -4
- package/template/src/pages/VideoCall.tsx +20 -56
- package/template/src/pages/video-call/DefaultLayouts.ts +11 -3
- package/template/src/pages/video-call/SidePanelHeader.tsx +12 -2
- package/template/src/pages/video-call/VideoCallScreen.tsx +8 -0
- package/template/src/pages/video-call/VideoRenderer.tsx +6 -0
- package/template/src/rtm/RTMEngine.ts +5 -0
- package/template/src/rtm-events-api/Events.ts +70 -16
- package/template/src/subComponents/LayoutIconDropdown.tsx +6 -0
- package/template/src/subComponents/LocalAudioMute.tsx +13 -3
- package/template/src/subComponents/LocalEndCall.tsx +8 -3
- package/template/src/subComponents/LocalVideoMute.tsx +15 -1
- package/template/src/subComponents/SelectDevice.tsx +111 -3
- package/template/src/subComponents/caption/CaptionContainer.tsx +17 -2
- package/template/src/subComponents/caption/useSTTAPI.tsx +62 -20
- package/template/src/subComponents/caption/useTranscriptDownload.native.ts +35 -5
- package/template/src/subComponents/caption/useTranscriptDownload.ts +12 -2
- package/template/src/subComponents/chat/ChatParticipants.tsx +6 -0
- package/template/src/subComponents/recording/useRecording.tsx +102 -15
- package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +33 -2
- package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +18 -2
- package/template/src/subComponents/waiting-rooms/useWaitingRoomAPI.ts +26 -0
- package/template/src/utils/axiomLogger.ts +2 -1
- package/template/src/utils/useCreateRoom.ts +30 -0
- package/template/src/utils/useFindActiveSpeaker.ts +43 -0
- package/template/src/utils/useFocus.tsx +8 -3
- package/template/src/utils/useIsLocalUserSpeaking.ts +19 -3
- package/template/src/utils/useJoinRoom.ts +27 -0
- package/template/src/utils/useLayout.tsx +9 -3
- package/template/src/utils/useSidePanel.tsx +14 -3
|
@@ -45,6 +45,7 @@ import {
|
|
|
45
45
|
videoRoomRecordingErrorToastSubHeading,
|
|
46
46
|
} from '../../language/default-labels/videoCallScreenLabels';
|
|
47
47
|
import {getOriginURL} from '../../auth/config';
|
|
48
|
+
import {LogSource, logger} from '../../logger/AppBuilderLogger';
|
|
48
49
|
|
|
49
50
|
const getFrontendUrl = (url: string) => {
|
|
50
51
|
// check if it doesn't contains the https protocol
|
|
@@ -89,8 +90,6 @@ function usePrevious<T = any>(value: any) {
|
|
|
89
90
|
interface RecordingProviderProps {
|
|
90
91
|
children: React.ReactNode;
|
|
91
92
|
value: {
|
|
92
|
-
setRecordingActive: React.Dispatch<SetStateAction<boolean>>;
|
|
93
|
-
isRecordingActive: boolean;
|
|
94
93
|
callActive: boolean;
|
|
95
94
|
};
|
|
96
95
|
}
|
|
@@ -102,7 +101,8 @@ interface RecordingProviderProps {
|
|
|
102
101
|
*/
|
|
103
102
|
|
|
104
103
|
const RecordingProvider = (props: RecordingProviderProps) => {
|
|
105
|
-
const {
|
|
104
|
+
const {callActive} = props?.value;
|
|
105
|
+
const [isRecordingActive, setRecordingActive] = useState(false);
|
|
106
106
|
const {
|
|
107
107
|
data: {isHost, roomId},
|
|
108
108
|
} = useRoomInfo();
|
|
@@ -199,22 +199,34 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
199
199
|
const startRecording = () => {
|
|
200
200
|
const passphrase = roomId.host || '';
|
|
201
201
|
let recordinghostURL = getOriginURL();
|
|
202
|
-
console.log('web-recording - start recording API called');
|
|
203
|
-
|
|
204
202
|
if (inProgress) {
|
|
205
|
-
|
|
203
|
+
logger.debug(
|
|
204
|
+
LogSource.Internals,
|
|
205
|
+
'RECORDING',
|
|
206
|
+
'start recording already in progress. Aborting..',
|
|
207
|
+
);
|
|
206
208
|
return;
|
|
207
209
|
}
|
|
208
210
|
if (recordinghostURL.includes('localhost')) {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
+
logger.error(
|
|
212
|
+
LogSource.Internals,
|
|
213
|
+
'RECORDING',
|
|
214
|
+
'Recording url cannot be localhost. It should be a valid deployed URL',
|
|
215
|
+
recordinghostURL,
|
|
211
216
|
);
|
|
212
217
|
return;
|
|
213
218
|
}
|
|
214
219
|
recordinghostURL = getFrontendUrl(recordinghostURL);
|
|
215
|
-
console.log('web-recording - recordinghostURL: ', recordinghostURL);
|
|
216
|
-
|
|
217
220
|
setInProgress(true);
|
|
221
|
+
logger.debug(
|
|
222
|
+
LogSource.NetworkRest,
|
|
223
|
+
'recording_start',
|
|
224
|
+
'Trying to start recording',
|
|
225
|
+
{
|
|
226
|
+
passphrase: roomId.host,
|
|
227
|
+
url: `${recordinghostURL}/${passphrase}`,
|
|
228
|
+
},
|
|
229
|
+
);
|
|
218
230
|
fetch(`${$config.BACKEND_ENDPOINT}/v1/recording/start`, {
|
|
219
231
|
method: 'POST',
|
|
220
232
|
headers: {
|
|
@@ -231,6 +243,12 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
231
243
|
.then((res: any) => {
|
|
232
244
|
setInProgress(false);
|
|
233
245
|
if (res.status === 200) {
|
|
246
|
+
logger.debug(
|
|
247
|
+
LogSource.NetworkRest,
|
|
248
|
+
'recording_start',
|
|
249
|
+
'start recording successfull',
|
|
250
|
+
res,
|
|
251
|
+
);
|
|
234
252
|
/**
|
|
235
253
|
* 1. Once the backend sucessfuly starts recording, send message
|
|
236
254
|
* in the channel indicating that cloud recording is now active.
|
|
@@ -247,14 +265,31 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
247
265
|
setUidWhoStarted(localUid);
|
|
248
266
|
setRecordingActive(true);
|
|
249
267
|
} else if (res.status === 500) {
|
|
268
|
+
logger.error(
|
|
269
|
+
LogSource.NetworkRest,
|
|
270
|
+
'recording_start',
|
|
271
|
+
'Error while start recording',
|
|
272
|
+
res,
|
|
273
|
+
);
|
|
250
274
|
showErrorToast(headingStartError, subheadingError);
|
|
251
275
|
} else {
|
|
276
|
+
logger.error(
|
|
277
|
+
LogSource.NetworkRest,
|
|
278
|
+
'recording_start',
|
|
279
|
+
'Error while start recording',
|
|
280
|
+
res,
|
|
281
|
+
);
|
|
252
282
|
showErrorToast(headingStartError);
|
|
253
283
|
}
|
|
254
284
|
})
|
|
255
285
|
.catch(err => {
|
|
286
|
+
logger.error(
|
|
287
|
+
LogSource.NetworkRest,
|
|
288
|
+
'recording_start',
|
|
289
|
+
'Error while start recording',
|
|
290
|
+
err,
|
|
291
|
+
);
|
|
256
292
|
setInProgress(false);
|
|
257
|
-
console.log(err);
|
|
258
293
|
});
|
|
259
294
|
};
|
|
260
295
|
|
|
@@ -262,15 +297,22 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
262
297
|
/**
|
|
263
298
|
* Any host in the channel can stop recording.
|
|
264
299
|
*/
|
|
265
|
-
|
|
300
|
+
logger.debug(LogSource.Internals, 'RECORDING', 'stop recording API called');
|
|
266
301
|
if (inProgress) {
|
|
267
|
-
|
|
268
|
-
|
|
302
|
+
logger.error(
|
|
303
|
+
LogSource.Internals,
|
|
304
|
+
'RECORDING',
|
|
305
|
+
'stop recording already in progress. Aborting..',
|
|
269
306
|
);
|
|
270
307
|
return;
|
|
271
308
|
}
|
|
272
309
|
setInProgress(true);
|
|
273
310
|
// If recording is already going on, stop the recording by executing the below query.
|
|
311
|
+
logger.debug(
|
|
312
|
+
LogSource.NetworkRest,
|
|
313
|
+
'recording_stop',
|
|
314
|
+
'Trying to stop recording',
|
|
315
|
+
);
|
|
274
316
|
fetch(`${$config.BACKEND_ENDPOINT}/v1/recording/stop`, {
|
|
275
317
|
method: 'POST',
|
|
276
318
|
headers: {
|
|
@@ -284,6 +326,12 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
284
326
|
.then(res => {
|
|
285
327
|
setInProgress(false);
|
|
286
328
|
if (res.status === 200) {
|
|
329
|
+
logger.debug(
|
|
330
|
+
LogSource.NetworkRest,
|
|
331
|
+
'recording_stop',
|
|
332
|
+
'stop recording successfull',
|
|
333
|
+
res,
|
|
334
|
+
);
|
|
287
335
|
/**
|
|
288
336
|
* 1. Once the backend sucessfuly stops recording, send message
|
|
289
337
|
* in the channel indicating that cloud recording is now inactive.
|
|
@@ -299,14 +347,31 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
299
347
|
// 2. set the local recording state to false to update the UI
|
|
300
348
|
setRecordingActive(false);
|
|
301
349
|
} else if (res.status === 500) {
|
|
350
|
+
logger.error(
|
|
351
|
+
LogSource.NetworkRest,
|
|
352
|
+
'recording_stop',
|
|
353
|
+
'Error while stopping recording',
|
|
354
|
+
res,
|
|
355
|
+
);
|
|
302
356
|
showErrorToast(headingStopError, subheadingError);
|
|
303
357
|
} else {
|
|
358
|
+
logger.error(
|
|
359
|
+
LogSource.NetworkRest,
|
|
360
|
+
'recording_stop',
|
|
361
|
+
'Error while stopping recording',
|
|
362
|
+
res,
|
|
363
|
+
);
|
|
304
364
|
showErrorToast(headingStopError);
|
|
305
365
|
}
|
|
306
366
|
})
|
|
307
367
|
.catch(err => {
|
|
368
|
+
logger.error(
|
|
369
|
+
LogSource.NetworkRest,
|
|
370
|
+
'recording_stop',
|
|
371
|
+
'Error while stopping recording',
|
|
372
|
+
err,
|
|
373
|
+
);
|
|
308
374
|
setInProgress(false);
|
|
309
|
-
console.log(err);
|
|
310
375
|
});
|
|
311
376
|
}, [
|
|
312
377
|
headingStopError,
|
|
@@ -341,6 +406,16 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
341
406
|
|
|
342
407
|
const fetchRecordings = useCallback(
|
|
343
408
|
(page: number) => {
|
|
409
|
+
logger.log(
|
|
410
|
+
LogSource.NetworkRest,
|
|
411
|
+
'recordings_get',
|
|
412
|
+
'Trying to fetch recordings',
|
|
413
|
+
{
|
|
414
|
+
passphrase: roomId?.host,
|
|
415
|
+
limit: 10,
|
|
416
|
+
page,
|
|
417
|
+
},
|
|
418
|
+
);
|
|
344
419
|
return fetch(`${$config.BACKEND_ENDPOINT}/v1/recordings`, {
|
|
345
420
|
method: 'POST',
|
|
346
421
|
headers: {
|
|
@@ -356,6 +431,12 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
356
431
|
}).then(async response => {
|
|
357
432
|
const data = await response.json();
|
|
358
433
|
if (response.ok) {
|
|
434
|
+
logger.log(
|
|
435
|
+
LogSource.NetworkRest,
|
|
436
|
+
'recordings_get',
|
|
437
|
+
'fetch recordings successfull',
|
|
438
|
+
data,
|
|
439
|
+
);
|
|
359
440
|
if (data) {
|
|
360
441
|
return data;
|
|
361
442
|
} else {
|
|
@@ -369,6 +450,12 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
369
450
|
const error = {
|
|
370
451
|
message: data?.error?.message,
|
|
371
452
|
};
|
|
453
|
+
logger.error(
|
|
454
|
+
LogSource.NetworkRest,
|
|
455
|
+
'recordings_get',
|
|
456
|
+
'Error while fetching recording',
|
|
457
|
+
error,
|
|
458
|
+
);
|
|
372
459
|
return Promise.reject(error);
|
|
373
460
|
}
|
|
374
461
|
});
|
|
@@ -31,6 +31,7 @@ import useMuteToggleLocal, {
|
|
|
31
31
|
import {useLocalUserInfo} from '../../app-state/useLocalUserInfo';
|
|
32
32
|
import {LocalVideoStreamError} from 'react-native-agora';
|
|
33
33
|
import useAppState from '../../utils/useAppState';
|
|
34
|
+
import {LogSource, logger} from '../../logger/AppBuilderLogger';
|
|
34
35
|
|
|
35
36
|
export const ScreenshareContextConsumer = ScreenshareContext.Consumer;
|
|
36
37
|
|
|
@@ -244,6 +245,7 @@ export const ScreenshareConfigure = (props: {children: React.ReactNode}) => {
|
|
|
244
245
|
if (!isScreenshareActive) {
|
|
245
246
|
// either user can publish local video or screenshare stream
|
|
246
247
|
// so if user video is turned on then we are turning off video before screenshare
|
|
248
|
+
logger.log(LogSource.Internals, 'SCREENSHARE', 'starting screenshare');
|
|
247
249
|
await RtcEngineUnsafe?.startScreenCapture({
|
|
248
250
|
captureVideo: true,
|
|
249
251
|
captureAudio,
|
|
@@ -258,7 +260,11 @@ export const ScreenshareConfigure = (props: {children: React.ReactNode}) => {
|
|
|
258
260
|
}
|
|
259
261
|
//For ios will update state in the video state changed callback
|
|
260
262
|
} else {
|
|
261
|
-
|
|
263
|
+
logger.debug(
|
|
264
|
+
LogSource.Internals,
|
|
265
|
+
'SCREENSHARE',
|
|
266
|
+
'screenshare is already active',
|
|
267
|
+
);
|
|
262
268
|
}
|
|
263
269
|
};
|
|
264
270
|
|
|
@@ -281,6 +287,7 @@ export const ScreenshareConfigure = (props: {children: React.ReactNode}) => {
|
|
|
281
287
|
) => {
|
|
282
288
|
if (isScreenshareActive || forceStop) {
|
|
283
289
|
enableVideoRef.current = enableVideo;
|
|
290
|
+
logger.log(LogSource.Internals, 'SCREENSHARE', 'stopping screenshare');
|
|
284
291
|
await RtcEngineUnsafe?.stopScreenCapture();
|
|
285
292
|
if (Platform.OS === 'android') {
|
|
286
293
|
processRef.current = true;
|
|
@@ -288,15 +295,29 @@ export const ScreenshareConfigure = (props: {children: React.ReactNode}) => {
|
|
|
288
295
|
}
|
|
289
296
|
//For ios will update state in the video state changed callback
|
|
290
297
|
} else {
|
|
291
|
-
|
|
298
|
+
logger.debug(
|
|
299
|
+
LogSource.Internals,
|
|
300
|
+
'SCREENSHARE',
|
|
301
|
+
'no screenshare is active',
|
|
302
|
+
);
|
|
292
303
|
}
|
|
293
304
|
};
|
|
294
305
|
|
|
295
306
|
useEffect(() => {
|
|
296
307
|
if (processRef.current) {
|
|
297
308
|
//native screenshare is started
|
|
309
|
+
logger.log(
|
|
310
|
+
LogSource.Internals,
|
|
311
|
+
'SCREENSHARE',
|
|
312
|
+
'native screenshare is started',
|
|
313
|
+
);
|
|
298
314
|
if (isScreenshareActive) {
|
|
299
315
|
//to increase the performance - stop incoming video stream
|
|
316
|
+
logger.log(
|
|
317
|
+
LogSource.Internals,
|
|
318
|
+
'SCREENSHARE',
|
|
319
|
+
'muting all remote video streams[muteAllRemoteVideoStreams(true)] to increase the performance',
|
|
320
|
+
);
|
|
300
321
|
RtcEngineUnsafe.muteAllRemoteVideoStreams(true);
|
|
301
322
|
|
|
302
323
|
//since native screenshare uses local user video
|
|
@@ -308,7 +329,17 @@ export const ScreenshareConfigure = (props: {children: React.ReactNode}) => {
|
|
|
308
329
|
}
|
|
309
330
|
//native screenshare is stopped
|
|
310
331
|
else {
|
|
332
|
+
logger.log(
|
|
333
|
+
LogSource.Internals,
|
|
334
|
+
'SCREENSHARE',
|
|
335
|
+
'native screenshare is stopped',
|
|
336
|
+
);
|
|
311
337
|
//resume the incoming video stream
|
|
338
|
+
logger.log(
|
|
339
|
+
LogSource.Internals,
|
|
340
|
+
'SCREENSHARE',
|
|
341
|
+
'resume all remote video streams[muteAllRemoteVideoStreams(false)]',
|
|
342
|
+
);
|
|
312
343
|
RtcEngineUnsafe.muteAllRemoteVideoStreams(false);
|
|
313
344
|
|
|
314
345
|
//edge case - if screenshare is going on and user want to enable the video
|
|
@@ -36,6 +36,7 @@ import {
|
|
|
36
36
|
videoRoomScreenShareErrorToastHeading,
|
|
37
37
|
videoRoomScreenShareErrorToastSubHeading,
|
|
38
38
|
} from '../../language/default-labels/videoCallScreenLabels';
|
|
39
|
+
import {LogSource, logger} from '../../logger/AppBuilderLogger';
|
|
39
40
|
|
|
40
41
|
export const ScreenshareContextConsumer = ScreenshareContext.Consumer;
|
|
41
42
|
|
|
@@ -227,7 +228,7 @@ export const ScreenshareConfigure = (props: {children: React.ReactNode}) => {
|
|
|
227
228
|
|
|
228
229
|
const ScreenshareStoppedCallback = () => {
|
|
229
230
|
setScreenshareActive(false);
|
|
230
|
-
|
|
231
|
+
logger.debug(LogSource.Internals, 'SCREENSHARE', 'screenshare stopped.');
|
|
231
232
|
events.send(
|
|
232
233
|
EventNames.SCREENSHARE_ATTRIBUTE,
|
|
233
234
|
JSON.stringify({
|
|
@@ -282,6 +283,16 @@ export const ScreenshareConfigure = (props: {children: React.ReactNode}) => {
|
|
|
282
283
|
};
|
|
283
284
|
|
|
284
285
|
const userScreenshare = async (isActive: boolean) => {
|
|
286
|
+
logger.log(
|
|
287
|
+
LogSource.Internals,
|
|
288
|
+
'SCREENSHARE',
|
|
289
|
+
`${isActive ? 'starting' : 'stopping'} screenshare`,
|
|
290
|
+
{
|
|
291
|
+
channel,
|
|
292
|
+
screenShareUid,
|
|
293
|
+
encryption,
|
|
294
|
+
},
|
|
295
|
+
);
|
|
285
296
|
try {
|
|
286
297
|
// @ts-ignore
|
|
287
298
|
await rtc.RtcEngineUnsafe.startScreenshare(
|
|
@@ -321,7 +332,12 @@ export const ScreenshareConfigure = (props: {children: React.ReactNode}) => {
|
|
|
321
332
|
);
|
|
322
333
|
}
|
|
323
334
|
} catch (e) {
|
|
324
|
-
|
|
335
|
+
logger.error(
|
|
336
|
+
LogSource.Internals,
|
|
337
|
+
'SCREENSHARE',
|
|
338
|
+
'failed to start screen share',
|
|
339
|
+
e,
|
|
340
|
+
);
|
|
325
341
|
Toast.show({
|
|
326
342
|
leadingIconName: 'alert',
|
|
327
343
|
type: 'error',
|
|
@@ -7,6 +7,7 @@ import {EventNames} from '../../rtm-events';
|
|
|
7
7
|
import useGetName from '../../utils/useGetName';
|
|
8
8
|
import {useLocalUid} from '../../../agora-rn-uikit';
|
|
9
9
|
import {useParams} from '../../components/Router';
|
|
10
|
+
import {LogSource, logger} from '../../logger/AppBuilderLogger';
|
|
10
11
|
|
|
11
12
|
interface IuseWaitingRoomAPI {
|
|
12
13
|
request: (params: {
|
|
@@ -40,6 +41,7 @@ const useWaitingRoomAPI = (): IuseWaitingRoomAPI => {
|
|
|
40
41
|
body: payload,
|
|
41
42
|
});
|
|
42
43
|
const res = await response.json();
|
|
44
|
+
|
|
43
45
|
return res;
|
|
44
46
|
};
|
|
45
47
|
|
|
@@ -48,7 +50,19 @@ const useWaitingRoomAPI = (): IuseWaitingRoomAPI => {
|
|
|
48
50
|
passphrase: meetingPhrase || phrase,
|
|
49
51
|
send_event: send_event,
|
|
50
52
|
});
|
|
53
|
+
logger.log(
|
|
54
|
+
LogSource.NetworkRest,
|
|
55
|
+
'channel_join_request',
|
|
56
|
+
'API channel_join_request trying to send request to join channel',
|
|
57
|
+
payload,
|
|
58
|
+
);
|
|
51
59
|
const res = await apiCall('request', payload);
|
|
60
|
+
logger.log(
|
|
61
|
+
LogSource.NetworkRest,
|
|
62
|
+
'channel_join_request',
|
|
63
|
+
'API channel_join_request executed successfully',
|
|
64
|
+
res,
|
|
65
|
+
);
|
|
52
66
|
return res;
|
|
53
67
|
};
|
|
54
68
|
|
|
@@ -65,7 +79,19 @@ const useWaitingRoomAPI = (): IuseWaitingRoomAPI => {
|
|
|
65
79
|
attendee_screenshare_uid: attendee_screenshare_uid, // screenshare uid of attendee
|
|
66
80
|
approved: approved, //approval status,
|
|
67
81
|
});
|
|
82
|
+
logger.log(
|
|
83
|
+
LogSource.NetworkRest,
|
|
84
|
+
'channel_join_approval',
|
|
85
|
+
`API channel_join_approval. Trying to approve join channel request as waiting room is enabled. Is request approved ? ${approved}`,
|
|
86
|
+
payload,
|
|
87
|
+
);
|
|
68
88
|
const res = await apiCall('approval', payload);
|
|
89
|
+
logger.log(
|
|
90
|
+
LogSource.NetworkRest,
|
|
91
|
+
'channel_join_request',
|
|
92
|
+
'API channel_join_approval executed successfully',
|
|
93
|
+
res,
|
|
94
|
+
);
|
|
69
95
|
return res;
|
|
70
96
|
};
|
|
71
97
|
|
|
@@ -3,6 +3,7 @@ import {RoomInfoContextInterface} from '../components/room-info/useRoomInfo';
|
|
|
3
3
|
import {useSetRoomInfo} from '../components/room-info/useSetRoomInfo';
|
|
4
4
|
import SDKEvents from '../utils/SdkEvents';
|
|
5
5
|
import isSDK from './isSDK';
|
|
6
|
+
import {LogSource, logger} from '../logger/AppBuilderLogger';
|
|
6
7
|
|
|
7
8
|
const CREATE_CHANNEL = gql`
|
|
8
9
|
mutation CreateChannel($title: String!, $enablePSTN: Boolean) {
|
|
@@ -36,6 +37,16 @@ export default function useCreateRoom(): createRoomFun {
|
|
|
36
37
|
//isSeparateHostLink will be for internal usage since backend integration is not there
|
|
37
38
|
isSeparateHostLink?: boolean,
|
|
38
39
|
) => {
|
|
40
|
+
logger.log(
|
|
41
|
+
LogSource.NetworkRest,
|
|
42
|
+
'createChannel',
|
|
43
|
+
'API createChannel. Trying to create room',
|
|
44
|
+
{
|
|
45
|
+
roomTitle,
|
|
46
|
+
enablePSTN,
|
|
47
|
+
isSeparateHostLink,
|
|
48
|
+
},
|
|
49
|
+
);
|
|
39
50
|
const res = await createChannel({
|
|
40
51
|
variables: {
|
|
41
52
|
title: roomTitle,
|
|
@@ -47,9 +58,21 @@ export default function useCreateRoom(): createRoomFun {
|
|
|
47
58
|
// upgrade core dependency as well. The following condition accounts
|
|
48
59
|
// for differences in the way the two version function.
|
|
49
60
|
if (error && !isSDK) {
|
|
61
|
+
logger.error(
|
|
62
|
+
LogSource.NetworkRest,
|
|
63
|
+
'createChannel',
|
|
64
|
+
'API createChannel failed. There was an error',
|
|
65
|
+
error,
|
|
66
|
+
);
|
|
50
67
|
throw error;
|
|
51
68
|
}
|
|
52
69
|
if (res && res?.data && res?.data?.createChannel) {
|
|
70
|
+
logger.log(
|
|
71
|
+
LogSource.NetworkRest,
|
|
72
|
+
'createChannel',
|
|
73
|
+
'API createChannel. Channel created successfully',
|
|
74
|
+
res.data.createChannel,
|
|
75
|
+
);
|
|
53
76
|
let roomInfo: Partial<RoomInfoContextInterface['data']> = {
|
|
54
77
|
roomId: {
|
|
55
78
|
attendee: '',
|
|
@@ -67,6 +90,13 @@ export default function useCreateRoom(): createRoomFun {
|
|
|
67
90
|
pin: res.data.createChannel.pstn.dtmf,
|
|
68
91
|
};
|
|
69
92
|
}
|
|
93
|
+
logger.log(LogSource.Internals, 'CREATE_MEETING', 'Room created', {
|
|
94
|
+
isHost: true,
|
|
95
|
+
isSeparateHostLink: isSeparateHostLink ? true : false,
|
|
96
|
+
meetingTitle: roomTitle,
|
|
97
|
+
roomId: roomInfo?.roomId,
|
|
98
|
+
pstn: roomInfo?.pstn,
|
|
99
|
+
});
|
|
70
100
|
setRoomInfo({
|
|
71
101
|
data: {
|
|
72
102
|
isHost: true,
|
|
@@ -13,6 +13,7 @@ import ChatContext from '../components/ChatContext';
|
|
|
13
13
|
import LocalEventEmitter, {
|
|
14
14
|
LocalEventsEnum,
|
|
15
15
|
} from '../rtm-events-api/LocalEvents';
|
|
16
|
+
import {LogSource, logger} from '../logger/AppBuilderLogger';
|
|
16
17
|
|
|
17
18
|
enum volumeEnum {
|
|
18
19
|
IS_SPEAKING = 'IS_SPEAKING',
|
|
@@ -57,6 +58,18 @@ const useFindActiveSpeaker = () => {
|
|
|
57
58
|
? log(' %cLocal user started speaking', 'color:green')
|
|
58
59
|
: log(' %cLocal user stopped speaking', 'color:red');
|
|
59
60
|
|
|
61
|
+
isLocalUserSpeaking
|
|
62
|
+
? logger.log(
|
|
63
|
+
LogSource.Internals,
|
|
64
|
+
'ACTIVE_SPEAKER',
|
|
65
|
+
`${'%cLocal user started speaking'}, ${'color:green'}`,
|
|
66
|
+
)
|
|
67
|
+
: logger.log(
|
|
68
|
+
LogSource.Internals,
|
|
69
|
+
'ACTIVE_SPEAKER',
|
|
70
|
+
`${'%cLocal user stopped speaking'}, ${'color:red'}`,
|
|
71
|
+
);
|
|
72
|
+
|
|
60
73
|
//sending local user speaking and non speaking volume to remote users
|
|
61
74
|
let volume = 0;
|
|
62
75
|
//@ts-ignore
|
|
@@ -130,6 +143,11 @@ const useFindActiveSpeaker = () => {
|
|
|
130
143
|
);
|
|
131
144
|
if (!speakingUids || speakingUids?.length == 0) {
|
|
132
145
|
log(' %cFinal No Active speaker', 'color:red');
|
|
146
|
+
logger.log(
|
|
147
|
+
LogSource.Internals,
|
|
148
|
+
'ACTIVE_SPEAKER',
|
|
149
|
+
`${'%cFinal No Active speaker'}, ${'color:red'}`,
|
|
150
|
+
);
|
|
133
151
|
emitActiveSpeaker(0);
|
|
134
152
|
} else {
|
|
135
153
|
if (speakingUids?.length === 1) {
|
|
@@ -268,6 +286,11 @@ const useFindActiveSpeaker = () => {
|
|
|
268
286
|
// log(' local user speaking stauts', sender, '=', payload);
|
|
269
287
|
} else {
|
|
270
288
|
log(' remote user speaking status ', sender, '=', payload);
|
|
289
|
+
logger.log(
|
|
290
|
+
LogSource.Internals,
|
|
291
|
+
'ACTIVE_SPEAKER',
|
|
292
|
+
`remote user speaking status ${sender} = ${payload}`,
|
|
293
|
+
);
|
|
271
294
|
}
|
|
272
295
|
|
|
273
296
|
usersVolume.current = {
|
|
@@ -283,8 +306,18 @@ const useFindActiveSpeaker = () => {
|
|
|
283
306
|
const speakingVolumeEventCallBack = ({payload, sender}) => {
|
|
284
307
|
if (sender == localUid) {
|
|
285
308
|
log(' local user speaking volume ', sender, '=', payload);
|
|
309
|
+
logger.log(
|
|
310
|
+
LogSource.Internals,
|
|
311
|
+
'ACTIVE_SPEAKER',
|
|
312
|
+
`local user speaking volume ${sender} = ${payload}`,
|
|
313
|
+
);
|
|
286
314
|
} else {
|
|
287
315
|
log(' remote user speaking volume ', sender, '=', payload);
|
|
316
|
+
logger.log(
|
|
317
|
+
LogSource.Internals,
|
|
318
|
+
'ACTIVE_SPEAKER',
|
|
319
|
+
`remote user speaking volume ${sender} = ${payload}`,
|
|
320
|
+
);
|
|
288
321
|
}
|
|
289
322
|
|
|
290
323
|
usersVolume.current = {
|
|
@@ -299,8 +332,18 @@ const useFindActiveSpeaker = () => {
|
|
|
299
332
|
const nonSpeakingVolumeEventCallback = ({payload, sender}) => {
|
|
300
333
|
if (sender == localUid) {
|
|
301
334
|
log(' local user non speaking volume ', sender, '=', payload);
|
|
335
|
+
logger.log(
|
|
336
|
+
LogSource.Internals,
|
|
337
|
+
'ACTIVE_SPEAKER',
|
|
338
|
+
`local user non speaking volume ${sender} = ${payload}`,
|
|
339
|
+
);
|
|
302
340
|
} else {
|
|
303
341
|
log(' remote user non speaking volume ', sender, '=', payload);
|
|
342
|
+
logger.log(
|
|
343
|
+
LogSource.Internals,
|
|
344
|
+
'ACTIVE_SPEAKER',
|
|
345
|
+
`remote user non speaking volume ${sender} = ${payload}`,
|
|
346
|
+
);
|
|
304
347
|
}
|
|
305
348
|
|
|
306
349
|
usersVolume.current = {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import React, {SetStateAction} from 'react';
|
|
13
|
+
import React, {SetStateAction, useState} from 'react';
|
|
14
14
|
import {createHook} from 'customization-implementation';
|
|
15
15
|
|
|
16
16
|
export interface currentFocus {
|
|
@@ -27,12 +27,17 @@ const FocusContext = React.createContext<FocusContextInterface>({
|
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
interface FocusProviderProps {
|
|
30
|
-
value: FocusContextInterface;
|
|
31
30
|
children: React.ReactNode;
|
|
32
31
|
}
|
|
33
32
|
const FocusProvider = (props: FocusProviderProps) => {
|
|
33
|
+
const [currentFocus, setFocus] = useState<currentFocus>({
|
|
34
|
+
editName: false,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const value = {currentFocus, setFocus};
|
|
38
|
+
|
|
34
39
|
return (
|
|
35
|
-
<FocusContext.Provider value={
|
|
40
|
+
<FocusContext.Provider value={value}>
|
|
36
41
|
{props.children}
|
|
37
42
|
</FocusContext.Provider>
|
|
38
43
|
);
|
|
@@ -5,6 +5,7 @@ import {useAsyncEffect} from './useAsyncEffect';
|
|
|
5
5
|
import LocalEventEmitter, {
|
|
6
6
|
LocalEventsEnum,
|
|
7
7
|
} from '../rtm-events-api/LocalEvents';
|
|
8
|
+
import {LogSource, logger} from '../logger/AppBuilderLogger';
|
|
8
9
|
import {useIsRecordingBot} from '../subComponents/recording/useIsRecordingBot';
|
|
9
10
|
|
|
10
11
|
const useIsLocalUserSpeaking = () => {
|
|
@@ -60,7 +61,12 @@ const useIsLocalUserSpeaking = () => {
|
|
|
60
61
|
audioTrackRef.current[0]?.stop();
|
|
61
62
|
}
|
|
62
63
|
} catch (error) {
|
|
63
|
-
|
|
64
|
+
logger.error(
|
|
65
|
+
LogSource.Internals,
|
|
66
|
+
'ACTIVE_SPEAKER',
|
|
67
|
+
'Error on stopping the hark',
|
|
68
|
+
error,
|
|
69
|
+
);
|
|
64
70
|
}
|
|
65
71
|
try {
|
|
66
72
|
//detect local user speaking or not
|
|
@@ -75,7 +81,12 @@ const useIsLocalUserSpeaking = () => {
|
|
|
75
81
|
speechRef.current.on('speaking', speakingCallBack);
|
|
76
82
|
speechRef.current.on('stopped_speaking', stoppedSpeakingCallBack);
|
|
77
83
|
} catch (error) {
|
|
78
|
-
|
|
84
|
+
logger.error(
|
|
85
|
+
LogSource.Internals,
|
|
86
|
+
'ACTIVE_SPEAKER',
|
|
87
|
+
'Error on starting the hark',
|
|
88
|
+
error,
|
|
89
|
+
);
|
|
79
90
|
}
|
|
80
91
|
};
|
|
81
92
|
|
|
@@ -92,7 +103,12 @@ const useIsLocalUserSpeaking = () => {
|
|
|
92
103
|
audioTrackRef.current[0]?.stop &&
|
|
93
104
|
audioTrackRef.current[0]?.stop();
|
|
94
105
|
} catch (error) {
|
|
95
|
-
|
|
106
|
+
logger.error(
|
|
107
|
+
LogSource.Internals,
|
|
108
|
+
'ACTIVE_SPEAKER',
|
|
109
|
+
'couldnt stop the track',
|
|
110
|
+
error,
|
|
111
|
+
);
|
|
96
112
|
}
|
|
97
113
|
};
|
|
98
114
|
}
|