agora-appbuilder-core 2.3.0-beta.9 → 3.0.0
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/Readme.md +11 -6
- package/package.json +1 -1
- package/template/Gulpfile.js +121 -83
- package/template/_gitignore +2 -2
- package/template/_package-lock.json +12959 -13248
- package/template/agora-rn-uikit/src/AgoraUIKit.tsx +2 -2
- package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +2 -0
- package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +3 -3
- package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +4 -5
- package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +3 -1
- package/template/agora-rn-uikit/src/Controls/LocalControls.tsx +2 -2
- package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +4 -4
- package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +7 -5
- package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +2 -2
- package/template/agora-rn-uikit/src/Rtc/Create.tsx +88 -43
- package/template/agora-rn-uikit/src/Rtc/Join.tsx +13 -4
- package/template/agora-rn-uikit/src/RtcConfigure.tsx +36 -19
- package/template/agora-rn-uikit/src/Utils/permission.ts +17 -6
- package/template/babel.config.js +9 -9
- package/template/bridge/rtc/webNg/RtcEngine.ts +51 -26
- package/template/customization-api/action-library.ts +22 -0
- package/template/{fpe-api/context.ts → customization-api/app-state.ts} +16 -14
- package/template/customization-api/customEvents.ts +9 -0
- package/template/{fpe-api/install.ts → customization-api/customize.ts} +27 -26
- package/template/{fpe-api → customization-api}/index.ts +11 -6
- package/template/{fpe-api/components.ts → customization-api/sub-components.ts} +22 -3
- package/template/{fpe-api → customization-api}/typeDefinition.ts +13 -14
- package/template/customization-api/utils.ts +30 -0
- package/template/{fpe-implementation → customization-implementation}/createHook.ts +0 -0
- package/template/{fpe-implementation/dummyFpe.ts → customization-implementation/dummyConfig.ts} +4 -4
- package/template/customization-implementation/index.ts +4 -0
- package/template/{fpe-api/useFpe.tsx → customization-implementation/useCustomization.tsx} +12 -12
- package/template/{fpe.config.js → customization.config.js} +11 -11
- package/template/electron/main/index.js +42 -35
- package/template/esbuild.rsdk.go +8 -17
- package/template/global.d.ts +4 -3
- package/template/index.rsdk.tsx +13 -5
- package/template/index.wsdk.tsx +21 -5
- package/template/package.json +3 -0
- package/template/react-native-toast-message/src/index.js +3 -7
- package/template/react-native-toast-message/src/{index.wsdk.js → index.sdk.tsx} +1 -1
- package/template/react-native-toast-message/src/styles.sdk.ts +17 -0
- package/template/src/App.tsx +8 -4
- package/template/src/AppWrapper.tsx +8 -6
- package/template/src/SDKAppWrapper.tsx +28 -21
- package/template/src/app-state/useLocalUserInfo.ts +8 -0
- package/template/src/app-state/useMessages.ts +52 -0
- package/template/src/atoms/PrimaryButton.tsx +2 -2
- package/template/src/atoms/SecondaryButton.tsx +12 -4
- package/template/src/atoms/TextInput.tsx +2 -2
- package/template/src/components/Chat.tsx +22 -11
- package/template/src/components/ChatContext.ts +10 -27
- package/template/src/components/Controls.native.tsx +13 -7
- package/template/src/components/Controls.tsx +15 -24
- package/template/src/components/DeviceConfigure.tsx +4 -3
- package/template/src/components/EventsConfigure.tsx +54 -0
- package/template/src/components/GridVideo.tsx +5 -6
- package/template/src/components/HostControlView.tsx +13 -19
- package/template/src/components/Navbar.tsx +54 -41
- package/template/src/components/NetworkQualityContext.tsx +4 -3
- package/template/src/components/ParticipantsView.tsx +7 -7
- package/template/src/components/PinnedVideo.tsx +3 -4
- package/template/src/components/Precall.native.tsx +3 -3
- package/template/src/components/Precall.tsx +14 -10
- package/template/src/components/RTMConfigure.tsx +61 -219
- package/template/src/components/SettingsView.tsx +6 -3
- package/template/src/components/Share.tsx +24 -18
- package/template/src/components/chat-messages/useChatMessages.tsx +397 -80
- package/template/src/components/chat-notification/useChatNotification.tsx +2 -2
- package/template/src/components/chat-ui/useChatUIControl.tsx +1 -1
- package/template/src/components/common/Logo.tsx +3 -2
- package/template/src/components/contexts/LiveStreamDataContext.tsx +3 -3
- package/template/src/components/contexts/ScreenShareContext.tsx +3 -1
- package/template/src/components/contexts/VideoMeetingDataContext.tsx +85 -0
- package/template/src/components/contexts/WhiteboardContext.tsx +8 -8
- package/template/src/components/livestream/LiveStreamContext.tsx +88 -74
- package/template/src/components/meeting-info/useMeetingInfo.tsx +23 -19
- package/template/src/components/meeting-info/useSetMeetingInfo.tsx +1 -1
- package/template/src/components/participants/AllAudienceParticipants.tsx +2 -2
- package/template/src/components/participants/AllHostParticipants.tsx +4 -4
- package/template/src/components/participants/MeParticipant.tsx +5 -3
- package/template/src/components/participants/ParticipantName.tsx +2 -2
- package/template/src/components/participants/RemoteParticipants.tsx +9 -7
- package/template/src/components/precall/LocalMute.native.tsx +14 -10
- package/template/src/components/precall/LocalMute.tsx +7 -5
- package/template/src/components/precall/VideoPreview.native.tsx +6 -6
- package/template/src/components/precall/VideoPreview.tsx +3 -3
- package/template/src/components/precall/joinCallBtn.tsx +3 -3
- package/template/src/components/precall/meetingTitle.tsx +3 -1
- package/template/src/components/precall/selectDevice.tsx +2 -2
- package/template/src/components/precall/usePreCall.tsx +1 -1
- package/template/src/components/styles.ts +3 -3
- package/template/src/components/useShareLink.tsx +69 -29
- package/template/src/components/useUserPreference.tsx +16 -15
- package/template/src/components/useWakeLock.tsx +3 -3
- package/template/src/language/i18nTypes.ts +1 -1
- package/template/src/language/index.ts +2 -2
- package/template/src/language/useLanguage.tsx +2 -3
- package/template/src/pages/Authenticate.tsx +3 -2
- package/template/src/pages/Create.tsx +18 -20
- package/template/src/pages/Join.tsx +6 -7
- package/template/src/pages/VideoCall.tsx +74 -66
- package/template/src/pages/create/useCreate.tsx +1 -1
- package/template/src/pages/video-call/CustomUserContextHolder.tsx +14 -6
- package/template/src/pages/video-call/DefaultLayouts.ts +8 -8
- package/template/src/pages/video-call/{NameWithMicStatus.tsx → NameWithMicIcon.tsx} +8 -1
- package/template/src/pages/video-call/RenderComponent.tsx +7 -10
- package/template/src/pages/video-call/VideoCallScreen.tsx +31 -22
- package/template/src/pages/video-call/VideoComponent.tsx +13 -15
- package/template/src/pages/video-call/VideoRenderer.tsx +6 -6
- package/template/src/pages/video-call/useLayoutsData.ts +23 -0
- package/template/src/rtm/RTMEngine.ts +13 -0
- package/template/src/rtm-events/EventUtils.ts +20 -20
- package/template/src/rtm-events/EventsQueue.ts +9 -3
- package/template/src/rtm-events/constants.ts +5 -0
- package/template/src/rtm-events/index.tsx +1 -3
- package/template/src/{custom-events/CustomEvents.ts → rtm-events-api/Events.ts} +67 -61
- package/template/src/rtm-events-api/index.tsx +6 -0
- package/template/src/rtm-events-api/types.ts +22 -0
- package/template/src/subComponents/ChatBubble.tsx +24 -8
- package/template/src/subComponents/ChatContainer.tsx +24 -15
- package/template/src/subComponents/ChatInput.tsx +56 -42
- package/template/src/subComponents/LanguageSelector.tsx +2 -2
- package/template/src/subComponents/LayoutIconDropdown.native.tsx +5 -5
- package/template/src/subComponents/LayoutIconDropdown.tsx +7 -7
- package/template/src/subComponents/LocalAudioMute.tsx +3 -4
- package/template/src/subComponents/LocalEndCall.tsx +3 -6
- package/template/src/subComponents/LocalSwitchCamera.tsx +3 -4
- package/template/src/subComponents/LocalVideoMute.tsx +3 -3
- package/template/src/subComponents/NetworkQualityPill.tsx +8 -9
- package/template/src/subComponents/OpenInNativeButton.tsx +2 -3
- package/template/src/subComponents/RemoteAudioMute.tsx +5 -11
- package/template/src/subComponents/RemoteEndCall.tsx +3 -10
- package/template/src/subComponents/RemoteVideoMute.tsx +3 -10
- package/template/src/subComponents/SelectDevice.tsx +1 -1
- package/template/src/subComponents/SelectOAuth.tsx +3 -2
- package/template/src/subComponents/SidePanelButtons.ts +6 -5
- package/template/src/subComponents/TextWithTooltip.tsx +6 -2
- package/template/src/subComponents/{toastConfig.tsx → ToastConfig.tsx} +2 -2
- package/template/src/subComponents/chat/ChatParticipants.tsx +6 -5
- package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +2 -2
- package/template/src/subComponents/livestream/controls/RemoteLiveStreamApprovedRequestRecall.tsx +4 -3
- package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestApprove.tsx +2 -2
- package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestReject.tsx +2 -4
- package/template/src/subComponents/livestream/index.ts +2 -2
- package/template/src/subComponents/recording/useRecording.tsx +44 -23
- package/template/src/subComponents/recording/useRecordingLayoutQuery.tsx +11 -5
- package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +46 -34
- package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +97 -38
- package/template/src/subComponents/screenshare/useScreenshare.tsx +1 -1
- package/template/src/utils/SdkEvents.ts +9 -46
- package/template/src/utils/common.tsx +25 -9
- package/template/src/utils/getUniqueID.ts +5 -0
- package/template/src/utils/isMobileOrTablet.native.ts +2 -2
- package/template/src/utils/isMobileOrTablet.ts +21 -8
- package/template/src/utils/useButtonTemplate.tsx +1 -1
- package/template/src/utils/useCreateMeeting.ts +21 -10
- package/template/src/utils/useGetMeetingPhrase.ts +11 -8
- package/template/src/utils/{IsAttendeeUser.ts → useIsAttendee.ts} +3 -1
- package/template/src/utils/{isAudioEnabled.ts → useIsAudioEnabled.ts} +4 -4
- package/template/src/utils/{isHostUser.ts → useIsHost.ts} +13 -16
- package/template/src/utils/{isPSTNUser.ts → useIsPSTN.ts} +2 -2
- package/template/src/utils/{isScreenShareUser.ts → useIsScreenShare.ts} +0 -0
- package/template/src/utils/{isVideoEnabled.ts → useIsVideoEnabled.ts} +5 -6
- package/template/src/utils/useJoinMeeting.ts +8 -6
- package/template/src/utils/useLayout.tsx +5 -5
- package/template/src/utils/useMutePSTN.ts +5 -3
- package/template/src/utils/useMuteToggleLocal.ts +3 -4
- package/template/src/utils/useRemoteEndCall.ts +11 -10
- package/template/src/utils/useRemoteMute.ts +42 -20
- package/template/src/utils/useSidePanel.tsx +1 -1
- package/template/src/utils/useString.ts +2 -2
- package/template/src/utils/useUserName.ts +11 -0
- package/template/tsconfig_fpeApi.json +8 -9
- package/template/tsconfig_rsdk_index.json +8 -9
- package/template/tsconfig_wsdk_index.json +8 -9
- package/template/webpack.commons.js +9 -9
- package/template/webpack.rsdk.config.js +4 -2
- package/template/webpack.ts.config.js +6 -6
- package/template/webpack.wsdk.config.js +2 -1
- package/template/fpe-api/fpeEvents.ts +0 -9
- package/template/fpe-api/utils.ts +0 -61
- package/template/fpe-implementation/index.ts +0 -1
- package/template/fpe-todo.txt +0 -14
- package/template/src/components/RTMEvents.tsx +0 -84
- package/template/src/custom-events/index.tsx +0 -4
- package/template/src/custom-events/types.ts +0 -51
- package/template/src/pages/video-call/CustomLayout.ts +0 -17
- package/template/src/rtm-events/types.ts +0 -7
- package/template/src/utils/getMeetingInvite.ts +0 -53
- package/template/src/utils/useGroupMessages.ts +0 -24
- package/template/src/utils/useNavParams.ts +0 -6
- package/template/src/utils/useNavigateTo.ts +0 -8
- package/template/src/utils/usePrivateMessages.ts +0 -33
- package/template/src/utils/useSendControlMessage.ts +0 -51
- package/template/src/utils/useSendMessage.ts +0 -40
- package/template/src/utils/useSetUnreadMessageCount.ts +0 -43
- package/template/src/utils/useUnreadMessageCount.ts +0 -50
- package/template/src/utils/useUserList.ts +0 -26
|
@@ -24,7 +24,7 @@ import {useParams, useHistory} from '../components/Router';
|
|
|
24
24
|
import RtmConfigure from '../components/RTMConfigure';
|
|
25
25
|
import DeviceConfigure from '../components/DeviceConfigure';
|
|
26
26
|
import Logo from '../subComponents/Logo';
|
|
27
|
-
import {
|
|
27
|
+
import {useHasBrandLogo, isArray} from '../utils/common';
|
|
28
28
|
import {SidePanelType} from '../subComponents/SidePanelEnum';
|
|
29
29
|
import {videoView} from '../../theme.json';
|
|
30
30
|
import {LiveStreamContextProvider} from '../components/livestream';
|
|
@@ -32,10 +32,10 @@ import ScreenshareConfigure from '../subComponents/screenshare/ScreenshareConfig
|
|
|
32
32
|
import {ErrorContext} from '.././components/common/index';
|
|
33
33
|
import {PreCallProvider} from '../components/precall/usePreCall';
|
|
34
34
|
import {LayoutProvider} from '../utils/useLayout';
|
|
35
|
-
import {
|
|
35
|
+
import {useCustomization} from 'customization-implementation';
|
|
36
36
|
import Precall from '../components/Precall';
|
|
37
37
|
import {useString} from '../utils/useString';
|
|
38
|
-
import
|
|
38
|
+
import useLayoutsData from './video-call/useLayoutsData';
|
|
39
39
|
import {RecordingProvider} from '../subComponents/recording/useRecording';
|
|
40
40
|
import useJoinMeeting from '../utils/useJoinMeeting';
|
|
41
41
|
import {useMeetingInfo} from '../components/meeting-info/useMeetingInfo';
|
|
@@ -48,11 +48,12 @@ import {ChatUIControlProvider} from '../components/chat-ui/useChatUIControl';
|
|
|
48
48
|
import {ChatMessagesProvider} from '../components/chat-messages/useChatMessages';
|
|
49
49
|
import {ScreenShareProvider} from '../components/contexts/ScreenShareContext';
|
|
50
50
|
import {LiveStreamDataProvider} from '../components/contexts/LiveStreamDataContext';
|
|
51
|
+
import {VideoMeetingDataProvider} from '../components/contexts/VideoMeetingDataContext';
|
|
51
52
|
import {WhiteboardProvider} from '../components/contexts/WhiteboardContext';
|
|
52
53
|
import {useWakeLock} from '../components/useWakeLock';
|
|
53
|
-
import StorageContext from '../components/StorageContext';
|
|
54
54
|
import SDKEvents from '../utils/SdkEvents';
|
|
55
55
|
import {UserPreferenceProvider} from '../components/useUserPreference';
|
|
56
|
+
import EventsConfigure from '../components/EventsConfigure';
|
|
56
57
|
|
|
57
58
|
enum RnEncryptionEnum {
|
|
58
59
|
/**
|
|
@@ -81,6 +82,7 @@ enum RnEncryptionEnum {
|
|
|
81
82
|
}
|
|
82
83
|
|
|
83
84
|
const VideoCall: React.FC = () => {
|
|
85
|
+
const hasBrandLogo = useHasBrandLogo();
|
|
84
86
|
//commented for v1 release
|
|
85
87
|
//const joiningLoaderLabel = useString('joiningLoaderLabel')();
|
|
86
88
|
const joiningLoaderLabel = 'Starting Call. Just a second.';
|
|
@@ -89,9 +91,9 @@ const VideoCall: React.FC = () => {
|
|
|
89
91
|
const [callActive, setCallActive] = useState($config.PRECALL ? false : true);
|
|
90
92
|
|
|
91
93
|
//layouts
|
|
92
|
-
const layouts =
|
|
94
|
+
const layouts = useLayoutsData();
|
|
93
95
|
const defaultLayoutName = isArray(layouts) ? layouts[0].name : '';
|
|
94
|
-
const [
|
|
96
|
+
const [currentLayout, setLayout] = useState(defaultLayoutName);
|
|
95
97
|
//layouts
|
|
96
98
|
|
|
97
99
|
const [isRecordingActive, setRecordingActive] = useState(false);
|
|
@@ -99,7 +101,7 @@ const VideoCall: React.FC = () => {
|
|
|
99
101
|
const [sidePanel, setSidePanel] = useState<SidePanelType>(SidePanelType.None);
|
|
100
102
|
const {phrase} = useParams<{phrase: string}>();
|
|
101
103
|
// commented for v1 release
|
|
102
|
-
//const lifecycle =
|
|
104
|
+
//const lifecycle = useCustomization((data) => data.lifecycle);
|
|
103
105
|
const [rtcProps, setRtcProps] = React.useState({
|
|
104
106
|
appId: $config.APP_ID,
|
|
105
107
|
channel: null,
|
|
@@ -115,6 +117,7 @@ const VideoCall: React.FC = () => {
|
|
|
115
117
|
: false,
|
|
116
118
|
role: ClientRole.Broadcaster,
|
|
117
119
|
geoFencing: $config.GEO_FENCING,
|
|
120
|
+
audioRoom: $config.AUDIO_ROOM,
|
|
118
121
|
});
|
|
119
122
|
|
|
120
123
|
const useJoin = useJoinMeeting();
|
|
@@ -136,38 +139,39 @@ const VideoCall: React.FC = () => {
|
|
|
136
139
|
});
|
|
137
140
|
}, []);
|
|
138
141
|
|
|
139
|
-
const data = useMeetingInfo();
|
|
142
|
+
const {isJoinDataFetched, data} = useMeetingInfo();
|
|
140
143
|
|
|
141
144
|
React.useEffect(() => {
|
|
142
|
-
if (
|
|
145
|
+
if (isJoinDataFetched === true) {
|
|
143
146
|
setRtcProps({
|
|
144
147
|
appId: $config.APP_ID,
|
|
145
148
|
channel: data.channel,
|
|
146
149
|
uid: data.uid,
|
|
147
150
|
token: data.token,
|
|
148
|
-
rtm: data.
|
|
151
|
+
rtm: data.rtmToken,
|
|
149
152
|
dual: true,
|
|
150
153
|
profile: $config.PROFILE,
|
|
151
154
|
encryption: $config.ENCRYPTION_ENABLED
|
|
152
155
|
? {
|
|
153
|
-
key: data.
|
|
156
|
+
key: data.encryptionSecret,
|
|
154
157
|
mode: RnEncryptionEnum.AES128XTS,
|
|
155
|
-
screenKey: data.
|
|
158
|
+
screenKey: data.encryptionSecret,
|
|
156
159
|
}
|
|
157
160
|
: false,
|
|
158
161
|
screenShareUid: data.screenShareUid,
|
|
159
162
|
screenShareToken: data.screenShareToken,
|
|
160
163
|
role: data.isHost ? ClientRole.Broadcaster : ClientRole.Audience,
|
|
161
164
|
geoFencing: $config.GEO_FENCING,
|
|
165
|
+
audioRoom: $config.AUDIO_ROOM,
|
|
162
166
|
});
|
|
163
167
|
|
|
164
168
|
// 1. Store the display name from API
|
|
165
169
|
// if (data.username) {
|
|
166
170
|
// setUsername(data.username);
|
|
167
171
|
// }
|
|
168
|
-
queryComplete ? {} : setQueryComplete(
|
|
172
|
+
queryComplete ? {} : setQueryComplete(isJoinDataFetched);
|
|
169
173
|
}
|
|
170
|
-
}, [
|
|
174
|
+
}, [isJoinDataFetched]);
|
|
171
175
|
|
|
172
176
|
const history = useHistory();
|
|
173
177
|
const callbacks = {
|
|
@@ -201,67 +205,71 @@ const VideoCall: React.FC = () => {
|
|
|
201
205
|
<DeviceConfigure>
|
|
202
206
|
<ChatUIControlProvider>
|
|
203
207
|
<ChatNotificationProvider>
|
|
204
|
-
<
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
208
|
+
<SidePanelProvider
|
|
209
|
+
value={{
|
|
210
|
+
sidePanel,
|
|
211
|
+
setSidePanel,
|
|
212
|
+
}}>
|
|
213
|
+
<ChatMessagesProvider>
|
|
210
214
|
<ScreenShareProvider>
|
|
211
215
|
<RtmConfigure
|
|
212
216
|
setRecordingActive={setRecordingActive}
|
|
213
217
|
callActive={callActive}>
|
|
214
218
|
<UserPreferenceProvider>
|
|
215
|
-
<
|
|
216
|
-
<
|
|
217
|
-
|
|
218
|
-
activeLayoutName,
|
|
219
|
-
setActiveLayoutName,
|
|
220
|
-
}}>
|
|
221
|
-
<RecordingProvider
|
|
219
|
+
<EventsConfigure>
|
|
220
|
+
<WhiteboardProvider>
|
|
221
|
+
<LayoutProvider
|
|
222
222
|
value={{
|
|
223
|
-
|
|
224
|
-
|
|
223
|
+
currentLayout,
|
|
224
|
+
setLayout,
|
|
225
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
|
-
|
|
226
|
+
<RecordingProvider
|
|
227
|
+
value={{
|
|
228
|
+
setRecordingActive,
|
|
229
|
+
isRecordingActive,
|
|
230
|
+
}}>
|
|
231
|
+
<ScreenshareConfigure>
|
|
232
|
+
<LiveStreamContextProvider
|
|
233
|
+
value={{
|
|
234
|
+
setRtcProps,
|
|
235
|
+
rtcProps,
|
|
236
|
+
callActive,
|
|
237
|
+
}}>
|
|
238
|
+
<LiveStreamDataProvider>
|
|
239
|
+
<LocalUserContext
|
|
240
|
+
localUid={rtcProps?.uid || 0}>
|
|
241
|
+
<CustomUserContextHolder>
|
|
242
|
+
<NetworkQualityProvider>
|
|
243
|
+
{callActive ? (
|
|
244
|
+
<VideoMeetingDataProvider>
|
|
245
|
+
<VideoCallScreen />
|
|
246
|
+
</VideoMeetingDataProvider>
|
|
247
|
+
) : $config.PRECALL ? (
|
|
248
|
+
<PreCallProvider
|
|
249
|
+
value={{
|
|
250
|
+
callActive,
|
|
251
|
+
setCallActive,
|
|
252
|
+
}}>
|
|
253
|
+
<Precall />
|
|
254
|
+
</PreCallProvider>
|
|
255
|
+
) : (
|
|
256
|
+
<></>
|
|
257
|
+
)}
|
|
258
|
+
</NetworkQualityProvider>
|
|
259
|
+
</CustomUserContextHolder>
|
|
260
|
+
</LocalUserContext>
|
|
261
|
+
</LiveStreamDataProvider>
|
|
262
|
+
</LiveStreamContextProvider>
|
|
263
|
+
</ScreenshareConfigure>
|
|
264
|
+
</RecordingProvider>
|
|
265
|
+
</LayoutProvider>
|
|
266
|
+
</WhiteboardProvider>
|
|
267
|
+
</EventsConfigure>
|
|
260
268
|
</UserPreferenceProvider>
|
|
261
269
|
</RtmConfigure>
|
|
262
270
|
</ScreenShareProvider>
|
|
263
|
-
</
|
|
264
|
-
</
|
|
271
|
+
</ChatMessagesProvider>
|
|
272
|
+
</SidePanelProvider>
|
|
265
273
|
</ChatNotificationProvider>
|
|
266
274
|
</ChatUIControlProvider>
|
|
267
275
|
</DeviceConfigure>
|
|
@@ -270,7 +278,7 @@ const VideoCall: React.FC = () => {
|
|
|
270
278
|
</>
|
|
271
279
|
) : (
|
|
272
280
|
<View style={style.loader}>
|
|
273
|
-
<View style={style.loaderLogo}>{hasBrandLogo && <Logo />}</View>
|
|
281
|
+
<View style={style.loaderLogo}>{hasBrandLogo() && <Logo />}</View>
|
|
274
282
|
<Text style={style.loaderText}>{joiningLoaderLabel}</Text>
|
|
275
283
|
</View>
|
|
276
284
|
)
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
12
|
import React, {createContext} from 'react';
|
|
13
|
-
import {createHook} from '
|
|
13
|
+
import {createHook} from 'customization-implementation';
|
|
14
14
|
|
|
15
15
|
export interface CreateContextInterface {
|
|
16
16
|
showShareScreen: () => void;
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {useCustomization} from 'customization-implementation';
|
|
3
3
|
|
|
4
4
|
const CustomUserContextHolder: React.FC<{children: any}> = (props) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
const useUserContext = useCustomization((config) => {
|
|
6
|
+
if (
|
|
7
|
+
config?.components?.videoCall &&
|
|
8
|
+
typeof config?.components?.videoCall === 'object' &&
|
|
9
|
+
config?.components?.videoCall?.useUserContext &&
|
|
10
|
+
typeof config?.components?.videoCall?.useUserContext === 'function'
|
|
11
|
+
) {
|
|
12
|
+
return config?.components?.videoCall?.useUserContext;
|
|
13
|
+
} else {
|
|
14
|
+
return () => {};
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
useUserContext();
|
|
10
18
|
return props.children;
|
|
11
19
|
};
|
|
12
20
|
export default CustomUserContextHolder;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {layoutObjectType} from '
|
|
1
|
+
import {layoutObjectType} from 'customization-api';
|
|
2
2
|
import GridVideo from '../../components/GridVideo';
|
|
3
3
|
import PinnedVideo from '../../components/PinnedVideo';
|
|
4
|
-
import
|
|
4
|
+
import useLayoutsData from './useLayoutsData';
|
|
5
5
|
import {useLayout} from '../../utils/useLayout';
|
|
6
6
|
|
|
7
7
|
export const DefaultLayouts: layoutObjectType[] = [
|
|
@@ -23,8 +23,8 @@ export const getPinnedLayoutName = () => DefaultLayouts[1].name;
|
|
|
23
23
|
export const getGridLayoutName = () => DefaultLayouts[0].name;
|
|
24
24
|
|
|
25
25
|
export const useSetPinnedLayout = () => {
|
|
26
|
-
const {
|
|
27
|
-
const layouts =
|
|
26
|
+
const {setLayout} = useLayout();
|
|
27
|
+
const layouts = useLayoutsData();
|
|
28
28
|
const pinnedLayoutName = getPinnedLayoutName();
|
|
29
29
|
let checkPinnedLayoutExist = false;
|
|
30
30
|
if (layouts && Array.isArray(layouts) && layouts.length) {
|
|
@@ -37,13 +37,13 @@ export const useSetPinnedLayout = () => {
|
|
|
37
37
|
return () => {};
|
|
38
38
|
}
|
|
39
39
|
return () => {
|
|
40
|
-
|
|
40
|
+
setLayout(pinnedLayoutName);
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
export const useChangeDefaultLayout = () => {
|
|
45
|
-
const {
|
|
46
|
-
const layout =
|
|
45
|
+
const {setLayout} = useLayout();
|
|
46
|
+
const layout = useLayoutsData();
|
|
47
47
|
|
|
48
48
|
if (!layout) {
|
|
49
49
|
return () => {};
|
|
@@ -58,7 +58,7 @@ export const useChangeDefaultLayout = () => {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
return () => {
|
|
61
|
-
|
|
61
|
+
setLayout((activeLayout: string) =>
|
|
62
62
|
activeLayout === layout[1].name ? layout[0].name : layout[1].name,
|
|
63
63
|
);
|
|
64
64
|
};
|
|
@@ -6,7 +6,12 @@ import TextWithTooltip from '../../subComponents/TextWithTooltip';
|
|
|
6
6
|
import ColorContext from '../../components/ColorContext';
|
|
7
7
|
import {useString} from '../../utils/useString';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
interface NameWithMicIconProps {
|
|
10
|
+
user: RenderInterface;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const NameWithMicIcon = (props: NameWithMicIconProps) => {
|
|
14
|
+
const {user} = props;
|
|
10
15
|
const {primaryColor} = useContext(ColorContext);
|
|
11
16
|
const {height, width} = useWindowDimensions();
|
|
12
17
|
//commented for v1 release
|
|
@@ -60,3 +65,5 @@ const style = StyleSheet.create({
|
|
|
60
65
|
resizeMode: 'contain',
|
|
61
66
|
},
|
|
62
67
|
});
|
|
68
|
+
|
|
69
|
+
export default NameWithMicIcon;
|
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import VideoRenderer from './VideoRenderer';
|
|
3
3
|
import {UidType} from '../../../agora-rn-uikit';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
useFpe,
|
|
7
|
-
useRenderContext,
|
|
8
|
-
} from 'fpe-api';
|
|
4
|
+
import {renderComponentObjectInterface, useRender} from 'customization-api';
|
|
5
|
+
import {useCustomization} from 'customization-implementation';
|
|
9
6
|
import {isValidReactComponent} from '../../utils/common';
|
|
10
7
|
|
|
11
8
|
export type RenderComponentType = {[key: string]: React.FC<any>};
|
|
12
9
|
|
|
13
10
|
const DefaultRenderComponent: RenderComponentType = {
|
|
14
|
-
rtc:
|
|
15
|
-
screenshare:
|
|
11
|
+
rtc: VideoRenderer,
|
|
12
|
+
screenshare: VideoRenderer,
|
|
16
13
|
};
|
|
17
14
|
interface RenderComponentProps {
|
|
18
15
|
uid: UidType;
|
|
19
16
|
}
|
|
20
17
|
const RenderComponent = ({uid}: RenderComponentProps) => {
|
|
21
|
-
const {renderList} =
|
|
22
|
-
const FpeRenderComponent =
|
|
18
|
+
const {renderList} = useRender();
|
|
19
|
+
const FpeRenderComponent = useCustomization((config) =>
|
|
23
20
|
typeof config?.components?.videoCall === 'object' &&
|
|
24
21
|
typeof config?.components?.videoCall?.customContent === 'object'
|
|
25
22
|
? config?.components?.videoCall?.customContent
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React, {useContext, useEffect} from 'react';
|
|
2
2
|
import {View, StyleSheet} from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import {useCustomization} from 'customization-implementation';
|
|
4
4
|
import Navbar from '../../components/Navbar';
|
|
5
5
|
import ParticipantsView from '../../components/ParticipantsView';
|
|
6
6
|
import SettingsView from '../../components/SettingsView';
|
|
7
7
|
import Controls from '../../components/Controls';
|
|
8
8
|
import Chat from '../../components/Chat';
|
|
9
9
|
import {SidePanelType} from '../../subComponents/SidePanelEnum';
|
|
10
|
-
import {isValidReactComponent,
|
|
10
|
+
import {isValidReactComponent, isWebInternal} from '../../utils/common';
|
|
11
11
|
import {useSidePanel} from '../../utils/useSidePanel';
|
|
12
12
|
import VideoComponent from './VideoComponent';
|
|
13
13
|
import {videoView} from '../../../theme.json';
|
|
@@ -16,13 +16,15 @@ import {
|
|
|
16
16
|
ButtonTemplateName,
|
|
17
17
|
} from '../../utils/useButtonTemplate';
|
|
18
18
|
import SDKEvents from '../../utils/SdkEvents';
|
|
19
|
-
import {RtcContext} from '../../../agora-rn-uikit';
|
|
20
19
|
import {useMeetingInfo} from '../../components/meeting-info/useMeetingInfo';
|
|
20
|
+
import {useRtc} from 'customization-api';
|
|
21
21
|
|
|
22
22
|
const VideoCallScreen = () => {
|
|
23
23
|
const {sidePanel} = useSidePanel();
|
|
24
|
-
const rtc =
|
|
25
|
-
const {
|
|
24
|
+
const rtc = useRtc();
|
|
25
|
+
const {
|
|
26
|
+
data: {meetingTitle, isHost},
|
|
27
|
+
} = useMeetingInfo();
|
|
26
28
|
const {
|
|
27
29
|
ChatComponent,
|
|
28
30
|
VideocallComponent,
|
|
@@ -32,7 +34,7 @@ const VideoCallScreen = () => {
|
|
|
32
34
|
TopbarComponent,
|
|
33
35
|
VideocallBeforeView,
|
|
34
36
|
VideocallAfterView,
|
|
35
|
-
} =
|
|
37
|
+
} = useCustomization((data) => {
|
|
36
38
|
let components: {
|
|
37
39
|
VideocallComponent?: React.ComponentType;
|
|
38
40
|
ChatComponent: React.ComponentType;
|
|
@@ -95,14 +97,13 @@ const VideoCallScreen = () => {
|
|
|
95
97
|
components.BottombarComponent = data?.components?.videoCall.bottomBar;
|
|
96
98
|
}
|
|
97
99
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
// }
|
|
100
|
+
if (
|
|
101
|
+
data?.components?.videoCall.topBar &&
|
|
102
|
+
typeof data?.components?.videoCall.topBar !== 'object' &&
|
|
103
|
+
isValidReactComponent(data?.components?.videoCall.topBar)
|
|
104
|
+
) {
|
|
105
|
+
components.TopbarComponent = data?.components?.videoCall.topBar;
|
|
106
|
+
}
|
|
106
107
|
|
|
107
108
|
if (
|
|
108
109
|
data?.components?.videoCall.participantsPanel &&
|
|
@@ -128,13 +129,21 @@ const VideoCallScreen = () => {
|
|
|
128
129
|
});
|
|
129
130
|
|
|
130
131
|
useEffect(() => {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
132
|
+
/**
|
|
133
|
+
* OLD: Commenting this code as getDevices API is web only
|
|
134
|
+
* The below code fails on native app
|
|
135
|
+
* RESPONSE: Added isWebInternal check to restrict execution only on web.
|
|
136
|
+
*/
|
|
137
|
+
if (isWebInternal()) {
|
|
138
|
+
new Promise((res) =>
|
|
139
|
+
rtc.RtcEngine.getDevices(function (devices: MediaDeviceInfo[]) {
|
|
140
|
+
res(devices);
|
|
141
|
+
}),
|
|
142
|
+
).then((devices: MediaDeviceInfo[]) => {
|
|
143
|
+
SDKEvents.emit('join', meetingTitle, devices, isHost);
|
|
144
|
+
console.log('SDKEvents: Event Called join');
|
|
145
|
+
});
|
|
146
|
+
}
|
|
138
147
|
}, []);
|
|
139
148
|
|
|
140
149
|
return VideocallComponent ? (
|
|
@@ -165,7 +174,7 @@ const VideoCallScreen = () => {
|
|
|
165
174
|
)}
|
|
166
175
|
{sidePanel === SidePanelType.Settings ? <SettingsComponent /> : <></>}
|
|
167
176
|
</View>
|
|
168
|
-
{!
|
|
177
|
+
{!isWebInternal() && sidePanel === SidePanelType.Chat ? (
|
|
169
178
|
<></>
|
|
170
179
|
) : (
|
|
171
180
|
<ButtonTemplateProvider
|
|
@@ -1,32 +1,30 @@
|
|
|
1
1
|
import React, {useEffect, useState} from 'react';
|
|
2
|
-
import
|
|
2
|
+
import useLayoutsData from './useLayoutsData';
|
|
3
3
|
import {isArray, isValidReactComponent} from '../../utils/common';
|
|
4
4
|
import {useLayout} from '../../utils/useLayout';
|
|
5
|
-
import {
|
|
5
|
+
import {useRender} from 'customization-api';
|
|
6
6
|
|
|
7
7
|
const VideoComponent = () => {
|
|
8
8
|
const [layout, setLayoutIndex] = useState(0);
|
|
9
|
-
const
|
|
10
|
-
const {
|
|
11
|
-
const {
|
|
9
|
+
const layoutsData = useLayoutsData();
|
|
10
|
+
const {currentLayout} = useLayout();
|
|
11
|
+
const {activeUids} = useRender();
|
|
12
12
|
useEffect(() => {
|
|
13
|
-
if (isArray(
|
|
14
|
-
let index =
|
|
15
|
-
(item) => item.name === activeLayoutName,
|
|
16
|
-
);
|
|
13
|
+
if (isArray(layoutsData)) {
|
|
14
|
+
let index = layoutsData.findIndex((item) => item.name === currentLayout);
|
|
17
15
|
if (index >= 0) {
|
|
18
16
|
setLayoutIndex(index);
|
|
19
17
|
}
|
|
20
18
|
}
|
|
21
|
-
}, [
|
|
19
|
+
}, [currentLayout]);
|
|
22
20
|
|
|
23
21
|
if (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
isValidReactComponent(
|
|
22
|
+
layoutsData &&
|
|
23
|
+
layoutsData[layout] &&
|
|
24
|
+
isValidReactComponent(layoutsData[layout].component)
|
|
27
25
|
) {
|
|
28
|
-
const CurrentLayout =
|
|
29
|
-
return <CurrentLayout renderData={
|
|
26
|
+
const CurrentLayout = layoutsData[layout].component;
|
|
27
|
+
return <CurrentLayout renderData={activeUids} />;
|
|
30
28
|
} else {
|
|
31
29
|
return <></>;
|
|
32
30
|
}
|
|
@@ -5,13 +5,13 @@ import ScreenShareNotice from '../../subComponents/ScreenShareNotice';
|
|
|
5
5
|
import {MaxVideoView} from '../../../agora-rn-uikit';
|
|
6
6
|
import FallbackLogo from '../../subComponents/FallbackLogo';
|
|
7
7
|
import ColorContext from '../../components/ColorContext';
|
|
8
|
-
import
|
|
9
|
-
import
|
|
8
|
+
import NetworkQualityPill from '../../subComponents/NetworkQualityPill';
|
|
9
|
+
import NameWithMicIcon from './NameWithMicIcon';
|
|
10
10
|
|
|
11
|
-
interface
|
|
11
|
+
interface VideoRendererProps {
|
|
12
12
|
user: RenderInterface;
|
|
13
13
|
}
|
|
14
|
-
const
|
|
14
|
+
const VideoRenderer: React.FC<VideoRendererProps> = ({user}) => {
|
|
15
15
|
const {primaryColor} = useContext(ColorContext);
|
|
16
16
|
return (
|
|
17
17
|
<View style={maxStyle.container}>
|
|
@@ -34,7 +34,7 @@ const MaxVideoRenderer: React.FC<MaxVideoRendererInterface> = ({user}) => {
|
|
|
34
34
|
key={user.uid}
|
|
35
35
|
/>
|
|
36
36
|
<View style={maxStyle.nameHolder}>
|
|
37
|
-
<
|
|
37
|
+
<NameWithMicIcon user={user} />
|
|
38
38
|
</View>
|
|
39
39
|
</View>
|
|
40
40
|
);
|
|
@@ -83,4 +83,4 @@ const maxStyle = StyleSheet.create({
|
|
|
83
83
|
},
|
|
84
84
|
});
|
|
85
85
|
|
|
86
|
-
export
|
|
86
|
+
export default VideoRenderer;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {useCustomization} from 'customization-implementation';
|
|
2
|
+
import {DefaultLayouts} from './DefaultLayouts';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* if custom layouts provided in customization api
|
|
6
|
+
* @returns customLayouts array
|
|
7
|
+
* else
|
|
8
|
+
* @returns defaultLayouts array
|
|
9
|
+
*/
|
|
10
|
+
function useLayoutsData() {
|
|
11
|
+
const layoutsData = useCustomization((config) => {
|
|
12
|
+
if (
|
|
13
|
+
typeof config?.components?.videoCall === 'object' &&
|
|
14
|
+
config?.components?.videoCall?.customLayout
|
|
15
|
+
) {
|
|
16
|
+
return config.components.videoCall.customLayout(DefaultLayouts);
|
|
17
|
+
} else {
|
|
18
|
+
return DefaultLayouts;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
return layoutsData;
|
|
22
|
+
}
|
|
23
|
+
export default useLayoutsData;
|
|
@@ -30,6 +30,11 @@ class RTMEngine {
|
|
|
30
30
|
await this.engine.createClient($config.APP_ID);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
private async destroyClientInstance() {
|
|
34
|
+
await this.engine.logout();
|
|
35
|
+
await this.engine.destroyClient();
|
|
36
|
+
}
|
|
37
|
+
|
|
33
38
|
private constructor() {
|
|
34
39
|
if (RTMEngine._instance) {
|
|
35
40
|
return RTMEngine._instance;
|
|
@@ -53,6 +58,14 @@ class RTMEngine {
|
|
|
53
58
|
get channelUid() {
|
|
54
59
|
return this.channelId;
|
|
55
60
|
}
|
|
61
|
+
destroy() {
|
|
62
|
+
try {
|
|
63
|
+
this.destroyClientInstance();
|
|
64
|
+
RTMEngine._instance = null;
|
|
65
|
+
} catch (error) {
|
|
66
|
+
console.log('Error destroying instance error: ', error);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
56
69
|
}
|
|
57
70
|
|
|
58
71
|
export default RTMEngine;
|