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
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
information visit https://appbuilder.agora.io.
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
|
-
import React, {useState, useContext} from 'react';
|
|
12
|
+
import React, {useState, useContext, useEffect} from 'react';
|
|
13
13
|
import {View, Text, StyleSheet, ScrollView} from 'react-native';
|
|
14
14
|
import {useHistory} from '../components/Router';
|
|
15
15
|
//import Logo from '../subComponents/Logo';
|
|
@@ -48,6 +48,7 @@ import {
|
|
|
48
48
|
joinRoomInputLabel,
|
|
49
49
|
joinRoomInputPlaceHolderText,
|
|
50
50
|
} from '../language/default-labels/joinScreenLabels';
|
|
51
|
+
import {LogSource, logger} from '../logger/AppBuilderLogger';
|
|
51
52
|
|
|
52
53
|
const mobileOrTablet = isMobileOrTablet();
|
|
53
54
|
|
|
@@ -90,19 +91,44 @@ const Join = () => {
|
|
|
90
91
|
null,
|
|
91
92
|
);
|
|
92
93
|
|
|
93
|
-
const
|
|
94
|
+
const apiJoinCall = useJoinRoom();
|
|
94
95
|
const {setRoomInfo} = useSetRoomInfo();
|
|
96
|
+
|
|
95
97
|
const createMeeting = () => {
|
|
98
|
+
logger.log(
|
|
99
|
+
LogSource.Internals,
|
|
100
|
+
'JOIN_MEETING',
|
|
101
|
+
'User is navigated to create-room screen',
|
|
102
|
+
);
|
|
96
103
|
history.push('/create');
|
|
97
104
|
};
|
|
98
105
|
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
logger.log(
|
|
108
|
+
LogSource.Internals,
|
|
109
|
+
'JOIN_MEETING',
|
|
110
|
+
'user landed on join-meeting screen',
|
|
111
|
+
);
|
|
112
|
+
}, []);
|
|
113
|
+
|
|
99
114
|
const startCall = async () => {
|
|
100
|
-
|
|
115
|
+
logger.log(
|
|
116
|
+
LogSource.Internals,
|
|
117
|
+
'JOIN_MEETING',
|
|
118
|
+
'User wants to join meeting',
|
|
119
|
+
phrase,
|
|
120
|
+
);
|
|
121
|
+
apiJoinCall(phrase)
|
|
101
122
|
.then(() => {
|
|
102
123
|
setRoomInfo(RoomInfoDefaultValue);
|
|
124
|
+
logger.log(
|
|
125
|
+
LogSource.Internals,
|
|
126
|
+
'JOIN_MEETING',
|
|
127
|
+
'Navigating the user to precall screen or video call screen depending upon the project config',
|
|
128
|
+
phrase,
|
|
129
|
+
);
|
|
103
130
|
history.push(phrase);
|
|
104
131
|
})
|
|
105
|
-
|
|
106
132
|
.catch(error => {
|
|
107
133
|
const isInvalidUrl =
|
|
108
134
|
error?.message.toLowerCase().trim() === 'invalid passphrase' || false;
|
|
@@ -122,6 +148,7 @@ const Join = () => {
|
|
|
122
148
|
});
|
|
123
149
|
});
|
|
124
150
|
};
|
|
151
|
+
|
|
125
152
|
const {JoinComponent} = useCustomization(data => {
|
|
126
153
|
let components: {
|
|
127
154
|
JoinComponent?: React.ComponentType;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*
|
|
2
2
|
********************************************
|
|
3
3
|
Copyright © 2021 Agora Lab, Inc., all rights reserved.
|
|
4
|
-
AppBuilder and all associated components, source code, APIs, services, and documentation
|
|
5
|
-
(the “Materials”) are owned by Agora Lab, Inc. and its licensors. The Materials may not be
|
|
6
|
-
accessed, used, modified, or distributed for any purpose without a license from Agora Lab, Inc.
|
|
7
|
-
Use without a license or in violation of any license terms and conditions (including use for
|
|
8
|
-
any purpose competitive to Agora Lab, Inc.’s business) is strictly prohibited. For more
|
|
9
|
-
information visit https://appbuilder.agora.io.
|
|
4
|
+
AppBuilder and all associated components, source code, APIs, services, and documentation
|
|
5
|
+
(the “Materials”) are owned by Agora Lab, Inc. and its licensors. The Materials may not be
|
|
6
|
+
accessed, used, modified, or distributed for any purpose without a license from Agora Lab, Inc.
|
|
7
|
+
Use without a license or in violation of any license terms and conditions (including use for
|
|
8
|
+
any purpose competitive to Agora Lab, Inc.’s business) is strictly prohibited. For more
|
|
9
|
+
information visit https://appbuilder.agora.io.
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
12
|
// @ts-nocheck
|
|
@@ -27,13 +27,7 @@ import {useParams, useHistory} from '../components/Router';
|
|
|
27
27
|
import RtmConfigure from '../components/RTMConfigure';
|
|
28
28
|
import DeviceConfigure from '../components/DeviceConfigure';
|
|
29
29
|
import Logo from '../subComponents/Logo';
|
|
30
|
-
import {
|
|
31
|
-
useHasBrandLogo,
|
|
32
|
-
isArray,
|
|
33
|
-
isMobileUA,
|
|
34
|
-
isWebInternal,
|
|
35
|
-
} from '../utils/common';
|
|
36
|
-
import {SidePanelType} from '../subComponents/SidePanelEnum';
|
|
30
|
+
import {useHasBrandLogo, isMobileUA, isWebInternal} from '../utils/common';
|
|
37
31
|
import {videoView} from '../../theme.json';
|
|
38
32
|
import {LiveStreamContextProvider} from '../components/livestream';
|
|
39
33
|
import ScreenshareConfigure from '../subComponents/screenshare/ScreenshareConfigure';
|
|
@@ -41,7 +35,6 @@ import {ErrorContext} from '.././components/common/index';
|
|
|
41
35
|
import {PreCallProvider} from '../components/precall/usePreCall';
|
|
42
36
|
import {LayoutProvider} from '../utils/useLayout';
|
|
43
37
|
import Precall from '../components/Precall';
|
|
44
|
-
import useLayoutsData from './video-call/useLayoutsData';
|
|
45
38
|
import {RecordingProvider} from '../subComponents/recording/useRecording';
|
|
46
39
|
import useJoinRoom from '../utils/useJoinRoom';
|
|
47
40
|
import {
|
|
@@ -62,7 +55,7 @@ import SDKEvents from '../utils/SdkEvents';
|
|
|
62
55
|
import {UserPreferenceProvider} from '../components/useUserPreference';
|
|
63
56
|
import EventsConfigure from '../components/EventsConfigure';
|
|
64
57
|
import PermissionHelper from '../components/precall/PermissionHelper';
|
|
65
|
-
import {
|
|
58
|
+
import {FocusProvider} from '../utils/useFocus';
|
|
66
59
|
import {VideoCallProvider} from '../components/useVideoCall';
|
|
67
60
|
import {SdkApiContext} from '../components/SdkApiContext';
|
|
68
61
|
import isSDK from '../utils/isSDK';
|
|
@@ -79,6 +72,7 @@ import VideoCallScreenWrapper from './video-call/VideoCallScreenWrapper';
|
|
|
79
72
|
import {useIsRecordingBot} from '../subComponents/recording/useIsRecordingBot';
|
|
80
73
|
import {videoRoomStartingCallText} from '../language/default-labels/videoCallScreenLabels';
|
|
81
74
|
import {useString} from '../utils/useString';
|
|
75
|
+
import {LogSource, logger} from '../logger/AppBuilderLogger';
|
|
82
76
|
import {useCustomization} from 'customization-implementation';
|
|
83
77
|
|
|
84
78
|
enum RnEncryptionEnum {
|
|
@@ -151,20 +145,10 @@ const VideoCall: React.FC = () => {
|
|
|
151
145
|
: true;
|
|
152
146
|
const [callActive, setCallActive] = useState(shouldCallBeSetToActive);
|
|
153
147
|
|
|
154
|
-
//layouts
|
|
155
|
-
const layouts = useLayoutsData();
|
|
156
|
-
const defaultLayoutName = isArray(layouts) ? layouts[0].name : '';
|
|
157
|
-
const [currentLayout, setLayout] = useState(defaultLayoutName);
|
|
158
|
-
//layouts
|
|
159
|
-
|
|
160
|
-
const [isRecordingActive, setRecordingActive] = useState(false);
|
|
161
148
|
const [queryComplete, setQueryComplete] = useState(false);
|
|
162
149
|
const [waitingRoomAttendeeJoined, setWaitingRoomAttendeeJoined] =
|
|
163
150
|
useState(false);
|
|
164
|
-
|
|
165
|
-
const [currentFocus, setFocus] = useState<currentFocus>({
|
|
166
|
-
editName: false,
|
|
167
|
-
});
|
|
151
|
+
|
|
168
152
|
const {phrase} = useParams<{phrase: string}>();
|
|
169
153
|
|
|
170
154
|
const {store} = useContext(StorageContext);
|
|
@@ -215,7 +199,11 @@ const VideoCall: React.FC = () => {
|
|
|
215
199
|
|
|
216
200
|
React.useEffect(() => {
|
|
217
201
|
return () => {
|
|
218
|
-
|
|
202
|
+
logger.debug(
|
|
203
|
+
LogSource.Internals,
|
|
204
|
+
'VIDEO_CALL_ROOM',
|
|
205
|
+
'Videocall unmounted',
|
|
206
|
+
);
|
|
219
207
|
setRoomInfo(RoomInfoDefaultValue);
|
|
220
208
|
if (awake) {
|
|
221
209
|
release();
|
|
@@ -275,7 +263,6 @@ const VideoCall: React.FC = () => {
|
|
|
275
263
|
React.useEffect(() => {
|
|
276
264
|
if (
|
|
277
265
|
//isJoinDataFetched === true && (!queryComplete || !isInWaitingRoom)
|
|
278
|
-
|
|
279
266
|
//non waiting room - host/attendee
|
|
280
267
|
(!$config.ENABLE_WAITING_ROOM &&
|
|
281
268
|
isJoinDataFetched === true &&
|
|
@@ -377,10 +364,7 @@ const VideoCall: React.FC = () => {
|
|
|
377
364
|
}
|
|
378
365
|
},
|
|
379
366
|
};
|
|
380
|
-
|
|
381
|
-
const [isMicAvailable, setMicAvailable] = useState(false);
|
|
382
|
-
const [isSpeakerAvailable, setSpeakerAvailable] = useState(false);
|
|
383
|
-
const [isPermissionRequested, setIsPermissionRequested] = useState(false);
|
|
367
|
+
|
|
384
368
|
return (
|
|
385
369
|
<>
|
|
386
370
|
{queryComplete ? (
|
|
@@ -406,30 +390,18 @@ const VideoCall: React.FC = () => {
|
|
|
406
390
|
<VideoQualityContextProvider>
|
|
407
391
|
<ChatUIControlsProvider>
|
|
408
392
|
<ChatNotificationProvider>
|
|
409
|
-
<LayoutProvider
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
setLayout,
|
|
413
|
-
}}>
|
|
414
|
-
<FocusProvider value={{currentFocus, setFocus}}>
|
|
415
|
-
<SidePanelProvider
|
|
416
|
-
value={{
|
|
417
|
-
sidePanel,
|
|
418
|
-
setSidePanel,
|
|
419
|
-
}}>
|
|
393
|
+
<LayoutProvider>
|
|
394
|
+
<FocusProvider>
|
|
395
|
+
<SidePanelProvider>
|
|
420
396
|
<ChatMessagesProvider callActive={callActive}>
|
|
421
397
|
<ScreenShareProvider>
|
|
422
|
-
<RtmConfigure
|
|
423
|
-
setRecordingActive={setRecordingActive}
|
|
424
|
-
callActive={callActive}>
|
|
398
|
+
<RtmConfigure callActive={callActive}>
|
|
425
399
|
<UserPreferenceProvider>
|
|
426
400
|
<CaptionProvider>
|
|
427
401
|
<WaitingRoomProvider>
|
|
428
402
|
<EventsConfigure>
|
|
429
403
|
<RecordingProvider
|
|
430
404
|
value={{
|
|
431
|
-
setRecordingActive,
|
|
432
|
-
isRecordingActive,
|
|
433
405
|
callActive,
|
|
434
406
|
}}>
|
|
435
407
|
<ScreenshareConfigure>
|
|
@@ -463,14 +435,6 @@ const VideoCall: React.FC = () => {
|
|
|
463
435
|
value={{
|
|
464
436
|
callActive,
|
|
465
437
|
setCallActive,
|
|
466
|
-
isCameraAvailable,
|
|
467
|
-
isMicAvailable,
|
|
468
|
-
setCameraAvailable,
|
|
469
|
-
setMicAvailable,
|
|
470
|
-
isPermissionRequested,
|
|
471
|
-
setIsPermissionRequested,
|
|
472
|
-
isSpeakerAvailable,
|
|
473
|
-
setSpeakerAvailable,
|
|
474
438
|
}}>
|
|
475
439
|
<Precall />
|
|
476
440
|
</PreCallProvider>
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
toolbarItemLayoutOptionGridText,
|
|
9
9
|
toolbarItemLayoutOptionSidebarText,
|
|
10
10
|
} from '../../language/default-labels/videoCallScreenLabels';
|
|
11
|
+
import {LogSource, logger} from '../../logger/AppBuilderLogger';
|
|
11
12
|
const isMobileView = isMobileUA();
|
|
12
13
|
const DefaultLayouts: LayoutItem[] = [
|
|
13
14
|
{
|
|
@@ -70,8 +71,15 @@ export const useChangeDefaultLayout = () => {
|
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
return () => {
|
|
73
|
-
setLayout((activeLayout: string) =>
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
setLayout((activeLayout: string) => {
|
|
75
|
+
const layoutIs =
|
|
76
|
+
activeLayout === layout[1].name ? layout[0].name : layout[1].name;
|
|
77
|
+
logger.log(
|
|
78
|
+
LogSource.Internals,
|
|
79
|
+
'LAYOUT',
|
|
80
|
+
`layout changed to - ${layoutIs}`,
|
|
81
|
+
);
|
|
82
|
+
return layoutIs;
|
|
83
|
+
});
|
|
76
84
|
};
|
|
77
85
|
};
|
|
@@ -45,6 +45,7 @@ import {
|
|
|
45
45
|
sttDownloadTranscriptBtnText,
|
|
46
46
|
sttTranscriptPanelHeaderText,
|
|
47
47
|
} from '../../language/default-labels/videoCallScreenLabels';
|
|
48
|
+
import {logger, LogSource} from '../../logger/AppBuilderLogger';
|
|
48
49
|
|
|
49
50
|
export const SettingsHeader = props => {
|
|
50
51
|
const {setSidePanel} = useSidePanel();
|
|
@@ -277,10 +278,19 @@ const TranscriptHeaderActionMenu = (props: TranscriptHeaderActionMenuProps) => {
|
|
|
277
278
|
if (langChanged) {
|
|
278
279
|
restart(language)
|
|
279
280
|
.then(() => {
|
|
280
|
-
|
|
281
|
+
logger.debug(
|
|
282
|
+
LogSource.Internals,
|
|
283
|
+
'STT',
|
|
284
|
+
'stt restarted successfully',
|
|
285
|
+
);
|
|
281
286
|
})
|
|
282
287
|
.catch(error => {
|
|
283
|
-
|
|
288
|
+
logger.error(
|
|
289
|
+
LogSource.Internals,
|
|
290
|
+
'STT',
|
|
291
|
+
'Error in restarting',
|
|
292
|
+
error,
|
|
293
|
+
);
|
|
284
294
|
// Handle the error case
|
|
285
295
|
});
|
|
286
296
|
}
|
|
@@ -40,6 +40,7 @@ import Leftbar, {LeftbarProps} from '../../components/Leftbar';
|
|
|
40
40
|
import Rightbar, {RightbarProps} from '../../components/Rightbar';
|
|
41
41
|
import useFindActiveSpeaker from '../../utils/useFindActiveSpeaker';
|
|
42
42
|
import VBPanel from '../../components/virtual-background/VBPanel';
|
|
43
|
+
import {LogSource, logger} from '../../logger/AppBuilderLogger';
|
|
43
44
|
import {useIsRecordingBot} from '../../subComponents/recording/useIsRecordingBot';
|
|
44
45
|
|
|
45
46
|
const VideoCallScreen = () => {
|
|
@@ -231,6 +232,13 @@ const VideoCallScreen = () => {
|
|
|
231
232
|
const isDesktop = useIsDesktop();
|
|
232
233
|
const isSmall = useIsSmall();
|
|
233
234
|
|
|
235
|
+
useEffect(() => {
|
|
236
|
+
logger.log(
|
|
237
|
+
LogSource.Internals,
|
|
238
|
+
'VIDEO_CALL_ROOM',
|
|
239
|
+
'User has landed on video call room',
|
|
240
|
+
);
|
|
241
|
+
}, []);
|
|
234
242
|
const {isRecordingBot, recordingBotUIConfig} = useIsRecordingBot();
|
|
235
243
|
|
|
236
244
|
return VideocallComponent ? (
|
|
@@ -37,6 +37,7 @@ import {
|
|
|
37
37
|
moreBtnViewInLarge,
|
|
38
38
|
moreBtnViewWhiteboard,
|
|
39
39
|
} from '../../language/default-labels/videoCallScreenLabels';
|
|
40
|
+
import {LogSource, logger} from '../../logger/AppBuilderLogger';
|
|
40
41
|
export interface VideoRendererProps {
|
|
41
42
|
user: ContentInterface;
|
|
42
43
|
isMax?: boolean;
|
|
@@ -361,6 +362,11 @@ const VideoRenderer: React.FC<VideoRendererProps> = ({
|
|
|
361
362
|
!isMobileUA() ? (
|
|
362
363
|
<IconButton
|
|
363
364
|
onPress={() => {
|
|
365
|
+
logger.log(
|
|
366
|
+
LogSource.Internals,
|
|
367
|
+
'LAYOUT',
|
|
368
|
+
`Pin user -> ${user.uid}`,
|
|
369
|
+
);
|
|
364
370
|
dispatch({type: 'UserPin', value: [user.uid]});
|
|
365
371
|
}}
|
|
366
372
|
containerStyle={
|
|
@@ -50,9 +50,11 @@ class RTMEngine {
|
|
|
50
50
|
|
|
51
51
|
return RTMEngine._instance;
|
|
52
52
|
}
|
|
53
|
+
|
|
53
54
|
setLocalUID(localUID: string) {
|
|
54
55
|
this.localUID = localUID;
|
|
55
56
|
}
|
|
57
|
+
|
|
56
58
|
setChannelId(channelID: string) {
|
|
57
59
|
this.channelId = channelID;
|
|
58
60
|
}
|
|
@@ -61,12 +63,15 @@ class RTMEngine {
|
|
|
61
63
|
this.localUID = localUID;
|
|
62
64
|
this.channelId = channelID;
|
|
63
65
|
}
|
|
66
|
+
|
|
64
67
|
get localUid() {
|
|
65
68
|
return this.localUID;
|
|
66
69
|
}
|
|
70
|
+
|
|
67
71
|
get channelUid() {
|
|
68
72
|
return this.channelId;
|
|
69
73
|
}
|
|
74
|
+
|
|
70
75
|
async destroy() {
|
|
71
76
|
try {
|
|
72
77
|
await this.destroyClientInstance();
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
PersistanceLevel,
|
|
22
22
|
} from './types';
|
|
23
23
|
import {adjustUID} from '../rtm/utils';
|
|
24
|
+
import {LogSource, logger} from '../logger/AppBuilderLogger';
|
|
24
25
|
|
|
25
26
|
class Events {
|
|
26
27
|
private source: EventSource = EventSource.core;
|
|
@@ -45,8 +46,10 @@ class Events {
|
|
|
45
46
|
// Step 1: Call RTM API to update local attributes
|
|
46
47
|
await rtmEngine.addOrUpdateLocalUserAttributes([rtmAttribute]);
|
|
47
48
|
} catch (error) {
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
logger.error(
|
|
50
|
+
LogSource.Events,
|
|
51
|
+
'CUSTOM_EVENTS',
|
|
52
|
+
'error occured while updating the value ',
|
|
50
53
|
error,
|
|
51
54
|
);
|
|
52
55
|
}
|
|
@@ -106,18 +109,31 @@ class Events {
|
|
|
106
109
|
(typeof to === 'number' && to <= 0) ||
|
|
107
110
|
(Array.isArray(to) && to?.length === 0)
|
|
108
111
|
) {
|
|
109
|
-
|
|
112
|
+
logger.debug(
|
|
113
|
+
LogSource.Events,
|
|
114
|
+
'CUSTOM_EVENTS',
|
|
115
|
+
'case 1 executed - sending in channel',
|
|
116
|
+
);
|
|
110
117
|
try {
|
|
111
118
|
const channelId = RTMEngine.getInstance().channelUid;
|
|
112
119
|
await rtmEngine.sendMessageByChannelId(channelId, text);
|
|
113
120
|
} catch (error) {
|
|
114
|
-
|
|
121
|
+
logger.error(
|
|
122
|
+
LogSource.Events,
|
|
123
|
+
'CUSTOM_EVENTS',
|
|
124
|
+
'send event case 1 error',
|
|
125
|
+
error,
|
|
126
|
+
);
|
|
115
127
|
throw error;
|
|
116
128
|
}
|
|
117
129
|
}
|
|
118
130
|
// Case 2: send to indivdual
|
|
119
|
-
if (typeof to === 'number' && to
|
|
120
|
-
|
|
131
|
+
if (typeof to === 'number' && to >= 0) {
|
|
132
|
+
logger.debug(
|
|
133
|
+
LogSource.Events,
|
|
134
|
+
'CUSTOM_EVENTS',
|
|
135
|
+
`case 2 executed - sending to individual ${to}`,
|
|
136
|
+
);
|
|
121
137
|
const adjustedUID = adjustUID(to);
|
|
122
138
|
try {
|
|
123
139
|
await rtmEngine.sendMessageToPeer({
|
|
@@ -126,14 +142,23 @@ class Events {
|
|
|
126
142
|
text,
|
|
127
143
|
});
|
|
128
144
|
} catch (error) {
|
|
129
|
-
|
|
145
|
+
logger.error(
|
|
146
|
+
LogSource.Events,
|
|
147
|
+
'CUSTOM_EVENTS',
|
|
148
|
+
'send event case 2 error',
|
|
149
|
+
error,
|
|
150
|
+
);
|
|
130
151
|
throw error;
|
|
131
152
|
}
|
|
132
153
|
}
|
|
133
154
|
// Case 3: send to multiple individuals
|
|
134
155
|
if (typeof to === 'object' && Array.isArray(to)) {
|
|
135
|
-
|
|
136
|
-
|
|
156
|
+
logger.debug(
|
|
157
|
+
LogSource.Events,
|
|
158
|
+
'CUSTOM_EVENTS',
|
|
159
|
+
'case 3 executed - sending to multiple individuals',
|
|
160
|
+
to,
|
|
161
|
+
);
|
|
137
162
|
try {
|
|
138
163
|
for (const uid of to) {
|
|
139
164
|
const adjustedUID = adjustUID(uid);
|
|
@@ -144,7 +169,12 @@ class Events {
|
|
|
144
169
|
});
|
|
145
170
|
}
|
|
146
171
|
} catch (error) {
|
|
147
|
-
|
|
172
|
+
logger.error(
|
|
173
|
+
LogSource.Events,
|
|
174
|
+
'CUSTOM_EVENTS',
|
|
175
|
+
'send event case 3 error',
|
|
176
|
+
error,
|
|
177
|
+
);
|
|
148
178
|
throw error;
|
|
149
179
|
}
|
|
150
180
|
}
|
|
@@ -162,8 +192,9 @@ class Events {
|
|
|
162
192
|
*/
|
|
163
193
|
on = (eventName: string, listener: EventCallback): Function => {
|
|
164
194
|
try {
|
|
165
|
-
if (!this._validateEvt(eventName) || !this._validateListener(listener))
|
|
195
|
+
if (!this._validateEvt(eventName) || !this._validateListener(listener)) {
|
|
166
196
|
return;
|
|
197
|
+
}
|
|
167
198
|
EventUtils.addListener(eventName, listener, this.source);
|
|
168
199
|
console.log('CUSTOM_EVENT_API event listener registered', eventName);
|
|
169
200
|
return () => {
|
|
@@ -171,7 +202,12 @@ class Events {
|
|
|
171
202
|
EventUtils.removeListener(eventName, listener, this.source);
|
|
172
203
|
};
|
|
173
204
|
} catch (error) {
|
|
174
|
-
|
|
205
|
+
logger.error(
|
|
206
|
+
LogSource.Events,
|
|
207
|
+
'CUSTOM_EVENTS',
|
|
208
|
+
'Error: events.on',
|
|
209
|
+
error,
|
|
210
|
+
);
|
|
175
211
|
}
|
|
176
212
|
};
|
|
177
213
|
|
|
@@ -202,7 +238,12 @@ class Events {
|
|
|
202
238
|
EventUtils.removeAll(this.source);
|
|
203
239
|
}
|
|
204
240
|
} catch (error) {
|
|
205
|
-
|
|
241
|
+
logger.error(
|
|
242
|
+
LogSource.Events,
|
|
243
|
+
'CUSTOM_EVENTS',
|
|
244
|
+
'Error: events.off',
|
|
245
|
+
error,
|
|
246
|
+
);
|
|
206
247
|
}
|
|
207
248
|
};
|
|
208
249
|
|
|
@@ -224,7 +265,9 @@ class Events {
|
|
|
224
265
|
persistLevel: PersistanceLevel = PersistanceLevel.None,
|
|
225
266
|
receiver: ReceiverUid = -1,
|
|
226
267
|
) => {
|
|
227
|
-
if (!this._validateEvt(eventName))
|
|
268
|
+
if (!this._validateEvt(eventName)) {
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
228
271
|
|
|
229
272
|
const persistValue = JSON.stringify({
|
|
230
273
|
payload,
|
|
@@ -244,13 +287,24 @@ class Events {
|
|
|
244
287
|
try {
|
|
245
288
|
await this._persist(eventName, persistValue);
|
|
246
289
|
} catch (error) {
|
|
247
|
-
|
|
290
|
+
logger.error(LogSource.Events, 'CUSTOM_EVENTS', 'persist error', error);
|
|
248
291
|
}
|
|
249
292
|
}
|
|
250
293
|
try {
|
|
294
|
+
logger.log(
|
|
295
|
+
LogSource.Events,
|
|
296
|
+
'CUSTOM_EVENTS',
|
|
297
|
+
`sending event -> ${eventName}`,
|
|
298
|
+
persistValue,
|
|
299
|
+
);
|
|
251
300
|
await this._send(rtmPayload, receiver);
|
|
252
301
|
} catch (error) {
|
|
253
|
-
|
|
302
|
+
logger.error(
|
|
303
|
+
LogSource.Events,
|
|
304
|
+
'CUSTOM_EVENTS',
|
|
305
|
+
'sending event failed',
|
|
306
|
+
error,
|
|
307
|
+
);
|
|
254
308
|
}
|
|
255
309
|
};
|
|
256
310
|
}
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
toolbarItemLayoutOptionGridText,
|
|
15
15
|
toolbarItemLayoutOptionSidebarText,
|
|
16
16
|
} from '../language/default-labels/videoCallScreenLabels';
|
|
17
|
+
import {LogSource, logger} from '../logger/AppBuilderLogger';
|
|
17
18
|
|
|
18
19
|
interface LayoutIconDropdownProps {
|
|
19
20
|
modalPosition?: {
|
|
@@ -52,6 +53,11 @@ const LayoutIconDropdown = (props: LayoutIconDropdownProps) => {
|
|
|
52
53
|
const renderDropdown = () => {
|
|
53
54
|
const data = layouts.map((item, index) => {
|
|
54
55
|
let onPress = () => {
|
|
56
|
+
logger.log(
|
|
57
|
+
LogSource.Internals,
|
|
58
|
+
'LAYOUT',
|
|
59
|
+
`Layout changed to - ${item.name}`,
|
|
60
|
+
);
|
|
55
61
|
setLayout(item.name);
|
|
56
62
|
setShowDropdown(false);
|
|
57
63
|
};
|
|
@@ -39,6 +39,7 @@ import {
|
|
|
39
39
|
toolbarItemMicrophoneText,
|
|
40
40
|
toolbarItemMicrophoneTooltipText,
|
|
41
41
|
} from '../language/default-labels/videoCallScreenLabels';
|
|
42
|
+
import {LogSource, logger} from '../logger/AppBuilderLogger';
|
|
42
43
|
|
|
43
44
|
/**
|
|
44
45
|
* A component to mute / unmute the local audio
|
|
@@ -79,15 +80,24 @@ function LocalAudioMute(props: LocalAudioMuteProps) {
|
|
|
79
80
|
rtcProps: {callActive},
|
|
80
81
|
} = useContext(PropsContext);
|
|
81
82
|
|
|
82
|
-
const onPress = () => {
|
|
83
|
-
localMute(MUTE_LOCAL_TYPE.audio);
|
|
84
|
-
};
|
|
85
83
|
const isAudioEnabled = local.audio === ToggleState.enabled;
|
|
86
84
|
|
|
87
85
|
const permissionDenied =
|
|
88
86
|
local.permissionStatus === PermissionState.REJECTED ||
|
|
89
87
|
local.permissionStatus === PermissionState.GRANTED_FOR_CAM_ONLY;
|
|
90
88
|
|
|
89
|
+
const onPress = () => {
|
|
90
|
+
logger.log(
|
|
91
|
+
LogSource.Internals,
|
|
92
|
+
'LOCAL_MUTE',
|
|
93
|
+
'toggle mute/unmute local audio',
|
|
94
|
+
{
|
|
95
|
+
isAudioEnabled,
|
|
96
|
+
permissionDenied,
|
|
97
|
+
},
|
|
98
|
+
);
|
|
99
|
+
localMute(MUTE_LOCAL_TYPE.audio);
|
|
100
|
+
};
|
|
91
101
|
const audioLabel = permissionDenied
|
|
92
102
|
? micButtonLabel(I18nDeviceStatus.PERMISSION_DENIED)
|
|
93
103
|
: isAudioEnabled
|
|
@@ -9,8 +9,9 @@ import {useScreenshare} from './screenshare/useScreenshare';
|
|
|
9
9
|
import {useToolbarMenu} from '../utils/useMenu';
|
|
10
10
|
import ToolbarMenuItem from '../atoms/ToolbarMenuItem';
|
|
11
11
|
import {useActionSheet} from '../utils/useActionSheet';
|
|
12
|
-
import {useString} from '
|
|
13
|
-
import {toolbarItemLeaveText} from '
|
|
12
|
+
import {useString} from '../../src/utils/useString';
|
|
13
|
+
import {toolbarItemLeaveText} from '../../src/language/default-labels/videoCallScreenLabels';
|
|
14
|
+
import {LogSource, logger} from '../logger/AppBuilderLogger';
|
|
14
15
|
import useEndCall from '../utils/useEndCall';
|
|
15
16
|
|
|
16
17
|
export interface LocalEndcallProps {
|
|
@@ -22,7 +23,11 @@ export interface LocalEndcallProps {
|
|
|
22
23
|
export const stopForegroundService = () => {
|
|
23
24
|
if (Platform.OS === 'android') {
|
|
24
25
|
ReactNativeForegroundService.stop();
|
|
25
|
-
|
|
26
|
+
logger.debug(
|
|
27
|
+
LogSource.Internals,
|
|
28
|
+
'CONTROLS',
|
|
29
|
+
'Local end call - stopping foreground service, bg audio for android only',
|
|
30
|
+
);
|
|
26
31
|
}
|
|
27
32
|
};
|
|
28
33
|
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
toolbarItemCameraText,
|
|
43
43
|
toolbarItemCameraTooltipText,
|
|
44
44
|
} from '../language/default-labels/videoCallScreenLabels';
|
|
45
|
-
|
|
45
|
+
import {LogSource, logger} from '../logger/AppBuilderLogger';
|
|
46
46
|
/**
|
|
47
47
|
* A component to mute / unmute the local video
|
|
48
48
|
*/
|
|
@@ -86,7 +86,21 @@ function LocalVideoMute(props: LocalVideoMuteProps) {
|
|
|
86
86
|
const onPress = () => {
|
|
87
87
|
//if screensharing is going on native - to turn on video screenshare should be turn off
|
|
88
88
|
//show confirm popup to stop the screenshare
|
|
89
|
+
logger.log(
|
|
90
|
+
LogSource.Internals,
|
|
91
|
+
'LOCAL_MUTE',
|
|
92
|
+
'toggle mute/unmute local video',
|
|
93
|
+
{
|
|
94
|
+
isVideoEnabled,
|
|
95
|
+
permissionDenied,
|
|
96
|
+
},
|
|
97
|
+
);
|
|
89
98
|
if ((isAndroid() || isIOS()) && isScreenshareActive) {
|
|
99
|
+
logger.log(
|
|
100
|
+
LogSource.Internals,
|
|
101
|
+
'LOCAL_MUTE',
|
|
102
|
+
'Screenshare is active. To turn on video screenshare should be turn off',
|
|
103
|
+
);
|
|
90
104
|
setShowStopScreenSharePopup(true);
|
|
91
105
|
} else {
|
|
92
106
|
localMute(MUTE_LOCAL_TYPE.video);
|