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.
Files changed (205) hide show
  1. package/Readme.md +11 -6
  2. package/package.json +1 -1
  3. package/template/Gulpfile.js +121 -83
  4. package/template/_gitignore +2 -2
  5. package/template/_package-lock.json +12959 -13248
  6. package/template/agora-rn-uikit/src/AgoraUIKit.tsx +2 -2
  7. package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +2 -0
  8. package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +3 -3
  9. package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +4 -5
  10. package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +3 -1
  11. package/template/agora-rn-uikit/src/Controls/LocalControls.tsx +2 -2
  12. package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +1 -1
  13. package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +1 -1
  14. package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +1 -1
  15. package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +1 -1
  16. package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +4 -4
  17. package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +7 -5
  18. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +1 -1
  19. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +1 -1
  20. package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +2 -2
  21. package/template/agora-rn-uikit/src/Rtc/Create.tsx +88 -43
  22. package/template/agora-rn-uikit/src/Rtc/Join.tsx +13 -4
  23. package/template/agora-rn-uikit/src/RtcConfigure.tsx +36 -19
  24. package/template/agora-rn-uikit/src/Utils/permission.ts +17 -6
  25. package/template/babel.config.js +9 -9
  26. package/template/bridge/rtc/webNg/RtcEngine.ts +51 -26
  27. package/template/customization-api/action-library.ts +22 -0
  28. package/template/{fpe-api/context.ts → customization-api/app-state.ts} +16 -14
  29. package/template/customization-api/customEvents.ts +9 -0
  30. package/template/{fpe-api/install.ts → customization-api/customize.ts} +27 -26
  31. package/template/{fpe-api → customization-api}/index.ts +11 -6
  32. package/template/{fpe-api/components.ts → customization-api/sub-components.ts} +22 -3
  33. package/template/{fpe-api → customization-api}/typeDefinition.ts +13 -14
  34. package/template/customization-api/utils.ts +30 -0
  35. package/template/{fpe-implementation → customization-implementation}/createHook.ts +0 -0
  36. package/template/{fpe-implementation/dummyFpe.ts → customization-implementation/dummyConfig.ts} +4 -4
  37. package/template/customization-implementation/index.ts +4 -0
  38. package/template/{fpe-api/useFpe.tsx → customization-implementation/useCustomization.tsx} +12 -12
  39. package/template/{fpe.config.js → customization.config.js} +11 -11
  40. package/template/electron/main/index.js +42 -35
  41. package/template/esbuild.rsdk.go +8 -17
  42. package/template/global.d.ts +4 -3
  43. package/template/index.rsdk.tsx +13 -5
  44. package/template/index.wsdk.tsx +21 -5
  45. package/template/package.json +3 -0
  46. package/template/react-native-toast-message/src/index.js +3 -7
  47. package/template/react-native-toast-message/src/{index.wsdk.js → index.sdk.tsx} +1 -1
  48. package/template/react-native-toast-message/src/styles.sdk.ts +17 -0
  49. package/template/src/App.tsx +8 -4
  50. package/template/src/AppWrapper.tsx +8 -6
  51. package/template/src/SDKAppWrapper.tsx +28 -21
  52. package/template/src/app-state/useLocalUserInfo.ts +8 -0
  53. package/template/src/app-state/useMessages.ts +52 -0
  54. package/template/src/atoms/PrimaryButton.tsx +2 -2
  55. package/template/src/atoms/SecondaryButton.tsx +12 -4
  56. package/template/src/atoms/TextInput.tsx +2 -2
  57. package/template/src/components/Chat.tsx +22 -11
  58. package/template/src/components/ChatContext.ts +10 -27
  59. package/template/src/components/Controls.native.tsx +13 -7
  60. package/template/src/components/Controls.tsx +15 -24
  61. package/template/src/components/DeviceConfigure.tsx +4 -3
  62. package/template/src/components/EventsConfigure.tsx +54 -0
  63. package/template/src/components/GridVideo.tsx +5 -6
  64. package/template/src/components/HostControlView.tsx +13 -19
  65. package/template/src/components/Navbar.tsx +54 -41
  66. package/template/src/components/NetworkQualityContext.tsx +4 -3
  67. package/template/src/components/ParticipantsView.tsx +7 -7
  68. package/template/src/components/PinnedVideo.tsx +3 -4
  69. package/template/src/components/Precall.native.tsx +3 -3
  70. package/template/src/components/Precall.tsx +14 -10
  71. package/template/src/components/RTMConfigure.tsx +61 -219
  72. package/template/src/components/SettingsView.tsx +6 -3
  73. package/template/src/components/Share.tsx +24 -18
  74. package/template/src/components/chat-messages/useChatMessages.tsx +397 -80
  75. package/template/src/components/chat-notification/useChatNotification.tsx +2 -2
  76. package/template/src/components/chat-ui/useChatUIControl.tsx +1 -1
  77. package/template/src/components/common/Logo.tsx +3 -2
  78. package/template/src/components/contexts/LiveStreamDataContext.tsx +3 -3
  79. package/template/src/components/contexts/ScreenShareContext.tsx +3 -1
  80. package/template/src/components/contexts/VideoMeetingDataContext.tsx +85 -0
  81. package/template/src/components/contexts/WhiteboardContext.tsx +8 -8
  82. package/template/src/components/livestream/LiveStreamContext.tsx +88 -74
  83. package/template/src/components/meeting-info/useMeetingInfo.tsx +23 -19
  84. package/template/src/components/meeting-info/useSetMeetingInfo.tsx +1 -1
  85. package/template/src/components/participants/AllAudienceParticipants.tsx +2 -2
  86. package/template/src/components/participants/AllHostParticipants.tsx +4 -4
  87. package/template/src/components/participants/MeParticipant.tsx +5 -3
  88. package/template/src/components/participants/ParticipantName.tsx +2 -2
  89. package/template/src/components/participants/RemoteParticipants.tsx +9 -7
  90. package/template/src/components/precall/LocalMute.native.tsx +14 -10
  91. package/template/src/components/precall/LocalMute.tsx +7 -5
  92. package/template/src/components/precall/VideoPreview.native.tsx +6 -6
  93. package/template/src/components/precall/VideoPreview.tsx +3 -3
  94. package/template/src/components/precall/joinCallBtn.tsx +3 -3
  95. package/template/src/components/precall/meetingTitle.tsx +3 -1
  96. package/template/src/components/precall/selectDevice.tsx +2 -2
  97. package/template/src/components/precall/usePreCall.tsx +1 -1
  98. package/template/src/components/styles.ts +3 -3
  99. package/template/src/components/useShareLink.tsx +69 -29
  100. package/template/src/components/useUserPreference.tsx +16 -15
  101. package/template/src/components/useWakeLock.tsx +3 -3
  102. package/template/src/language/i18nTypes.ts +1 -1
  103. package/template/src/language/index.ts +2 -2
  104. package/template/src/language/useLanguage.tsx +2 -3
  105. package/template/src/pages/Authenticate.tsx +3 -2
  106. package/template/src/pages/Create.tsx +18 -20
  107. package/template/src/pages/Join.tsx +6 -7
  108. package/template/src/pages/VideoCall.tsx +74 -66
  109. package/template/src/pages/create/useCreate.tsx +1 -1
  110. package/template/src/pages/video-call/CustomUserContextHolder.tsx +14 -6
  111. package/template/src/pages/video-call/DefaultLayouts.ts +8 -8
  112. package/template/src/pages/video-call/{NameWithMicStatus.tsx → NameWithMicIcon.tsx} +8 -1
  113. package/template/src/pages/video-call/RenderComponent.tsx +7 -10
  114. package/template/src/pages/video-call/VideoCallScreen.tsx +31 -22
  115. package/template/src/pages/video-call/VideoComponent.tsx +13 -15
  116. package/template/src/pages/video-call/VideoRenderer.tsx +6 -6
  117. package/template/src/pages/video-call/useLayoutsData.ts +23 -0
  118. package/template/src/rtm/RTMEngine.ts +13 -0
  119. package/template/src/rtm-events/EventUtils.ts +20 -20
  120. package/template/src/rtm-events/EventsQueue.ts +9 -3
  121. package/template/src/rtm-events/constants.ts +5 -0
  122. package/template/src/rtm-events/index.tsx +1 -3
  123. package/template/src/{custom-events/CustomEvents.ts → rtm-events-api/Events.ts} +67 -61
  124. package/template/src/rtm-events-api/index.tsx +6 -0
  125. package/template/src/rtm-events-api/types.ts +22 -0
  126. package/template/src/subComponents/ChatBubble.tsx +24 -8
  127. package/template/src/subComponents/ChatContainer.tsx +24 -15
  128. package/template/src/subComponents/ChatInput.tsx +56 -42
  129. package/template/src/subComponents/LanguageSelector.tsx +2 -2
  130. package/template/src/subComponents/LayoutIconDropdown.native.tsx +5 -5
  131. package/template/src/subComponents/LayoutIconDropdown.tsx +7 -7
  132. package/template/src/subComponents/LocalAudioMute.tsx +3 -4
  133. package/template/src/subComponents/LocalEndCall.tsx +3 -6
  134. package/template/src/subComponents/LocalSwitchCamera.tsx +3 -4
  135. package/template/src/subComponents/LocalVideoMute.tsx +3 -3
  136. package/template/src/subComponents/NetworkQualityPill.tsx +8 -9
  137. package/template/src/subComponents/OpenInNativeButton.tsx +2 -3
  138. package/template/src/subComponents/RemoteAudioMute.tsx +5 -11
  139. package/template/src/subComponents/RemoteEndCall.tsx +3 -10
  140. package/template/src/subComponents/RemoteVideoMute.tsx +3 -10
  141. package/template/src/subComponents/SelectDevice.tsx +1 -1
  142. package/template/src/subComponents/SelectOAuth.tsx +3 -2
  143. package/template/src/subComponents/SidePanelButtons.ts +6 -5
  144. package/template/src/subComponents/TextWithTooltip.tsx +6 -2
  145. package/template/src/subComponents/{toastConfig.tsx → ToastConfig.tsx} +2 -2
  146. package/template/src/subComponents/chat/ChatParticipants.tsx +6 -5
  147. package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +2 -2
  148. package/template/src/subComponents/livestream/controls/RemoteLiveStreamApprovedRequestRecall.tsx +4 -3
  149. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestApprove.tsx +2 -2
  150. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestReject.tsx +2 -4
  151. package/template/src/subComponents/livestream/index.ts +2 -2
  152. package/template/src/subComponents/recording/useRecording.tsx +44 -23
  153. package/template/src/subComponents/recording/useRecordingLayoutQuery.tsx +11 -5
  154. package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +46 -34
  155. package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +97 -38
  156. package/template/src/subComponents/screenshare/useScreenshare.tsx +1 -1
  157. package/template/src/utils/SdkEvents.ts +9 -46
  158. package/template/src/utils/common.tsx +25 -9
  159. package/template/src/utils/getUniqueID.ts +5 -0
  160. package/template/src/utils/isMobileOrTablet.native.ts +2 -2
  161. package/template/src/utils/isMobileOrTablet.ts +21 -8
  162. package/template/src/utils/useButtonTemplate.tsx +1 -1
  163. package/template/src/utils/useCreateMeeting.ts +21 -10
  164. package/template/src/utils/useGetMeetingPhrase.ts +11 -8
  165. package/template/src/utils/{IsAttendeeUser.ts → useIsAttendee.ts} +3 -1
  166. package/template/src/utils/{isAudioEnabled.ts → useIsAudioEnabled.ts} +4 -4
  167. package/template/src/utils/{isHostUser.ts → useIsHost.ts} +13 -16
  168. package/template/src/utils/{isPSTNUser.ts → useIsPSTN.ts} +2 -2
  169. package/template/src/utils/{isScreenShareUser.ts → useIsScreenShare.ts} +0 -0
  170. package/template/src/utils/{isVideoEnabled.ts → useIsVideoEnabled.ts} +5 -6
  171. package/template/src/utils/useJoinMeeting.ts +8 -6
  172. package/template/src/utils/useLayout.tsx +5 -5
  173. package/template/src/utils/useMutePSTN.ts +5 -3
  174. package/template/src/utils/useMuteToggleLocal.ts +3 -4
  175. package/template/src/utils/useRemoteEndCall.ts +11 -10
  176. package/template/src/utils/useRemoteMute.ts +42 -20
  177. package/template/src/utils/useSidePanel.tsx +1 -1
  178. package/template/src/utils/useString.ts +2 -2
  179. package/template/src/utils/useUserName.ts +11 -0
  180. package/template/tsconfig_fpeApi.json +8 -9
  181. package/template/tsconfig_rsdk_index.json +8 -9
  182. package/template/tsconfig_wsdk_index.json +8 -9
  183. package/template/webpack.commons.js +9 -9
  184. package/template/webpack.rsdk.config.js +4 -2
  185. package/template/webpack.ts.config.js +6 -6
  186. package/template/webpack.wsdk.config.js +2 -1
  187. package/template/fpe-api/fpeEvents.ts +0 -9
  188. package/template/fpe-api/utils.ts +0 -61
  189. package/template/fpe-implementation/index.ts +0 -1
  190. package/template/fpe-todo.txt +0 -14
  191. package/template/src/components/RTMEvents.tsx +0 -84
  192. package/template/src/custom-events/index.tsx +0 -4
  193. package/template/src/custom-events/types.ts +0 -51
  194. package/template/src/pages/video-call/CustomLayout.ts +0 -17
  195. package/template/src/rtm-events/types.ts +0 -7
  196. package/template/src/utils/getMeetingInvite.ts +0 -53
  197. package/template/src/utils/useGroupMessages.ts +0 -24
  198. package/template/src/utils/useNavParams.ts +0 -6
  199. package/template/src/utils/useNavigateTo.ts +0 -8
  200. package/template/src/utils/usePrivateMessages.ts +0 -33
  201. package/template/src/utils/useSendControlMessage.ts +0 -51
  202. package/template/src/utils/useSendMessage.ts +0 -40
  203. package/template/src/utils/useSetUnreadMessageCount.ts +0 -43
  204. package/template/src/utils/useUnreadMessageCount.ts +0 -50
  205. 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 {hasBrandLogo, isArray} from '../utils/common';
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 {useFpe} from 'fpe-api';
35
+ import {useCustomization} from 'customization-implementation';
36
36
  import Precall from '../components/Precall';
37
37
  import {useString} from '../utils/useString';
38
- import useCustomLayout from './video-call/CustomLayout';
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 = useCustomLayout();
94
+ const layouts = useLayoutsData();
93
95
  const defaultLayoutName = isArray(layouts) ? layouts[0].name : '';
94
- const [activeLayoutName, setActiveLayoutName] = useState(defaultLayoutName);
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 = useFpe((data) => data.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 (data.isJoinDataFetched === true) {
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.rtm,
151
+ rtm: data.rtmToken,
149
152
  dual: true,
150
153
  profile: $config.PROFILE,
151
154
  encryption: $config.ENCRYPTION_ENABLED
152
155
  ? {
153
- key: data.secret,
156
+ key: data.encryptionSecret,
154
157
  mode: RnEncryptionEnum.AES128XTS,
155
- screenKey: data.secret,
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(data.isJoinDataFetched);
172
+ queryComplete ? {} : setQueryComplete(isJoinDataFetched);
169
173
  }
170
- }, [data?.isJoinDataFetched]);
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
- <ChatMessagesProvider>
205
- <SidePanelProvider
206
- value={{
207
- sidePanel,
208
- setSidePanel,
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
- <WhiteboardProvider>
216
- <LayoutProvider
217
- value={{
218
- activeLayoutName,
219
- setActiveLayoutName,
220
- }}>
221
- <RecordingProvider
219
+ <EventsConfigure>
220
+ <WhiteboardProvider>
221
+ <LayoutProvider
222
222
  value={{
223
- setRecordingActive,
224
- isRecordingActive,
223
+ currentLayout,
224
+ setLayout,
225
225
  }}>
226
- <ScreenshareConfigure>
227
- <LiveStreamContextProvider
228
- value={{
229
- setRtcProps,
230
- rtcProps,
231
- callActive,
232
- }}>
233
- <LiveStreamDataProvider>
234
- <LocalUserContext
235
- localUid={rtcProps?.uid || 0}>
236
- <CustomUserContextHolder>
237
- <NetworkQualityProvider>
238
- {callActive ? (
239
- <VideoCallScreen />
240
- ) : $config.PRECALL ? (
241
- <PreCallProvider
242
- value={{
243
- callActive,
244
- setCallActive,
245
- }}>
246
- <Precall />
247
- </PreCallProvider>
248
- ) : (
249
- <></>
250
- )}
251
- </NetworkQualityProvider>
252
- </CustomUserContextHolder>
253
- </LocalUserContext>
254
- </LiveStreamDataProvider>
255
- </LiveStreamContextProvider>
256
- </ScreenshareConfigure>
257
- </RecordingProvider>
258
- </LayoutProvider>
259
- </WhiteboardProvider>
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
- </SidePanelProvider>
264
- </ChatMessagesProvider>
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 'fpe-implementation';
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 {useFpe} from 'fpe-api';
2
+ import {useCustomization} from 'customization-implementation';
3
3
 
4
4
  const CustomUserContextHolder: React.FC<{children: any}> = (props) => {
5
- //commented for v1 release
6
- // const fpeCustomContext = useFpe((config) => config?.customUserContext);
7
- // if (fpeCustomContext) {
8
- // fpeCustomContext();
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 'fpe-api';
1
+ import {layoutObjectType} from 'customization-api';
2
2
  import GridVideo from '../../components/GridVideo';
3
3
  import PinnedVideo from '../../components/PinnedVideo';
4
- import useCustomLayout from './CustomLayout';
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 {setActiveLayoutName} = useLayout();
27
- const layouts = useCustomLayout();
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
- setActiveLayoutName(pinnedLayoutName);
40
+ setLayout(pinnedLayoutName);
41
41
  };
42
42
  };
43
43
 
44
44
  export const useChangeDefaultLayout = () => {
45
- const {setActiveLayoutName} = useLayout();
46
- const layout = useCustomLayout();
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
- setActiveLayoutName((activeLayout: string) =>
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
- export const NameWithMicStatus = ({user}: {user: RenderInterface}) => {
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 {MaxVideoRenderer} from './VideoRenderer';
2
+ import VideoRenderer from './VideoRenderer';
3
3
  import {UidType} from '../../../agora-rn-uikit';
4
- import {
5
- renderComponentObjectInterface,
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: MaxVideoRenderer,
15
- screenshare: MaxVideoRenderer,
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} = useRenderContext();
22
- const FpeRenderComponent = useFpe((config) =>
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 {useFpe} from 'fpe-api';
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, isWeb} from '../../utils/common';
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 = useContext(RtcContext);
25
- const {meetingTitle, isHost} = useMeetingInfo();
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
- } = useFpe((data) => {
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
- // commented for v1 release
99
- // if (
100
- // data?.components?.videoCall.topBar &&
101
- // typeof data?.components?.videoCall.topBar !== 'object' &&
102
- // isValidReactComponent(data?.components?.videoCall.topBar)
103
- // ) {
104
- // components.TopbarComponent = data?.components?.videoCall.topBar;
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
- new Promise((res) =>
132
- rtc.RtcEngine.getDevices(function (devices: MediaDeviceInfo[]) {
133
- res(devices);
134
- }),
135
- ).then((devices: MediaDeviceInfo[]) => {
136
- SDKEvents.emit('join', meetingTitle, devices, isHost);
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
- {!isWeb && sidePanel === SidePanelType.Chat ? (
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 useCustomLayout from './CustomLayout';
2
+ import useLayoutsData from './useLayoutsData';
3
3
  import {isArray, isValidReactComponent} from '../../utils/common';
4
4
  import {useLayout} from '../../utils/useLayout';
5
- import {useRenderContext} from 'fpe-api';
5
+ import {useRender} from 'customization-api';
6
6
 
7
7
  const VideoComponent = () => {
8
8
  const [layout, setLayoutIndex] = useState(0);
9
- const fpeLayouts = useCustomLayout();
10
- const {activeLayoutName} = useLayout();
11
- const {renderPosition} = useRenderContext();
9
+ const layoutsData = useLayoutsData();
10
+ const {currentLayout} = useLayout();
11
+ const {activeUids} = useRender();
12
12
  useEffect(() => {
13
- if (isArray(fpeLayouts)) {
14
- let index = fpeLayouts.findIndex(
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
- }, [activeLayoutName]);
19
+ }, [currentLayout]);
22
20
 
23
21
  if (
24
- fpeLayouts &&
25
- fpeLayouts[layout] &&
26
- isValidReactComponent(fpeLayouts[layout].component)
22
+ layoutsData &&
23
+ layoutsData[layout] &&
24
+ isValidReactComponent(layoutsData[layout].component)
27
25
  ) {
28
- const CurrentLayout = fpeLayouts[layout].component;
29
- return <CurrentLayout renderData={renderPosition} />;
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 {NetworkQualityPill} from '../../subComponents/NetworkQualityPill';
9
- import {NameWithMicStatus} from './NameWithMicStatus';
8
+ import NetworkQualityPill from '../../subComponents/NetworkQualityPill';
9
+ import NameWithMicIcon from './NameWithMicIcon';
10
10
 
11
- interface MaxVideoRendererInterface {
11
+ interface VideoRendererProps {
12
12
  user: RenderInterface;
13
13
  }
14
- const MaxVideoRenderer: React.FC<MaxVideoRendererInterface> = ({user}) => {
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
- <NameWithMicStatus user={user} />
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 {MaxVideoRenderer};
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;