agora-appbuilder-core 4.1.9-beta.3 → 4.1.10-beta.1
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 +2 -2
- package/template/Gulpfile.js +0 -16
- package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +1 -3
- package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +1 -2
- package/template/agora-rn-uikit/src/Reducer/index.ts +0 -2
- package/template/agora-rn-uikit/src/Rtc/Join.tsx +11 -25
- package/template/agora-rn-uikit/src/RtcConfigure.tsx +1 -14
- package/template/bridge/rtc/webNg/RtcEngine.ts +2 -2
- package/template/bridge/rtm/web/index.ts +30 -0
- package/template/customization-api/typeDefinition.ts +1 -0
- package/template/defaultConfig.js +3 -2
- package/template/global.d.ts +1 -0
- package/template/package.json +0 -2
- package/template/src/AppRoutes.tsx +3 -3
- package/template/src/ai-agent/components/ControlButtons.tsx +1 -1
- package/template/src/assets/font-styles.css +36 -0
- package/template/src/assets/fonts/icomoon.ttf +0 -0
- package/template/src/assets/selection.json +1 -1
- package/template/src/atoms/CustomIcon.tsx +8 -0
- package/template/src/atoms/Dropdown.tsx +5 -0
- package/template/src/atoms/TertiaryButton.tsx +1 -1
- package/template/src/atoms/UserAvatar.tsx +1 -1
- package/template/src/components/ChatContext.ts +5 -3
- package/template/src/components/Controls.tsx +68 -22
- package/template/src/components/DeviceConfigure.tsx +1 -1
- package/template/src/components/EventsConfigure.tsx +22 -17
- package/template/src/components/Navbar.tsx +14 -11
- package/template/src/components/RTMConfigure.tsx +31 -1036
- package/template/src/components/UserGlobalPreferenceProvider.tsx +227 -0
- package/template/src/components/beauty-effect/useBeautyEffects.tsx +50 -13
- package/template/src/components/breakout-room/BreakoutRoomPanel.tsx +58 -0
- package/template/src/components/breakout-room/context/BreakoutRoomContext.tsx +2508 -0
- package/template/src/components/breakout-room/events/BreakoutRoomEventsConfigure.tsx +272 -0
- package/template/src/components/breakout-room/events/constants.ts +17 -0
- package/template/src/components/breakout-room/hoc/BreakoutRoomNameRenderer.tsx +68 -0
- package/template/src/components/breakout-room/hooks/useBreakoutRoomExit.ts +49 -0
- package/template/src/components/breakout-room/state/reducer.ts +522 -0
- package/template/src/components/breakout-room/state/types.ts +54 -0
- package/template/src/components/breakout-room/ui/BreakoutMeetingTitle.tsx +60 -0
- package/template/src/components/breakout-room/ui/BreakoutRoomActionMenu.tsx +136 -0
- package/template/src/components/breakout-room/ui/BreakoutRoomAnnouncementModal.tsx +135 -0
- package/template/src/components/breakout-room/ui/BreakoutRoomGroupSettings.tsx +588 -0
- package/template/src/components/breakout-room/ui/BreakoutRoomMainRoomUsers.tsx +142 -0
- package/template/src/components/breakout-room/ui/BreakoutRoomMemberActionMenu.tsx +122 -0
- package/template/src/components/breakout-room/ui/BreakoutRoomParticipants.tsx +124 -0
- package/template/src/components/breakout-room/ui/BreakoutRoomRaiseHand.tsx +65 -0
- package/template/src/components/breakout-room/ui/BreakoutRoomRenameModal.tsx +227 -0
- package/template/src/components/breakout-room/ui/BreakoutRoomSettings.tsx +140 -0
- package/template/src/components/breakout-room/ui/BreakoutRoomTransition.tsx +52 -0
- package/template/src/components/breakout-room/ui/BreakoutRoomView.tsx +193 -0
- package/template/src/components/breakout-room/ui/ExitBreakoutRoomIconButton.tsx +79 -0
- package/template/src/components/breakout-room/ui/ParticipantManualAssignmentModal.tsx +638 -0
- package/template/src/components/breakout-room/ui/SelectParticipantAssignmentStrategy.tsx +57 -0
- package/template/src/components/chat/chatConfigure.tsx +7 -1
- package/template/src/components/chat-messages/useChatMessages.tsx +43 -11
- package/template/src/components/common/Dividers.tsx +53 -0
- package/template/src/components/controls/toolbar-items/ExitBreakoutRoomToolbarItem.tsx +13 -0
- package/template/src/components/controls/useControlPermissionMatrix.tsx +32 -4
- package/template/src/components/participants/AllHostParticipants.tsx +10 -2
- package/template/src/components/participants/Participant.tsx +7 -1
- package/template/src/components/participants/UserActionMenuOptions.tsx +12 -2
- package/template/src/components/precall/joinWaitingRoomBtn.native.tsx +12 -8
- package/template/src/components/precall/joinWaitingRoomBtn.tsx +14 -10
- package/template/src/components/raise-hand/RaiseHandButton.tsx +50 -0
- package/template/src/components/raise-hand/RaiseHandProvider.tsx +308 -0
- package/template/src/components/raise-hand/index.ts +14 -0
- package/template/src/components/recordings/RecordingsDateTable.tsx +3 -2
- package/template/src/components/room-info/useCurrentRoomInfo.tsx +42 -0
- package/template/src/components/room-info/useSetBreakoutRoomInfo.tsx +64 -0
- package/template/src/components/useUserPreference.tsx +39 -12
- package/template/src/components/virtual-background/useVB.tsx +18 -0
- package/template/src/components/whiteboard/WhiteboardConfigure.tsx +27 -0
- package/template/src/language/default-labels/videoCallScreenLabels.ts +7 -0
- package/template/src/logger/AppBuilderLogger.tsx +11 -3
- package/template/src/pages/VideoCall.tsx +171 -518
- package/template/src/pages/video-call/BreakoutVideoCall.tsx +213 -0
- package/template/src/pages/video-call/SidePanelHeader.tsx +17 -0
- package/template/src/pages/video-call/VideoCallContent.tsx +211 -0
- package/template/src/pages/video-call/VideoCallScreen.tsx +18 -0
- package/template/src/pages/video-call/VideoCallScreenWrapper.tsx +0 -1
- package/template/src/pages/video-call/VideoCallStateWrapper.tsx +495 -0
- package/template/src/rtm/RTMConfigureBreakoutRoomProvider.tsx +882 -0
- package/template/src/rtm/RTMConfigureMainRoomProvider.tsx +757 -0
- package/template/src/rtm/RTMCoreProvider.tsx +419 -0
- package/template/src/rtm/RTMEngine.ts +188 -60
- package/template/src/rtm/RTMGlobalStateProvider.tsx +706 -0
- package/template/src/rtm/RTMStatusBanner.tsx +99 -0
- package/template/src/rtm/constants.ts +12 -0
- package/template/src/rtm/hooks/useMainRoomUserDisplayName.ts +45 -0
- package/template/src/rtm/rtm-presence-utils.ts +344 -0
- package/template/src/rtm/utils.ts +68 -1
- package/template/src/rtm-events/constants.ts +40 -1
- package/template/src/rtm-events-api/Events.ts +62 -19
- package/template/src/subComponents/ChatBubble.tsx +3 -3
- package/template/src/subComponents/ChatContainer.tsx +19 -9
- package/template/src/subComponents/LocalAudioMute.tsx +2 -2
- package/template/src/subComponents/LocalVideoMute.tsx +2 -2
- package/template/src/subComponents/SidePanelEnum.tsx +1 -0
- package/template/src/subComponents/caption/useCaption.tsx +1 -1
- package/template/src/subComponents/chat/ChatAnnouncementView.tsx +65 -0
- package/template/src/subComponents/chat/ChatSendButton.tsx +1 -0
- package/template/src/subComponents/screenshare/ScreenshareButton.tsx +16 -0
- package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +1 -1
- package/template/src/subComponents/waiting-rooms/WaitingRoomControls.tsx +7 -4
- package/template/src/utils/useDebouncedCallback.tsx +20 -0
- package/template/src/utils/useEndCall.ts +0 -2
- package/template/src/utils/useMuteToggleLocal.ts +14 -10
- package/template/agora-rn-uikit/src/Reducer/Spotlight.ts +0 -11
- package/template/agora-rn-uikit/src/Reducer/UserBanned.ts +0 -11
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
information visit https://appbuilder.agora.io.
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
|
-
import React, {useState, useContext, useEffect, useRef} from 'react';
|
|
12
|
+
import React, {useState, useContext, useEffect, useRef, useMemo} from 'react';
|
|
14
13
|
import {View, StyleSheet, Text} from 'react-native';
|
|
15
14
|
import {
|
|
16
15
|
RtcConfigure,
|
|
@@ -20,10 +19,12 @@ import {
|
|
|
20
19
|
LocalUserContext,
|
|
21
20
|
UidType,
|
|
22
21
|
CallbacksInterface,
|
|
22
|
+
RtcPropsInterface,
|
|
23
23
|
} from '../../agora-rn-uikit';
|
|
24
24
|
import styles from '../components/styles';
|
|
25
25
|
import {useParams, useHistory} from '../components/Router';
|
|
26
26
|
import RtmConfigure from '../components/RTMConfigure';
|
|
27
|
+
import RTMConfigureMainRoomProvider from '../rtm/RTMConfigureMainRoomProvider';
|
|
27
28
|
import DeviceConfigure from '../components/DeviceConfigure';
|
|
28
29
|
import Logo from '../subComponents/Logo';
|
|
29
30
|
import {useHasBrandLogo, isMobileUA, isWebInternal} from '../utils/common';
|
|
@@ -79,62 +80,31 @@ import {LogSource, logger} from '../logger/AppBuilderLogger';
|
|
|
79
80
|
import {useCustomization} from 'customization-implementation';
|
|
80
81
|
import {BeautyEffectProvider} from '../components/beauty-effect/useBeautyEffects';
|
|
81
82
|
import {UserActionMenuProvider} from '../components/useUserActionMenu';
|
|
83
|
+
import {RaiseHandProvider} from '../components/raise-hand';
|
|
82
84
|
import Toast from '../../react-native-toast-message';
|
|
83
85
|
import {AuthErrorCodes} from '../utils/common';
|
|
86
|
+
import {BreakoutRoomProvider} from '../components/breakout-room/context/BreakoutRoomContext';
|
|
87
|
+
import BreakoutRoomEventsConfigure from '../components/breakout-room/events/BreakoutRoomEventsConfigure';
|
|
88
|
+
import {RTM_ROOMS} from '../rtm/constants';
|
|
84
89
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
* 1: (Default) 128-bit AES encryption, XTS mode.
|
|
93
|
-
*/
|
|
94
|
-
AES128XTS = 1,
|
|
95
|
-
/**
|
|
96
|
-
* 2: 128-bit AES encryption, ECB mode.
|
|
97
|
-
*/
|
|
98
|
-
AES128ECB = 2,
|
|
99
|
-
/**
|
|
100
|
-
* 3: 256-bit AES encryption, XTS mode.
|
|
101
|
-
*/
|
|
102
|
-
AES256XTS = 3,
|
|
103
|
-
/**
|
|
104
|
-
* 4: 128-bit SM4 encryption, ECB mode.
|
|
105
|
-
*
|
|
106
|
-
* @since v3.1.2.
|
|
107
|
-
*/
|
|
108
|
-
SM4128ECB = 4,
|
|
109
|
-
/**
|
|
110
|
-
* 6: 256-bit AES encryption, GCM mode.
|
|
111
|
-
*
|
|
112
|
-
* @since v3.1.2.
|
|
113
|
-
*/
|
|
114
|
-
AES256GCM = 6,
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* 7: 128-bit GCM encryption, GCM mode.
|
|
118
|
-
*
|
|
119
|
-
* @since v3.4.5
|
|
120
|
-
*/
|
|
121
|
-
AES128GCM2 = 7,
|
|
122
|
-
/**
|
|
123
|
-
* 8: 256-bit GCM encryption, GCM mode.
|
|
124
|
-
* @since v3.1.2.
|
|
125
|
-
* Compared to AES256GCM encryption mode, AES256GCM2 encryption mode is more secure and requires you to set the salt (encryptionKdfSalt).
|
|
126
|
-
*/
|
|
127
|
-
AES256GCM2 = 8,
|
|
90
|
+
interface VideoCallProps {
|
|
91
|
+
callActive: boolean;
|
|
92
|
+
setCallActive: React.Dispatch<React.SetStateAction<boolean>>;
|
|
93
|
+
rtcProps: RtcPropsInterface;
|
|
94
|
+
setRtcProps: React.Dispatch<React.SetStateAction<Partial<RtcPropsInterface>>>;
|
|
95
|
+
callbacks: CallbacksInterface;
|
|
96
|
+
styleProps: any;
|
|
128
97
|
}
|
|
129
98
|
|
|
130
|
-
const VideoCall
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
99
|
+
const VideoCall = (videoCallProps: VideoCallProps) => {
|
|
100
|
+
const {
|
|
101
|
+
callActive,
|
|
102
|
+
setCallActive,
|
|
103
|
+
rtcProps,
|
|
104
|
+
setRtcProps,
|
|
105
|
+
callbacks,
|
|
106
|
+
styleProps,
|
|
107
|
+
} = videoCallProps;
|
|
138
108
|
/**
|
|
139
109
|
* Should we set the callscreen to active ??
|
|
140
110
|
* a) If Recording bot( i.e prop: recordingBot) is TRUE then it means,
|
|
@@ -144,35 +114,10 @@ const VideoCall: React.FC = () => {
|
|
|
144
114
|
* b) If Recording bot( i.e prop: recordingBot) is FALSE then we should set
|
|
145
115
|
* the callActive depending upon the value of magic variable - $config.PRECALL
|
|
146
116
|
*/
|
|
147
|
-
const shouldCallBeSetToActive = isRecordingBot
|
|
148
|
-
? true
|
|
149
|
-
: $config.PRECALL
|
|
150
|
-
? false
|
|
151
|
-
: true;
|
|
152
|
-
const [callActive, setCallActive] = useState(shouldCallBeSetToActive);
|
|
153
117
|
const [isRecordingActive, setRecordingActive] = useState(false);
|
|
154
|
-
const [queryComplete, setQueryComplete] = useState(false);
|
|
155
|
-
const [waitingRoomAttendeeJoined, setWaitingRoomAttendeeJoined] =
|
|
156
|
-
useState(false);
|
|
157
118
|
const [sttAutoStarted, setSttAutoStarted] = useState(false);
|
|
158
119
|
const [recordingAutoStarted, setRecordingAutoStarted] = useState(false);
|
|
159
120
|
|
|
160
|
-
const {phrase} = useParams<{phrase: string}>();
|
|
161
|
-
|
|
162
|
-
const {store} = useContext(StorageContext);
|
|
163
|
-
const {
|
|
164
|
-
join: SdkJoinState,
|
|
165
|
-
microphoneDevice: sdkMicrophoneDevice,
|
|
166
|
-
cameraDevice: sdkCameraDevice,
|
|
167
|
-
clearState,
|
|
168
|
-
} = useContext(SdkApiContext);
|
|
169
|
-
|
|
170
|
-
// commented for v1 release
|
|
171
|
-
const afterEndCall = useCustomization(
|
|
172
|
-
data =>
|
|
173
|
-
data?.lifecycle?.useAfterEndCall && data?.lifecycle?.useAfterEndCall(),
|
|
174
|
-
);
|
|
175
|
-
|
|
176
121
|
const {PrefereceWrapper} = useCustomization(data => {
|
|
177
122
|
let components: {
|
|
178
123
|
PrefereceWrapper: React.ComponentType;
|
|
@@ -190,454 +135,162 @@ const VideoCall: React.FC = () => {
|
|
|
190
135
|
return components;
|
|
191
136
|
});
|
|
192
137
|
|
|
193
|
-
const [rtcProps, setRtcProps] = React.useState({
|
|
194
|
-
appId: $config.APP_ID,
|
|
195
|
-
channel: null,
|
|
196
|
-
uid: null,
|
|
197
|
-
token: null,
|
|
198
|
-
rtm: null,
|
|
199
|
-
screenShareUid: null,
|
|
200
|
-
screenShareToken: null,
|
|
201
|
-
profile: $config.PROFILE,
|
|
202
|
-
screenShareProfile: $config.SCREEN_SHARE_PROFILE,
|
|
203
|
-
dual: true,
|
|
204
|
-
encryption: $config.ENCRYPTION_ENABLED
|
|
205
|
-
? {key: null, mode: RnEncryptionEnum.AES128GCM2, screenKey: null}
|
|
206
|
-
: false,
|
|
207
|
-
role: ClientRoleType.ClientRoleBroadcaster,
|
|
208
|
-
geoFencing: $config.GEO_FENCING,
|
|
209
|
-
audioRoom: $config.AUDIO_ROOM,
|
|
210
|
-
activeSpeaker: $config.ACTIVE_SPEAKER,
|
|
211
|
-
preferredCameraId:
|
|
212
|
-
sdkCameraDevice.deviceId || store?.activeDeviceId?.videoinput || null,
|
|
213
|
-
preferredMicrophoneId:
|
|
214
|
-
sdkMicrophoneDevice.deviceId || store?.activeDeviceId?.audioinput || null,
|
|
215
|
-
recordingBot: isRecordingBot ? true : false,
|
|
216
|
-
});
|
|
217
|
-
|
|
218
|
-
const history = useHistory();
|
|
219
|
-
const currentMeetingPhrase = useRef(history.location.pathname);
|
|
220
|
-
|
|
221
|
-
const useJoin = useJoinRoom();
|
|
222
|
-
const {setRoomInfo} = useSetRoomInfo();
|
|
223
|
-
const {isJoinDataFetched, data, isInWaitingRoom, waitingRoomStatus} =
|
|
224
|
-
useRoomInfo();
|
|
225
|
-
|
|
226
|
-
useEffect(() => {
|
|
227
|
-
if (!isJoinDataFetched) {
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
logger.log(LogSource.Internals, 'SET_MEETING_DETAILS', 'Room details', {
|
|
231
|
-
user_id: data?.uid || '',
|
|
232
|
-
meeting_title: data?.meetingTitle || '',
|
|
233
|
-
channel_id: data?.channel,
|
|
234
|
-
host_id: data?.roomId?.host || '',
|
|
235
|
-
attendee_id: data?.roomId?.attendee || '',
|
|
236
|
-
});
|
|
237
|
-
}, [isJoinDataFetched, data, phrase]);
|
|
238
|
-
|
|
239
|
-
React.useEffect(() => {
|
|
240
|
-
return () => {
|
|
241
|
-
logger.debug(
|
|
242
|
-
LogSource.Internals,
|
|
243
|
-
'VIDEO_CALL_ROOM',
|
|
244
|
-
'Videocall unmounted',
|
|
245
|
-
);
|
|
246
|
-
setRoomInfo(prevState => {
|
|
247
|
-
return {
|
|
248
|
-
...RoomInfoDefaultValue,
|
|
249
|
-
loginToken: prevState?.loginToken,
|
|
250
|
-
};
|
|
251
|
-
});
|
|
252
|
-
if (awake) {
|
|
253
|
-
release();
|
|
254
|
-
}
|
|
255
|
-
};
|
|
256
|
-
}, []);
|
|
257
|
-
|
|
258
|
-
useEffect(() => {
|
|
259
|
-
if (!SdkJoinState.phrase) {
|
|
260
|
-
useJoin(phrase, RoomInfoDefaultValue.roomPreference)
|
|
261
|
-
.then(() => {
|
|
262
|
-
logger.log(
|
|
263
|
-
LogSource.Internals,
|
|
264
|
-
'JOIN_MEETING',
|
|
265
|
-
'Join channel success',
|
|
266
|
-
);
|
|
267
|
-
})
|
|
268
|
-
.catch(error => {
|
|
269
|
-
const errorCode = error?.code;
|
|
270
|
-
if (AuthErrorCodes.indexOf(errorCode) !== -1 && isSDK()) {
|
|
271
|
-
SDKEvents.emit('unauthorized', error);
|
|
272
|
-
}
|
|
273
|
-
logger.error(
|
|
274
|
-
LogSource.Internals,
|
|
275
|
-
'JOIN_MEETING',
|
|
276
|
-
'Join channel error',
|
|
277
|
-
JSON.stringify(error || {}),
|
|
278
|
-
);
|
|
279
|
-
setGlobalErrorMessage(error);
|
|
280
|
-
history.push('/');
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
}, []);
|
|
284
|
-
|
|
285
|
-
useEffect(() => {
|
|
286
|
-
if (!isSDK() || !SdkJoinState.initialized) {
|
|
287
|
-
return;
|
|
288
|
-
}
|
|
289
|
-
const {
|
|
290
|
-
phrase: sdkMeetingPhrase,
|
|
291
|
-
meetingDetails: sdkMeetingDetails,
|
|
292
|
-
skipPrecall,
|
|
293
|
-
promise,
|
|
294
|
-
preference,
|
|
295
|
-
} = SdkJoinState;
|
|
296
|
-
|
|
297
|
-
const sdkMeetingPath = `/${sdkMeetingPhrase}`;
|
|
298
|
-
|
|
299
|
-
setCallActive(skipPrecall);
|
|
300
|
-
|
|
301
|
-
if (sdkMeetingDetails) {
|
|
302
|
-
setQueryComplete(false);
|
|
303
|
-
setRoomInfo(roomInfo => {
|
|
304
|
-
return {
|
|
305
|
-
...roomInfo,
|
|
306
|
-
isJoinDataFetched: true,
|
|
307
|
-
data: {
|
|
308
|
-
...roomInfo.data,
|
|
309
|
-
...sdkMeetingDetails,
|
|
310
|
-
},
|
|
311
|
-
roomPreference: preference,
|
|
312
|
-
};
|
|
313
|
-
});
|
|
314
|
-
} else if (sdkMeetingPhrase) {
|
|
315
|
-
setQueryComplete(false);
|
|
316
|
-
currentMeetingPhrase.current = sdkMeetingPath;
|
|
317
|
-
useJoin(sdkMeetingPhrase, preference)
|
|
318
|
-
.then(() => {
|
|
319
|
-
logger.log(
|
|
320
|
-
LogSource.Internals,
|
|
321
|
-
'JOIN_MEETING',
|
|
322
|
-
'Join channel success',
|
|
323
|
-
);
|
|
324
|
-
})
|
|
325
|
-
.catch(error => {
|
|
326
|
-
const errorCode = error?.code;
|
|
327
|
-
if (AuthErrorCodes.indexOf(errorCode) !== -1 && isSDK()) {
|
|
328
|
-
SDKEvents.emit('unauthorized', error);
|
|
329
|
-
}
|
|
330
|
-
logger.error(
|
|
331
|
-
LogSource.Internals,
|
|
332
|
-
'JOIN_MEETING',
|
|
333
|
-
'Join channel error',
|
|
334
|
-
JSON.stringify(error || {}),
|
|
335
|
-
);
|
|
336
|
-
setGlobalErrorMessage(error);
|
|
337
|
-
history.push('/');
|
|
338
|
-
currentMeetingPhrase.current = '';
|
|
339
|
-
promise.rej(error);
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
}, [SdkJoinState]);
|
|
343
|
-
|
|
344
|
-
React.useEffect(() => {
|
|
345
|
-
if (
|
|
346
|
-
//isJoinDataFetched === true && (!queryComplete || !isInWaitingRoom)
|
|
347
|
-
//non waiting room - host/attendee
|
|
348
|
-
(!$config.ENABLE_WAITING_ROOM &&
|
|
349
|
-
isJoinDataFetched === true &&
|
|
350
|
-
!queryComplete) ||
|
|
351
|
-
//waiting room - host
|
|
352
|
-
($config.ENABLE_WAITING_ROOM &&
|
|
353
|
-
isJoinDataFetched === true &&
|
|
354
|
-
data.isHost &&
|
|
355
|
-
!queryComplete) ||
|
|
356
|
-
//waiting room - attendee
|
|
357
|
-
($config.ENABLE_WAITING_ROOM &&
|
|
358
|
-
isJoinDataFetched === true &&
|
|
359
|
-
!data.isHost &&
|
|
360
|
-
(!queryComplete || !isInWaitingRoom) &&
|
|
361
|
-
!waitingRoomAttendeeJoined)
|
|
362
|
-
) {
|
|
363
|
-
setRtcProps(prevRtcProps => ({
|
|
364
|
-
...prevRtcProps,
|
|
365
|
-
channel: data.channel,
|
|
366
|
-
uid: data.uid,
|
|
367
|
-
token: data.token,
|
|
368
|
-
rtm: data.rtmToken,
|
|
369
|
-
encryption: $config.ENCRYPTION_ENABLED
|
|
370
|
-
? {
|
|
371
|
-
key: data.encryptionSecret,
|
|
372
|
-
mode: data.encryptionMode,
|
|
373
|
-
screenKey: data.encryptionSecret,
|
|
374
|
-
salt: data.encryptionSecretSalt,
|
|
375
|
-
}
|
|
376
|
-
: false,
|
|
377
|
-
screenShareUid: data.screenShareUid,
|
|
378
|
-
screenShareToken: data.screenShareToken,
|
|
379
|
-
role: data.isHost
|
|
380
|
-
? ClientRoleType.ClientRoleBroadcaster
|
|
381
|
-
: ClientRoleType.ClientRoleAudience,
|
|
382
|
-
preventJoin:
|
|
383
|
-
!$config.ENABLE_WAITING_ROOM ||
|
|
384
|
-
($config.ENABLE_WAITING_ROOM && data.isHost) ||
|
|
385
|
-
($config.ENABLE_WAITING_ROOM &&
|
|
386
|
-
!data.isHost &&
|
|
387
|
-
waitingRoomStatus === WaitingRoomStatus.APPROVED)
|
|
388
|
-
? false
|
|
389
|
-
: true,
|
|
390
|
-
}));
|
|
391
|
-
|
|
392
|
-
if (
|
|
393
|
-
$config.ENABLE_WAITING_ROOM &&
|
|
394
|
-
!data.isHost &&
|
|
395
|
-
waitingRoomStatus === WaitingRoomStatus.APPROVED
|
|
396
|
-
) {
|
|
397
|
-
setWaitingRoomAttendeeJoined(true);
|
|
398
|
-
}
|
|
399
|
-
// 1. Store the display name from API
|
|
400
|
-
// if (data.username) {
|
|
401
|
-
// setUsername(data.username);
|
|
402
|
-
// }
|
|
403
|
-
setQueryComplete(true);
|
|
404
|
-
}
|
|
405
|
-
}, [isJoinDataFetched, data, queryComplete]);
|
|
406
|
-
|
|
407
|
-
const callbacks: CallbacksInterface = {
|
|
408
|
-
// RtcLeft: () => {},
|
|
409
|
-
// RtcJoined: () => {
|
|
410
|
-
// if (SdkJoinState.phrase && SdkJoinState.skipPrecall) {
|
|
411
|
-
// SdkJoinState.promise?.res();
|
|
412
|
-
// }
|
|
413
|
-
// },
|
|
414
|
-
EndCall: () => {
|
|
415
|
-
clearState('join');
|
|
416
|
-
setTimeout(() => {
|
|
417
|
-
// TODO: These callbacks are being called twice
|
|
418
|
-
SDKEvents.emit('leave');
|
|
419
|
-
if (afterEndCall) {
|
|
420
|
-
afterEndCall(data.isHost, history as unknown as History);
|
|
421
|
-
} else {
|
|
422
|
-
history.push('/');
|
|
423
|
-
}
|
|
424
|
-
}, 0);
|
|
425
|
-
},
|
|
426
|
-
UserJoined: (uid: UidType) => {
|
|
427
|
-
console.log('UIKIT Callback: UserJoined', uid);
|
|
428
|
-
SDKEvents.emit('rtc-user-joined', uid);
|
|
429
|
-
},
|
|
430
|
-
UserOffline: (uid: UidType) => {
|
|
431
|
-
console.log('UIKIT Callback: UserOffline', uid);
|
|
432
|
-
SDKEvents.emit('rtc-user-left', uid);
|
|
433
|
-
},
|
|
434
|
-
RemoteAudioStateChanged: (uid: UidType, status: 0 | 2) => {
|
|
435
|
-
console.log('UIKIT Callback: RemoteAudioStateChanged', uid, status);
|
|
436
|
-
if (status === 0) {
|
|
437
|
-
SDKEvents.emit('rtc-user-unpublished', uid, 'audio');
|
|
438
|
-
} else {
|
|
439
|
-
SDKEvents.emit('rtc-user-published', uid, 'audio');
|
|
440
|
-
}
|
|
441
|
-
},
|
|
442
|
-
RemoteVideoStateChanged: (uid: UidType, status: 0 | 2) => {
|
|
443
|
-
console.log('UIKIT Callback: RemoteVideoStateChanged', uid, status);
|
|
444
|
-
if (status === 0) {
|
|
445
|
-
SDKEvents.emit('rtc-user-unpublished', uid, 'video');
|
|
446
|
-
} else {
|
|
447
|
-
SDKEvents.emit('rtc-user-published', uid, 'video');
|
|
448
|
-
}
|
|
449
|
-
},
|
|
450
|
-
UserBanned(isBanned) {
|
|
451
|
-
console.log('UIKIT Callback: UserBanned', isBanned);
|
|
452
|
-
Toast.show({
|
|
453
|
-
leadingIconName: 'alert',
|
|
454
|
-
type: 'error',
|
|
455
|
-
text1: bannedUserText,
|
|
456
|
-
visibilityTime: 3000,
|
|
457
|
-
});
|
|
458
|
-
},
|
|
459
|
-
};
|
|
460
|
-
|
|
461
138
|
return (
|
|
462
|
-
|
|
463
|
-
{
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
<
|
|
481
|
-
<
|
|
482
|
-
<
|
|
483
|
-
<
|
|
484
|
-
<
|
|
485
|
-
<
|
|
486
|
-
<
|
|
487
|
-
<
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
139
|
+
<PropsProvider
|
|
140
|
+
value={{
|
|
141
|
+
rtcProps: {
|
|
142
|
+
...rtcProps,
|
|
143
|
+
callActive,
|
|
144
|
+
// commented for v1 release
|
|
145
|
+
//lifecycle,
|
|
146
|
+
},
|
|
147
|
+
callbacks,
|
|
148
|
+
styleProps,
|
|
149
|
+
mode: $config.EVENT_MODE
|
|
150
|
+
? ChannelProfileType.ChannelProfileLiveBroadcasting
|
|
151
|
+
: ChannelProfileType.ChannelProfileCommunication,
|
|
152
|
+
}}>
|
|
153
|
+
<RtcConfigure>
|
|
154
|
+
<DeviceConfigure>
|
|
155
|
+
<NoiseSupressionProvider callActive={callActive}>
|
|
156
|
+
<VideoQualityContextProvider>
|
|
157
|
+
<ChatUIControlsProvider>
|
|
158
|
+
<ChatNotificationProvider>
|
|
159
|
+
<LayoutProvider>
|
|
160
|
+
<FocusProvider>
|
|
161
|
+
<SidePanelProvider>
|
|
162
|
+
<ChatMessagesProvider callActive={callActive}>
|
|
163
|
+
<ScreenShareProvider>
|
|
164
|
+
<RTMConfigureMainRoomProvider
|
|
165
|
+
callActive={callActive}
|
|
166
|
+
currentChannel={rtcProps.channel}>
|
|
167
|
+
<RtmConfigure room={RTM_ROOMS.MAIN}>
|
|
168
|
+
<UserPreferenceProvider callActive={callActive}>
|
|
169
|
+
<CaptionProvider>
|
|
170
|
+
<WaitingRoomProvider>
|
|
171
|
+
<EventsConfigure
|
|
172
|
+
setSttAutoStarted={setSttAutoStarted}
|
|
173
|
+
sttAutoStarted={sttAutoStarted}
|
|
493
174
|
callActive={callActive}>
|
|
494
|
-
<
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
<LiveStreamContextProvider
|
|
175
|
+
<ScreenshareConfigure
|
|
176
|
+
isRecordingActive={isRecordingActive}>
|
|
177
|
+
<LiveStreamContextProvider
|
|
178
|
+
value={{
|
|
179
|
+
setRtcProps,
|
|
180
|
+
rtcProps,
|
|
181
|
+
callActive,
|
|
182
|
+
}}>
|
|
183
|
+
<LiveStreamDataProvider>
|
|
184
|
+
<LocalUserContext
|
|
185
|
+
localUid={rtcProps?.uid}>
|
|
186
|
+
<RecordingProvider
|
|
507
187
|
value={{
|
|
508
|
-
|
|
509
|
-
|
|
188
|
+
setRecordingActive,
|
|
189
|
+
isRecordingActive,
|
|
510
190
|
callActive,
|
|
191
|
+
recordingAutoStarted,
|
|
192
|
+
setRecordingAutoStarted,
|
|
511
193
|
}}>
|
|
512
|
-
<
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
</
|
|
545
|
-
</
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
</
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
</View>
|
|
591
|
-
)
|
|
592
|
-
) : (
|
|
593
|
-
<></>
|
|
594
|
-
)}
|
|
595
|
-
</>
|
|
194
|
+
<NetworkQualityProvider>
|
|
195
|
+
{!isMobileUA() && (
|
|
196
|
+
<PermissionHelper />
|
|
197
|
+
)}
|
|
198
|
+
<UserActionMenuProvider>
|
|
199
|
+
<VBProvider>
|
|
200
|
+
<BeautyEffectProvider>
|
|
201
|
+
{/* <PrefereceWrapper
|
|
202
|
+
callActive={
|
|
203
|
+
callActive
|
|
204
|
+
}
|
|
205
|
+
setCallActive={
|
|
206
|
+
setCallActive
|
|
207
|
+
}> */}
|
|
208
|
+
<SdkMuteToggleListener>
|
|
209
|
+
{callActive ? (
|
|
210
|
+
<VideoMeetingDataProvider>
|
|
211
|
+
<VideoCallProvider>
|
|
212
|
+
<DisableChatProvider>
|
|
213
|
+
<RaiseHandProvider>
|
|
214
|
+
<BreakoutRoomProvider
|
|
215
|
+
mainChannel={
|
|
216
|
+
rtcProps.channel
|
|
217
|
+
}
|
|
218
|
+
handleLeaveBreakout={
|
|
219
|
+
null
|
|
220
|
+
}>
|
|
221
|
+
<BreakoutRoomEventsConfigure
|
|
222
|
+
mainChannelName={
|
|
223
|
+
rtcProps.channel
|
|
224
|
+
}>
|
|
225
|
+
<VideoCallScreenWrapper />
|
|
226
|
+
</BreakoutRoomEventsConfigure>
|
|
227
|
+
</BreakoutRoomProvider>
|
|
228
|
+
</RaiseHandProvider>
|
|
229
|
+
</DisableChatProvider>
|
|
230
|
+
</VideoCallProvider>
|
|
231
|
+
</VideoMeetingDataProvider>
|
|
232
|
+
) : $config.PRECALL ? (
|
|
233
|
+
<PreCallProvider
|
|
234
|
+
value={{
|
|
235
|
+
callActive,
|
|
236
|
+
setCallActive,
|
|
237
|
+
}}>
|
|
238
|
+
<Precall />
|
|
239
|
+
</PreCallProvider>
|
|
240
|
+
) : (
|
|
241
|
+
<></>
|
|
242
|
+
)}
|
|
243
|
+
</SdkMuteToggleListener>
|
|
244
|
+
{/* </PrefereceWrapper> */}
|
|
245
|
+
</BeautyEffectProvider>
|
|
246
|
+
</VBProvider>
|
|
247
|
+
</UserActionMenuProvider>
|
|
248
|
+
</NetworkQualityProvider>
|
|
249
|
+
</RecordingProvider>
|
|
250
|
+
</LocalUserContext>
|
|
251
|
+
</LiveStreamDataProvider>
|
|
252
|
+
</LiveStreamContextProvider>
|
|
253
|
+
</ScreenshareConfigure>
|
|
254
|
+
</EventsConfigure>
|
|
255
|
+
</WaitingRoomProvider>
|
|
256
|
+
</CaptionProvider>
|
|
257
|
+
</UserPreferenceProvider>
|
|
258
|
+
</RtmConfigure>
|
|
259
|
+
</RTMConfigureMainRoomProvider>
|
|
260
|
+
</ScreenShareProvider>
|
|
261
|
+
</ChatMessagesProvider>
|
|
262
|
+
</SidePanelProvider>
|
|
263
|
+
</FocusProvider>
|
|
264
|
+
</LayoutProvider>
|
|
265
|
+
</ChatNotificationProvider>
|
|
266
|
+
</ChatUIControlsProvider>
|
|
267
|
+
</VideoQualityContextProvider>
|
|
268
|
+
</NoiseSupressionProvider>
|
|
269
|
+
</DeviceConfigure>
|
|
270
|
+
</RtcConfigure>
|
|
271
|
+
</PropsProvider>
|
|
596
272
|
);
|
|
597
273
|
};
|
|
598
274
|
|
|
599
|
-
const styleProps = {
|
|
600
|
-
maxViewStyles: styles.temp,
|
|
601
|
-
minViewStyles: styles.temp,
|
|
602
|
-
localBtnContainer: styles.bottomBar,
|
|
603
|
-
localBtnStyles: {
|
|
604
|
-
muteLocalAudio: styles.localButton,
|
|
605
|
-
muteLocalVideo: styles.localButton,
|
|
606
|
-
switchCamera: styles.localButton,
|
|
607
|
-
endCall: styles.endCall,
|
|
608
|
-
fullScreen: styles.localButton,
|
|
609
|
-
recording: styles.localButton,
|
|
610
|
-
screenshare: styles.localButton,
|
|
611
|
-
},
|
|
612
|
-
theme: $config.PRIMARY_ACTION_BRAND_COLOR,
|
|
613
|
-
remoteBtnStyles: {
|
|
614
|
-
muteRemoteAudio: styles.remoteButton,
|
|
615
|
-
muteRemoteVideo: styles.remoteButton,
|
|
616
|
-
remoteSwap: styles.remoteButton,
|
|
617
|
-
minCloseBtnStyles: styles.minCloseBtn,
|
|
618
|
-
liveStreamHostControlBtns: styles.liveStreamHostControlBtns,
|
|
619
|
-
},
|
|
620
|
-
BtnStyles: styles.remoteButton,
|
|
621
|
-
};
|
|
622
275
|
//change these to inline styles or sth
|
|
623
|
-
const style = StyleSheet.create({
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
});
|
|
276
|
+
// const style = StyleSheet.create({
|
|
277
|
+
// full: {
|
|
278
|
+
// flex: 1,
|
|
279
|
+
// flexDirection: 'column',
|
|
280
|
+
// overflow: 'hidden',
|
|
281
|
+
// },
|
|
282
|
+
// videoView: videoView,
|
|
283
|
+
// loader: {
|
|
284
|
+
// flex: 1,
|
|
285
|
+
// alignSelf: 'center',
|
|
286
|
+
// justifyContent: 'center',
|
|
287
|
+
// },
|
|
288
|
+
// loaderLogo: {
|
|
289
|
+
// alignSelf: 'center',
|
|
290
|
+
// justifyContent: 'center',
|
|
291
|
+
// marginBottom: 30,
|
|
292
|
+
// },
|
|
293
|
+
// loaderText: {fontWeight: '500', color: $config.FONT_COLOR},
|
|
294
|
+
// });
|
|
642
295
|
|
|
643
296
|
export default VideoCall;
|