agora-appbuilder-core 4.1.10-beta.1 → 4.1.11
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/agora-rn-uikit/src/Utils/isBotUser.ts +1 -1
- package/template/android/app/build.gradle +0 -7
- package/template/bridge/rtc/webNg/RtcEngine.ts +2 -2
- package/template/bridge/rtm/web/Types.ts +0 -183
- package/template/bridge/rtm/web/index.ts +488 -450
- package/template/customization-api/typeDefinition.ts +0 -1
- package/template/defaultConfig.js +3 -4
- package/template/global.d.ts +0 -1
- package/template/ios/Podfile +0 -41
- package/template/package.json +5 -5
- package/template/src/AppRoutes.tsx +3 -3
- package/template/src/ai-agent/components/ControlButtons.tsx +1 -1
- package/template/src/assets/font-styles.css +1 -33
- package/template/src/assets/fonts/icomoon.ttf +0 -0
- package/template/src/assets/selection.json +1 -1
- package/template/src/atoms/ActionMenu.tsx +93 -13
- package/template/src/atoms/CustomIcon.tsx +1 -8
- package/template/src/atoms/DropDownMulti.tsx +80 -29
- package/template/src/atoms/Dropdown.tsx +0 -5
- package/template/src/atoms/Input.tsx +2 -1
- package/template/src/atoms/TertiaryButton.tsx +1 -1
- package/template/src/atoms/UserAvatar.tsx +1 -1
- package/template/src/components/ChatContext.ts +3 -5
- package/template/src/components/Controls.tsx +167 -208
- package/template/src/components/DeviceConfigure.tsx +1 -1
- package/template/src/components/EventsConfigure.tsx +168 -118
- package/template/src/components/Navbar.tsx +11 -14
- package/template/src/components/RTMConfigure.tsx +819 -32
- package/template/src/components/beauty-effect/useBeautyEffects.tsx +13 -50
- package/template/src/components/chat/chatConfigure.tsx +1 -7
- package/template/src/components/chat-messages/useChatMessages.tsx +11 -43
- package/template/src/components/controls/useControlPermissionMatrix.tsx +4 -32
- package/template/src/components/participants/AllHostParticipants.tsx +2 -10
- package/template/src/components/participants/Participant.tsx +1 -7
- package/template/src/components/participants/UserActionMenuOptions.tsx +2 -12
- package/template/src/components/precall/joinCallBtn.native.tsx +7 -2
- package/template/src/components/precall/joinCallBtn.tsx +7 -2
- package/template/src/components/precall/joinWaitingRoomBtn.native.tsx +16 -15
- package/template/src/components/precall/joinWaitingRoomBtn.tsx +31 -17
- package/template/src/components/precall/textInput.tsx +45 -22
- package/template/src/components/precall/usePreCall.tsx +7 -0
- package/template/src/components/recordings/RecordingsDateTable.tsx +2 -3
- package/template/src/components/room-info/useRoomInfo.tsx +5 -0
- package/template/src/components/useUserPreference.tsx +12 -39
- package/template/src/components/virtual-background/useVB.tsx +0 -18
- package/template/src/components/whiteboard/WhiteboardConfigure.tsx +0 -27
- package/template/src/language/default-labels/videoCallScreenLabels.ts +27 -11
- package/template/src/logger/AppBuilderLogger.tsx +3 -11
- package/template/src/pages/VideoCall.tsx +518 -171
- package/template/src/pages/video-call/ActionSheetContent.tsx +77 -77
- package/template/src/pages/video-call/SidePanelHeader.tsx +81 -53
- package/template/src/pages/video-call/VideoCallScreen.tsx +0 -18
- package/template/src/pages/video-call/VideoCallScreenWrapper.tsx +1 -0
- package/template/src/rtm/RTMEngine.ts +37 -262
- package/template/src/rtm/utils.ts +1 -68
- package/template/src/rtm-events/constants.ts +7 -40
- package/template/src/rtm-events-api/Events.ts +39 -158
- package/template/src/subComponents/ChatBubble.tsx +3 -3
- package/template/src/subComponents/ChatContainer.tsx +9 -19
- package/template/src/subComponents/LocalAudioMute.tsx +2 -2
- package/template/src/subComponents/LocalVideoMute.tsx +2 -2
- package/template/src/subComponents/SidePanelEnum.tsx +0 -1
- package/template/src/subComponents/caption/Caption.tsx +48 -7
- package/template/src/subComponents/caption/CaptionContainer.tsx +324 -51
- package/template/src/subComponents/caption/CaptionIcon.tsx +35 -34
- package/template/src/subComponents/caption/CaptionText.tsx +103 -2
- package/template/src/subComponents/caption/LanguageSelectorPopup.tsx +179 -69
- package/template/src/subComponents/caption/Transcript.tsx +46 -11
- package/template/src/subComponents/caption/TranscriptIcon.tsx +27 -35
- package/template/src/subComponents/caption/TranscriptText.tsx +78 -3
- package/template/src/subComponents/caption/proto/ptoto.js +38 -4
- package/template/src/subComponents/caption/proto/test.proto +34 -19
- package/template/src/subComponents/caption/useCaption.tsx +754 -11
- package/template/src/subComponents/caption/useSTTAPI.tsx +118 -205
- package/template/src/subComponents/caption/useStreamMessageUtils.native.ts +152 -33
- package/template/src/subComponents/caption/useStreamMessageUtils.ts +165 -34
- package/template/src/subComponents/caption/utils.ts +171 -3
- package/template/src/subComponents/chat/ChatSendButton.tsx +0 -1
- package/template/src/subComponents/screenshare/ScreenshareButton.tsx +0 -16
- package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +1 -1
- package/template/src/subComponents/waiting-rooms/WaitingRoomControls.tsx +4 -7
- package/template/src/utils/SdkEvents.ts +3 -0
- package/template/src/utils/useEndCall.ts +4 -4
- package/template/src/utils/useMuteToggleLocal.ts +10 -14
- package/template/src/utils/useSpeechToText.ts +31 -20
- package/template/bridge/rtm/web/index-legacy.ts +0 -540
- package/template/src/components/RTMConfigure-legacy.tsx +0 -848
- package/template/src/components/UserGlobalPreferenceProvider.tsx +0 -227
- package/template/src/components/breakout-room/BreakoutRoomPanel.tsx +0 -58
- package/template/src/components/breakout-room/context/BreakoutRoomContext.tsx +0 -2508
- package/template/src/components/breakout-room/events/BreakoutRoomEventsConfigure.tsx +0 -272
- package/template/src/components/breakout-room/events/constants.ts +0 -17
- package/template/src/components/breakout-room/hoc/BreakoutRoomNameRenderer.tsx +0 -68
- package/template/src/components/breakout-room/hooks/useBreakoutRoomExit.ts +0 -49
- package/template/src/components/breakout-room/state/reducer.ts +0 -522
- package/template/src/components/breakout-room/state/types.ts +0 -54
- package/template/src/components/breakout-room/ui/BreakoutMeetingTitle.tsx +0 -60
- package/template/src/components/breakout-room/ui/BreakoutRoomActionMenu.tsx +0 -136
- package/template/src/components/breakout-room/ui/BreakoutRoomAnnouncementModal.tsx +0 -135
- package/template/src/components/breakout-room/ui/BreakoutRoomGroupSettings.tsx +0 -588
- package/template/src/components/breakout-room/ui/BreakoutRoomMainRoomUsers.tsx +0 -142
- package/template/src/components/breakout-room/ui/BreakoutRoomMemberActionMenu.tsx +0 -122
- package/template/src/components/breakout-room/ui/BreakoutRoomParticipants.tsx +0 -124
- package/template/src/components/breakout-room/ui/BreakoutRoomRaiseHand.tsx +0 -65
- package/template/src/components/breakout-room/ui/BreakoutRoomRenameModal.tsx +0 -227
- package/template/src/components/breakout-room/ui/BreakoutRoomSettings.tsx +0 -140
- package/template/src/components/breakout-room/ui/BreakoutRoomTransition.tsx +0 -52
- package/template/src/components/breakout-room/ui/BreakoutRoomView.tsx +0 -193
- package/template/src/components/breakout-room/ui/ExitBreakoutRoomIconButton.tsx +0 -79
- package/template/src/components/breakout-room/ui/ParticipantManualAssignmentModal.tsx +0 -638
- package/template/src/components/breakout-room/ui/SelectParticipantAssignmentStrategy.tsx +0 -57
- package/template/src/components/common/Dividers.tsx +0 -53
- package/template/src/components/controls/toolbar-items/ExitBreakoutRoomToolbarItem.tsx +0 -13
- package/template/src/components/raise-hand/RaiseHandButton.tsx +0 -50
- package/template/src/components/raise-hand/RaiseHandProvider.tsx +0 -308
- package/template/src/components/raise-hand/index.ts +0 -14
- package/template/src/components/room-info/useCurrentRoomInfo.tsx +0 -42
- package/template/src/components/room-info/useSetBreakoutRoomInfo.tsx +0 -64
- package/template/src/pages/video-call/BreakoutVideoCall.tsx +0 -213
- package/template/src/pages/video-call/VideoCallContent.tsx +0 -211
- package/template/src/pages/video-call/VideoCallStateWrapper.tsx +0 -495
- package/template/src/rtm/RTMConfigureBreakoutRoomProvider.tsx +0 -882
- package/template/src/rtm/RTMConfigureMainRoomProvider.tsx +0 -757
- package/template/src/rtm/RTMCoreProvider.tsx +0 -419
- package/template/src/rtm/RTMGlobalStateProvider.tsx +0 -706
- package/template/src/rtm/RTMStatusBanner.tsx +0 -99
- package/template/src/rtm/constants.ts +0 -12
- package/template/src/rtm/hooks/useMainRoomUserDisplayName.ts +0 -45
- package/template/src/rtm/rtm-presence-utils.ts +0 -344
- package/template/src/subComponents/chat/ChatAnnouncementView.tsx +0 -65
- package/template/src/utils/useDebouncedCallback.tsx +0 -20
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
information visit https://appbuilder.agora.io.
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
// @ts-nocheck
|
|
13
|
+
import React, {useState, useContext, useEffect, useRef} from 'react';
|
|
13
14
|
import {View, StyleSheet, Text} from 'react-native';
|
|
14
15
|
import {
|
|
15
16
|
RtcConfigure,
|
|
@@ -19,12 +20,10 @@ import {
|
|
|
19
20
|
LocalUserContext,
|
|
20
21
|
UidType,
|
|
21
22
|
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';
|
|
28
27
|
import DeviceConfigure from '../components/DeviceConfigure';
|
|
29
28
|
import Logo from '../subComponents/Logo';
|
|
30
29
|
import {useHasBrandLogo, isMobileUA, isWebInternal} from '../utils/common';
|
|
@@ -80,31 +79,62 @@ import {LogSource, logger} from '../logger/AppBuilderLogger';
|
|
|
80
79
|
import {useCustomization} from 'customization-implementation';
|
|
81
80
|
import {BeautyEffectProvider} from '../components/beauty-effect/useBeautyEffects';
|
|
82
81
|
import {UserActionMenuProvider} from '../components/useUserActionMenu';
|
|
83
|
-
import {RaiseHandProvider} from '../components/raise-hand';
|
|
84
82
|
import Toast from '../../react-native-toast-message';
|
|
85
83
|
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';
|
|
89
84
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
85
|
+
enum RnEncryptionEnum {
|
|
86
|
+
/**
|
|
87
|
+
* @deprecated
|
|
88
|
+
* 0: This mode is deprecated.
|
|
89
|
+
*/
|
|
90
|
+
None = 0,
|
|
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,
|
|
97
128
|
}
|
|
98
129
|
|
|
99
|
-
const VideoCall = (
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
} = videoCallProps;
|
|
130
|
+
const VideoCall: React.FC = () => {
|
|
131
|
+
const hasBrandLogo = useHasBrandLogo();
|
|
132
|
+
const joiningLoaderLabel = useString(videoRoomStartingCallText)();
|
|
133
|
+
const bannedUserText = useString(userBannedText)();
|
|
134
|
+
|
|
135
|
+
const {setGlobalErrorMessage} = useContext(ErrorContext);
|
|
136
|
+
const {awake, release} = useWakeLock();
|
|
137
|
+
const {isRecordingBot} = useIsRecordingBot();
|
|
108
138
|
/**
|
|
109
139
|
* Should we set the callscreen to active ??
|
|
110
140
|
* a) If Recording bot( i.e prop: recordingBot) is TRUE then it means,
|
|
@@ -114,10 +144,35 @@ const VideoCall = (videoCallProps: VideoCallProps) => {
|
|
|
114
144
|
* b) If Recording bot( i.e prop: recordingBot) is FALSE then we should set
|
|
115
145
|
* the callActive depending upon the value of magic variable - $config.PRECALL
|
|
116
146
|
*/
|
|
147
|
+
const shouldCallBeSetToActive = isRecordingBot
|
|
148
|
+
? true
|
|
149
|
+
: $config.PRECALL
|
|
150
|
+
? false
|
|
151
|
+
: true;
|
|
152
|
+
const [callActive, setCallActive] = useState(shouldCallBeSetToActive);
|
|
117
153
|
const [isRecordingActive, setRecordingActive] = useState(false);
|
|
154
|
+
const [queryComplete, setQueryComplete] = useState(false);
|
|
155
|
+
const [waitingRoomAttendeeJoined, setWaitingRoomAttendeeJoined] =
|
|
156
|
+
useState(false);
|
|
118
157
|
const [sttAutoStarted, setSttAutoStarted] = useState(false);
|
|
119
158
|
const [recordingAutoStarted, setRecordingAutoStarted] = useState(false);
|
|
120
159
|
|
|
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
|
+
|
|
121
176
|
const {PrefereceWrapper} = useCustomization(data => {
|
|
122
177
|
let components: {
|
|
123
178
|
PrefereceWrapper: React.ComponentType;
|
|
@@ -135,162 +190,454 @@ const VideoCall = (videoCallProps: VideoCallProps) => {
|
|
|
135
190
|
return components;
|
|
136
191
|
});
|
|
137
192
|
|
|
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
|
+
|
|
138
461
|
return (
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
<
|
|
158
|
-
<
|
|
159
|
-
<
|
|
160
|
-
<
|
|
161
|
-
<
|
|
162
|
-
<
|
|
163
|
-
<
|
|
164
|
-
<
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
<WaitingRoomProvider>
|
|
171
|
-
<EventsConfigure
|
|
172
|
-
setSttAutoStarted={setSttAutoStarted}
|
|
173
|
-
sttAutoStarted={sttAutoStarted}
|
|
462
|
+
<>
|
|
463
|
+
{queryComplete ? (
|
|
464
|
+
queryComplete || !callActive ? (
|
|
465
|
+
<>
|
|
466
|
+
<PropsProvider
|
|
467
|
+
value={{
|
|
468
|
+
rtcProps: {
|
|
469
|
+
...rtcProps,
|
|
470
|
+
callActive,
|
|
471
|
+
// commented for v1 release
|
|
472
|
+
//lifecycle,
|
|
473
|
+
},
|
|
474
|
+
callbacks,
|
|
475
|
+
styleProps,
|
|
476
|
+
mode: $config.EVENT_MODE
|
|
477
|
+
? ChannelProfileType.ChannelProfileLiveBroadcasting
|
|
478
|
+
: ChannelProfileType.ChannelProfileCommunication,
|
|
479
|
+
}}>
|
|
480
|
+
<RtcConfigure>
|
|
481
|
+
<DeviceConfigure>
|
|
482
|
+
<NoiseSupressionProvider callActive={callActive}>
|
|
483
|
+
<VideoQualityContextProvider>
|
|
484
|
+
<ChatUIControlsProvider>
|
|
485
|
+
<ChatNotificationProvider>
|
|
486
|
+
<LayoutProvider>
|
|
487
|
+
<FocusProvider>
|
|
488
|
+
<SidePanelProvider>
|
|
489
|
+
<ChatMessagesProvider callActive={callActive}>
|
|
490
|
+
<ScreenShareProvider>
|
|
491
|
+
<RtmConfigure callActive={callActive}>
|
|
492
|
+
<UserPreferenceProvider
|
|
174
493
|
callActive={callActive}>
|
|
175
|
-
<
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
494
|
+
<CaptionProvider>
|
|
495
|
+
<WaitingRoomProvider>
|
|
496
|
+
<EventsConfigure
|
|
497
|
+
setSttAutoStarted={
|
|
498
|
+
setSttAutoStarted
|
|
499
|
+
}
|
|
500
|
+
sttAutoStarted={sttAutoStarted}
|
|
501
|
+
callActive={callActive}>
|
|
502
|
+
<ScreenshareConfigure
|
|
503
|
+
isRecordingActive={
|
|
504
|
+
isRecordingActive
|
|
505
|
+
}>
|
|
506
|
+
<LiveStreamContextProvider
|
|
187
507
|
value={{
|
|
188
|
-
|
|
189
|
-
|
|
508
|
+
setRtcProps,
|
|
509
|
+
rtcProps,
|
|
190
510
|
callActive,
|
|
191
|
-
recordingAutoStarted,
|
|
192
|
-
setRecordingAutoStarted,
|
|
193
511
|
}}>
|
|
194
|
-
<
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
</
|
|
227
|
-
</
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
</
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
512
|
+
<LiveStreamDataProvider>
|
|
513
|
+
<LocalUserContext
|
|
514
|
+
localUid={rtcProps?.uid}>
|
|
515
|
+
<RecordingProvider
|
|
516
|
+
value={{
|
|
517
|
+
setRecordingActive,
|
|
518
|
+
isRecordingActive,
|
|
519
|
+
callActive,
|
|
520
|
+
recordingAutoStarted,
|
|
521
|
+
setRecordingAutoStarted,
|
|
522
|
+
}}>
|
|
523
|
+
<NetworkQualityProvider>
|
|
524
|
+
{!isMobileUA() && (
|
|
525
|
+
<PermissionHelper />
|
|
526
|
+
)}
|
|
527
|
+
<UserActionMenuProvider>
|
|
528
|
+
<VBProvider>
|
|
529
|
+
<BeautyEffectProvider>
|
|
530
|
+
<PrefereceWrapper
|
|
531
|
+
callActive={
|
|
532
|
+
callActive
|
|
533
|
+
}
|
|
534
|
+
setCallActive={
|
|
535
|
+
setCallActive
|
|
536
|
+
}>
|
|
537
|
+
<SdkMuteToggleListener>
|
|
538
|
+
{callActive ? (
|
|
539
|
+
<VideoMeetingDataProvider>
|
|
540
|
+
<VideoCallProvider>
|
|
541
|
+
<DisableChatProvider>
|
|
542
|
+
<VideoCallScreenWrapper />
|
|
543
|
+
</DisableChatProvider>
|
|
544
|
+
</VideoCallProvider>
|
|
545
|
+
</VideoMeetingDataProvider>
|
|
546
|
+
) : $config.PRECALL ? (
|
|
547
|
+
<PreCallProvider
|
|
548
|
+
value={{
|
|
549
|
+
callActive,
|
|
550
|
+
setCallActive,
|
|
551
|
+
}}>
|
|
552
|
+
<Precall />
|
|
553
|
+
</PreCallProvider>
|
|
554
|
+
) : (
|
|
555
|
+
<></>
|
|
556
|
+
)}
|
|
557
|
+
</SdkMuteToggleListener>
|
|
558
|
+
</PrefereceWrapper>
|
|
559
|
+
</BeautyEffectProvider>
|
|
560
|
+
</VBProvider>
|
|
561
|
+
</UserActionMenuProvider>
|
|
562
|
+
</NetworkQualityProvider>
|
|
563
|
+
</RecordingProvider>
|
|
564
|
+
</LocalUserContext>
|
|
565
|
+
</LiveStreamDataProvider>
|
|
566
|
+
</LiveStreamContextProvider>
|
|
567
|
+
</ScreenshareConfigure>
|
|
568
|
+
</EventsConfigure>
|
|
569
|
+
</WaitingRoomProvider>
|
|
570
|
+
</CaptionProvider>
|
|
571
|
+
</UserPreferenceProvider>
|
|
572
|
+
</RtmConfigure>
|
|
573
|
+
</ScreenShareProvider>
|
|
574
|
+
</ChatMessagesProvider>
|
|
575
|
+
</SidePanelProvider>
|
|
576
|
+
</FocusProvider>
|
|
577
|
+
</LayoutProvider>
|
|
578
|
+
</ChatNotificationProvider>
|
|
579
|
+
</ChatUIControlsProvider>
|
|
580
|
+
</VideoQualityContextProvider>
|
|
581
|
+
</NoiseSupressionProvider>
|
|
582
|
+
</DeviceConfigure>
|
|
583
|
+
</RtcConfigure>
|
|
584
|
+
</PropsProvider>
|
|
585
|
+
</>
|
|
586
|
+
) : (
|
|
587
|
+
<View style={style.loader}>
|
|
588
|
+
<View style={style.loaderLogo}>{hasBrandLogo() && <Logo />}</View>
|
|
589
|
+
<Text style={style.loaderText}>{joiningLoaderLabel}</Text>
|
|
590
|
+
</View>
|
|
591
|
+
)
|
|
592
|
+
) : (
|
|
593
|
+
<></>
|
|
594
|
+
)}
|
|
595
|
+
</>
|
|
272
596
|
);
|
|
273
597
|
};
|
|
274
598
|
|
|
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
|
+
};
|
|
275
622
|
//change these to inline styles or sth
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
623
|
+
const style = StyleSheet.create({
|
|
624
|
+
full: {
|
|
625
|
+
flex: 1,
|
|
626
|
+
flexDirection: 'column',
|
|
627
|
+
overflow: 'hidden',
|
|
628
|
+
},
|
|
629
|
+
videoView: videoView,
|
|
630
|
+
loader: {
|
|
631
|
+
flex: 1,
|
|
632
|
+
alignSelf: 'center',
|
|
633
|
+
justifyContent: 'center',
|
|
634
|
+
},
|
|
635
|
+
loaderLogo: {
|
|
636
|
+
alignSelf: 'center',
|
|
637
|
+
justifyContent: 'center',
|
|
638
|
+
marginBottom: 30,
|
|
639
|
+
},
|
|
640
|
+
loaderText: {fontWeight: '500', color: $config.FONT_COLOR},
|
|
641
|
+
});
|
|
295
642
|
|
|
296
643
|
export default VideoCall;
|