agora-appbuilder-core 3.0.9 → 3.0.10

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 (248) hide show
  1. package/Readme.md +6 -0
  2. package/package.json +2 -2
  3. package/template/_package-lock.json +5871 -4728
  4. package/template/agora-rn-uikit/src/Contexts/LocalUserContext.tsx +4 -0
  5. package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +18 -0
  6. package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +2 -0
  7. package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +30 -26
  8. package/template/agora-rn-uikit/src/Controls/Icons.ts +30 -83
  9. package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +6 -6
  10. package/template/agora-rn-uikit/src/Reducer/ActiveSpeakerDetected.ts +11 -0
  11. package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +1 -0
  12. package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +1 -0
  13. package/template/agora-rn-uikit/src/Reducer/LocalPermissionState.ts +24 -0
  14. package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +1 -0
  15. package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +1 -0
  16. package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +1 -0
  17. package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +2 -0
  18. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +1 -0
  19. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +1 -0
  20. package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +1 -0
  21. package/template/agora-rn-uikit/src/Reducer/UserPin.ts +11 -0
  22. package/template/agora-rn-uikit/src/Reducer/index.ts +3 -0
  23. package/template/agora-rn-uikit/src/Rtc/Create.tsx +89 -1
  24. package/template/agora-rn-uikit/src/RtcConfigure.tsx +39 -2
  25. package/template/agora-rn-uikit/src/Views/MaxVideoView.native.tsx +15 -5
  26. package/template/agora-rn-uikit/src/Views/MaxVideoView.tsx +15 -9
  27. package/template/agora-rn-uikit/src/index.ts +3 -1
  28. package/template/android/app/build.gradle +1 -0
  29. package/template/android/app/src/main/AndroidManifest.xml +22 -15
  30. package/template/android/app/src/main/assets/fonts/SourceSansPro-Regular.ttf +0 -0
  31. package/template/android/app/src/main/assets/fonts/icomoon.ttf +0 -0
  32. package/template/android/app/src/main/java/com/helloworld/MainActivity.java +50 -0
  33. package/template/android/app/src/main/res/values/colors.xml +7 -0
  34. package/template/android/build.gradle +3 -3
  35. package/template/babel.config.js +1 -0
  36. package/template/bridge/rtc/webNg/RtcEngine.ts +110 -17
  37. package/template/customization-api/sub-components.ts +1 -1
  38. package/template/customization-api/typeDefinition.ts +2 -1
  39. package/template/electron/index.html +27 -27
  40. package/template/electron/renderer/index.js +1 -0
  41. package/template/global.d.ts +25 -4
  42. package/template/index.rsdk.tsx +1 -0
  43. package/template/index.web.js +2 -1
  44. package/template/index.wsdk.tsx +1 -1
  45. package/template/ios/HelloWorld/Info.plist +14 -1
  46. package/template/ios/HelloWorld.xcodeproj/project.pbxproj +17 -0
  47. package/template/metro.config.js +1 -1
  48. package/template/package.json +18 -7
  49. package/template/react-native-toast-message/index.d.ts +43 -43
  50. package/template/react-native-toast-message/src/colors/index.js +3 -2
  51. package/template/react-native-toast-message/src/components/base/index.js +46 -59
  52. package/template/react-native-toast-message/src/components/base/styles.js +16 -32
  53. package/template/react-native-toast-message/src/components/checkbox.js +178 -0
  54. package/template/react-native-toast-message/src/components/error.js +3 -2
  55. package/template/react-native-toast-message/src/components/info.js +3 -2
  56. package/template/react-native-toast-message/src/components/success.js +3 -2
  57. package/template/react-native-toast-message/src/index.js +122 -31
  58. package/template/react-native-toast-message/src/index.sdk.tsx +125 -35
  59. package/template/react-native-toast-message/src/styles.js +3 -4
  60. package/template/react-native-toast-message/src/styles.sdk.ts +3 -4
  61. package/template/react-native.config.js +7 -0
  62. package/template/src/App.tsx +6 -0
  63. package/template/src/AppWrapper.tsx +63 -28
  64. package/template/src/assets/font-styles.css +329 -0
  65. package/template/src/assets/fonts/SourceSansPro-Regular.ttf +0 -0
  66. package/template/src/assets/fonts/icomoon.ttf +0 -0
  67. package/template/src/assets/permission.png +0 -0
  68. package/template/src/assets/selection.json +1 -0
  69. package/template/src/atoms/ActionMenu.tsx +236 -0
  70. package/template/src/atoms/AnimatedActiveSpeaker.native.tsx +71 -0
  71. package/template/src/atoms/AnimatedActiveSpeaker.tsx +84 -0
  72. package/template/src/atoms/AnimatedRings.native.tsx +68 -0
  73. package/template/src/atoms/AnimatedRings.tsx +70 -0
  74. package/template/src/atoms/Card.tsx +61 -0
  75. package/template/src/atoms/CircularProgress.native.tsx +121 -0
  76. package/template/src/atoms/CircularProgress.tsx +102 -0
  77. package/template/src/atoms/CustomIcon.tsx +88 -0
  78. package/template/src/atoms/CustomSwitch.tsx +287 -0
  79. package/template/src/atoms/Dropdown.tsx +306 -0
  80. package/template/src/atoms/HorizontalRule.tsx +3 -1
  81. package/template/src/atoms/IconButton.tsx +162 -0
  82. package/template/src/atoms/ImageIcon.tsx +98 -0
  83. package/template/src/atoms/InfoBubble.tsx +291 -0
  84. package/template/src/atoms/Input.tsx +87 -0
  85. package/template/src/atoms/InviteInfo.tsx +166 -0
  86. package/template/src/atoms/LinkButton.tsx +28 -0
  87. package/template/src/atoms/OutlineButton.tsx +61 -0
  88. package/template/src/atoms/ParticipantsCount.tsx +73 -0
  89. package/template/src/atoms/Popup.tsx +147 -0
  90. package/template/src/atoms/PrimaryButton.tsx +51 -26
  91. package/template/src/atoms/RecordingInfo.tsx +49 -0
  92. package/template/src/atoms/SecondaryButton.tsx +8 -5
  93. package/template/src/atoms/Spacer.tsx +22 -0
  94. package/template/src/atoms/TertiaryButton.tsx +78 -0
  95. package/template/src/atoms/TextInput.tsx +12 -14
  96. package/template/src/atoms/Toggle.tsx +47 -0
  97. package/template/src/atoms/Tooltip.native.tsx +65 -0
  98. package/template/src/atoms/Tooltip.tsx +94 -0
  99. package/template/src/atoms/UserAvatar.tsx +60 -0
  100. package/template/src/components/Chat.tsx +86 -214
  101. package/template/src/components/ChatContext.ts +8 -1
  102. package/template/src/components/ColorConfigure.tsx +1 -1
  103. package/template/src/components/ColorContext.ts +1 -1
  104. package/template/src/components/CommonStyles.ts +44 -0
  105. package/template/src/components/Controls.tsx +342 -42
  106. package/template/src/components/{Controls.native.tsx → Controls1.native.tsx} +6 -4
  107. package/template/src/components/DeviceConfigure.tsx +461 -101
  108. package/template/src/components/DeviceContext.tsx +8 -4
  109. package/template/src/components/EventsConfigure.tsx +144 -7
  110. package/template/src/components/GraphQLProvider.tsx +1 -1
  111. package/template/src/components/GridVideo.tsx +59 -44
  112. package/template/src/components/HostControlView.tsx +114 -35
  113. package/template/src/components/Navbar.tsx +216 -398
  114. package/template/src/components/NetworkQualityContext.tsx +20 -20
  115. package/template/src/components/ParticipantsView.tsx +177 -154
  116. package/template/src/components/PinnedVideo.tsx +207 -120
  117. package/template/src/components/Precall.native.tsx +358 -119
  118. package/template/src/components/Precall.tsx +269 -135
  119. package/template/src/components/RTMConfigure.tsx +27 -4
  120. package/template/src/components/Router.electron.ts +1 -0
  121. package/template/src/components/Router.native.ts +1 -0
  122. package/template/src/components/Router.sdk.ts +1 -0
  123. package/template/src/components/Router.ts +1 -0
  124. package/template/src/components/Settings.tsx +26 -95
  125. package/template/src/components/SettingsView.tsx +251 -56
  126. package/template/src/components/Share.tsx +302 -273
  127. package/template/src/components/StorageContext.tsx +30 -3
  128. package/template/src/components/ToastComponent.tsx +8 -0
  129. package/template/src/components/chat-messages/useChatMessages.tsx +69 -23
  130. package/template/src/components/chat-ui/useChatUIControl.tsx +7 -0
  131. package/template/src/components/common/Error.tsx +20 -6
  132. package/template/src/components/common/Logo.tsx +16 -15
  133. package/template/src/components/contexts/LiveStreamDataContext.tsx +10 -5
  134. package/template/src/components/contexts/VideoMeetingDataContext.tsx +37 -7
  135. package/template/src/components/livestream/LiveStreamContext.tsx +270 -36
  136. package/template/src/components/livestream/Types.ts +39 -14
  137. package/template/src/components/livestream/index.ts +1 -0
  138. package/template/src/components/livestream/views/LiveStreamControls.tsx +12 -4
  139. package/template/src/components/participants/AllAudienceParticipants.tsx +101 -30
  140. package/template/src/components/participants/AllHostParticipants.tsx +103 -34
  141. package/template/src/components/participants/Participant.tsx +302 -0
  142. package/template/src/components/participants/ParticipantName.tsx +13 -7
  143. package/template/src/components/participants/ParticipantSectionTitle.tsx +35 -10
  144. package/template/src/components/participants/ScreenshareParticipants.tsx +144 -12
  145. package/template/src/components/participants/UserActionMenuOptions.tsx +398 -0
  146. package/template/src/components/popups/InvitePopup.tsx +115 -0
  147. package/template/src/components/popups/StopRecordingPopup.tsx +114 -0
  148. package/template/src/components/precall/LocalMute.tsx +84 -14
  149. package/template/src/components/precall/{LocalMute.native.tsx → LocalMute1.native.tsx} +21 -5
  150. package/template/src/components/precall/PermissionHelper.native.tsx +5 -0
  151. package/template/src/components/precall/PermissionHelper.tsx +126 -0
  152. package/template/src/components/precall/PreCallSettings.tsx +52 -0
  153. package/template/src/components/precall/VideoPreview.native.tsx +48 -3
  154. package/template/src/components/precall/VideoPreview.tsx +163 -7
  155. package/template/src/components/precall/joinCallBtn.tsx +15 -2
  156. package/template/src/components/precall/meetingTitle.tsx +15 -12
  157. package/template/src/components/precall/selectDevice.tsx +1 -21
  158. package/template/src/components/precall/textInput.tsx +32 -4
  159. package/template/src/components/precall/usePreCall.tsx +16 -0
  160. package/template/src/components/styles.ts +42 -21
  161. package/template/src/components/useShareLink.tsx +12 -14
  162. package/template/src/components/useToast.tsx +41 -0
  163. package/template/src/components/useVideoCall.tsx +65 -0
  164. package/template/src/language/default-labels/precallScreenLabels.ts +3 -3
  165. package/template/src/pages/Authenticate.tsx +5 -15
  166. package/template/src/pages/Create.tsx +293 -165
  167. package/template/src/pages/Endcall.tsx +148 -0
  168. package/template/src/pages/Join.tsx +93 -67
  169. package/template/src/pages/VideoCall.tsx +89 -64
  170. package/template/src/pages/video-call/ActionSheet.native.tsx +215 -0
  171. package/template/src/pages/video-call/ActionSheet.tsx +226 -0
  172. package/template/src/pages/video-call/ActionSheetContent.tsx +479 -0
  173. package/template/src/pages/video-call/ActionSheetHandle.tsx +38 -0
  174. package/template/src/pages/video-call/ActionSheetStyles.css +138 -0
  175. package/template/src/pages/video-call/DefaultLayouts.ts +4 -4
  176. package/template/src/pages/video-call/NameWithMicIcon.tsx +120 -44
  177. package/template/src/pages/video-call/RenderComponent.tsx +3 -2
  178. package/template/src/pages/video-call/SidePanelHeader.tsx +190 -0
  179. package/template/src/pages/video-call/VideoCallMobileView.tsx +139 -0
  180. package/template/src/pages/video-call/VideoCallScreen.native.tsx +37 -0
  181. package/template/src/pages/video-call/VideoCallScreen.tsx +45 -9
  182. package/template/src/pages/video-call/VideoComponent.tsx +18 -3
  183. package/template/src/pages/video-call/VideoRenderer.tsx +218 -60
  184. package/template/src/rtm-events/constants.ts +2 -0
  185. package/template/src/subComponents/ChatBubble.tsx +123 -83
  186. package/template/src/subComponents/ChatContainer.tsx +257 -84
  187. package/template/src/subComponents/ChatInput.ios.tsx +237 -0
  188. package/template/src/subComponents/ChatInput.tsx +61 -46
  189. package/template/src/subComponents/Checkbox.native.tsx +16 -5
  190. package/template/src/subComponents/Checkbox.tsx +2 -2
  191. package/template/src/subComponents/CopyJoinInfo.tsx +36 -58
  192. package/template/src/subComponents/EndcallPopup.tsx +107 -0
  193. package/template/src/subComponents/FallbackLogo.tsx +122 -40
  194. package/template/src/subComponents/LanguageSelector.tsx +1 -1
  195. package/template/src/subComponents/LayoutIconButton.tsx +201 -0
  196. package/template/src/subComponents/LayoutIconDropdown.tsx +131 -134
  197. package/template/src/subComponents/{LayoutIconDropdown.native.tsx → LayoutIconDropdown1.native.tsx} +4 -18
  198. package/template/src/subComponents/LocalAudioMute.tsx +119 -27
  199. package/template/src/subComponents/LocalEndCall.tsx +71 -33
  200. package/template/src/subComponents/LocalSwitchCamera.tsx +17 -30
  201. package/template/src/subComponents/LocalVideoMute.tsx +117 -27
  202. package/template/src/subComponents/Logo.tsx +3 -4
  203. package/template/src/subComponents/LogoutButton.tsx +1 -1
  204. package/template/src/subComponents/NetworkQualityPill.tsx +60 -63
  205. package/template/src/subComponents/OpenInNativeButton.tsx +3 -3
  206. package/template/src/subComponents/Recording.tsx +28 -29
  207. package/template/src/subComponents/RemoteAudioMute.tsx +83 -29
  208. package/template/src/subComponents/RemoteEndCall.tsx +8 -5
  209. package/template/src/subComponents/RemoteMutePopup.tsx +193 -0
  210. package/template/src/subComponents/RemoteVideoMute.tsx +74 -21
  211. package/template/src/subComponents/RemoveMeetingPopup.tsx +109 -0
  212. package/template/src/subComponents/RemoveScreensharePopup.tsx +109 -0
  213. package/template/src/subComponents/ScreenShareNotice.tsx +83 -8
  214. package/template/src/subComponents/SelectDevice.tsx +404 -61
  215. package/template/src/subComponents/SelectDeviceSettings.backup.tsx +207 -0
  216. package/template/src/subComponents/SelectOAuth.tsx +9 -8
  217. package/template/src/subComponents/SidePanelHeader.tsx +112 -0
  218. package/template/src/subComponents/ToastConfig.tsx +150 -10
  219. package/template/src/subComponents/chat/ChatParticipants.tsx +187 -78
  220. package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +95 -32
  221. package/template/src/subComponents/livestream/controls/LocalRaiseHand.tsx +29 -33
  222. package/template/src/subComponents/livestream/controls/RemoteLiveStreamApprovedRequestRecall.tsx +6 -6
  223. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestApprove.tsx +24 -11
  224. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestReject.tsx +17 -10
  225. package/template/src/subComponents/recording/useRecording.tsx +79 -27
  226. package/template/src/subComponents/screenshare/ScreenshareButton.tsx +52 -70
  227. package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +11 -2
  228. package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +26 -4
  229. package/template/src/theme/index.ts +46 -0
  230. package/template/src/utils/PlatformWrapper.tsx +21 -0
  231. package/template/src/utils/common.tsx +155 -1
  232. package/template/src/utils/hexadecimalTransparency.ts +108 -0
  233. package/template/src/utils/index.tsx +19 -0
  234. package/template/src/utils/isMobileOrTablet.ts +7 -2
  235. package/template/src/utils/pendingStateUpdateHelper.ts +19 -0
  236. package/template/src/utils/useButtonTemplate.tsx +1 -0
  237. package/template/src/utils/useFocus.tsx +46 -0
  238. package/template/src/utils/useIsActiveSpeaker.ts +27 -0
  239. package/template/src/utils/useIsHandRaised.ts +13 -0
  240. package/template/src/utils/useMuteToggleLocal.ts +54 -3
  241. package/template/src/utils/useRemoteEndScreenshare.ts +26 -0
  242. package/template/src/utils/useRemoteRequest.ts +84 -0
  243. package/template/web/index.html +5 -0
  244. package/template/webpack.commons.js +13 -8
  245. package/template/webpack.web.config.js +1 -0
  246. package/template/src/assets/icons.ts +0 -102
  247. package/template/src/components/participants/MeParticipant.tsx +0 -38
  248. package/template/src/components/participants/RemoteParticipants.tsx +0 -71
@@ -23,6 +23,8 @@ import AgoraRTC, {
23
23
  EncryptionMode,
24
24
  ILocalTrack,
25
25
  ClientRoleOptions,
26
+ CameraVideoTrackInitConfig,
27
+ MicrophoneAudioTrackInitConfig,
26
28
  } from 'agora-rtc-sdk-ng';
27
29
  import type {
28
30
  RtcEngineEvents,
@@ -46,9 +48,12 @@ type callbackType = (uid?: UID) => void;
46
48
  declare global {
47
49
  interface Window {
48
50
  engine: RtcEngine;
51
+ AgoraRTC: typeof AgoraRTC;
49
52
  }
50
53
  }
51
54
 
55
+ window.AgoraRTC = AgoraRTC;
56
+
52
57
  export enum AREAS {
53
58
  /**
54
59
  * China.
@@ -166,6 +171,7 @@ if ($config.LOG_ENABLED) {
166
171
  }
167
172
 
168
173
  export default class RtcEngine {
174
+ private activeSpeakerUid: number;
169
175
  public appId: string;
170
176
  // public AgoraRTC: any;
171
177
  public client: any | IAgoraRTCClient;
@@ -178,6 +184,7 @@ export default class RtcEngine {
178
184
  ['RemoteAudioStateChanged', () => null],
179
185
  ['RemoteVideoStateChanged', () => null],
180
186
  ['NetworkQuality', () => null],
187
+ ['ActiveSpeaker', () => null],
181
188
  ]);
182
189
  public localStream: LocalStream = {};
183
190
  public screenStream: ScreenStream = {};
@@ -185,15 +192,16 @@ export default class RtcEngine {
185
192
  private inScreenshare: Boolean = false;
186
193
  private videoProfile: VideoProfile = '480p_9';
187
194
  private isPublished = false;
188
- private isAudioEnabled = true;
189
- private isVideoEnabled = true;
195
+ private isAudioEnabled = false;
196
+ private isVideoEnabled = false;
190
197
  private isAudioPublished = false;
191
198
  private isVideoPublished = false;
192
199
  private isJoined = false;
193
- private deviceId = '';
200
+ private videoDeviceId = undefined;
201
+ private audioDeviceId = undefined;
194
202
  private muteLocalVideoMutex = false;
195
203
  private muteLocalAudioMutex = false;
196
-
204
+ private speakerDeviceId = '';
197
205
  // Create channel profile and set it here
198
206
 
199
207
  // Create channel profile and set it here
@@ -214,9 +222,17 @@ export default class RtcEngine {
214
222
  }
215
223
 
216
224
  async enableAudio(): Promise<void> {
225
+ const audioConfig: MicrophoneAudioTrackInitConfig = {
226
+ bypassWebAudio: Platform.OS == 'web' && isMobileOrTablet(),
227
+ // microphoneId: this.audioDeviceId,
228
+ };
217
229
  try {
218
- let localAudio = await AgoraRTC.createMicrophoneAudioTrack({});
230
+ let localAudio = await AgoraRTC.createMicrophoneAudioTrack(audioConfig);
219
231
  this.localStream.audio = localAudio;
232
+ this.audioDeviceId = localAudio
233
+ ?.getMediaStreamTrack()
234
+ .getSettings().deviceId;
235
+ this.isAudioEnabled = true;
220
236
  } catch (e) {
221
237
  let audioError = e;
222
238
  e.status = {audioError};
@@ -234,15 +250,30 @@ export default class RtcEngine {
234
250
  * The Web SDK directly publishes the local audio stream without processing it through WebAudio.
235
251
  */
236
252
 
237
- const audioConfig =
238
- Platform.OS == 'web' && isMobileOrTablet() ? {bypassWebAudio: true} : {};
253
+ const audioConfig: MicrophoneAudioTrackInitConfig = {
254
+ bypassWebAudio: Platform.OS == 'web' && isMobileOrTablet(),
255
+ // microphoneId: this.audioDeviceId,
256
+ };
257
+ const videoConfig: CameraVideoTrackInitConfig = {
258
+ encoderConfig: this.videoProfile,
259
+ // cameraId: this.videoDeviceId,
260
+ };
239
261
  try {
240
262
  let [localAudio, localVideo] =
241
- await AgoraRTC.createMicrophoneAndCameraTracks(audioConfig, {
242
- encoderConfig: this.videoProfile,
243
- });
263
+ await AgoraRTC.createMicrophoneAndCameraTracks(
264
+ audioConfig,
265
+ videoConfig,
266
+ );
244
267
  this.localStream.audio = localAudio;
245
268
  this.localStream.video = localVideo;
269
+ this.audioDeviceId = localAudio
270
+ ?.getMediaStreamTrack()
271
+ .getSettings().deviceId;
272
+ this.videoDeviceId = localVideo
273
+ ?.getMediaStreamTrack()
274
+ .getSettings().deviceId;
275
+ this.isVideoEnabled = true;
276
+ this.isAudioEnabled = true;
246
277
  } catch (e) {
247
278
  let audioError = false;
248
279
  let videoError = false;
@@ -250,14 +281,20 @@ export default class RtcEngine {
250
281
  let localAudio = await AgoraRTC.createMicrophoneAudioTrack(audioConfig);
251
282
 
252
283
  this.localStream.audio = localAudio;
284
+ this.audioDeviceId = localAudio
285
+ ?.getMediaStreamTrack()
286
+ .getSettings().deviceId;
287
+ this.isAudioEnabled = true;
253
288
  } catch (error) {
254
289
  audioError = error;
255
290
  }
256
291
  try {
257
- let localVideo = await AgoraRTC.createCameraVideoTrack({
258
- encoderConfig: this.videoProfile,
259
- });
292
+ let localVideo = await AgoraRTC.createCameraVideoTrack(videoConfig);
260
293
  this.localStream.video = localVideo;
294
+ this.videoDeviceId = localVideo
295
+ ?.getMediaStreamTrack()
296
+ .getSettings().deviceId;
297
+ this.isVideoEnabled = true;
261
298
  } catch (error) {
262
299
  videoError = error;
263
300
  }
@@ -271,6 +308,11 @@ export default class RtcEngine {
271
308
  }
272
309
  }
273
310
 
311
+ async enableAudioVolumeIndication(interval, smooth, isLocal) {
312
+ AgoraRTC.setParameter('AUDIO_VOLUME_INDICATION_INTERVAL', interval);
313
+ this.client.enableAudioVolumeIndicator();
314
+ }
315
+
274
316
  async publish() {
275
317
  if (this.localStream.audio || this.localStream.video) {
276
318
  try {
@@ -360,6 +402,12 @@ export default class RtcEngine {
360
402
  ...this.remoteStreams.get(user.uid),
361
403
  audio: audioTrack,
362
404
  });
405
+ if (this.speakerDeviceId) {
406
+ // setting sepeaker for all remote stream (newly joining user)
407
+ this.remoteStreams
408
+ .get(user.uid)
409
+ ?.audio?.setPlaybackDevice(this.speakerDeviceId);
410
+ }
363
411
  (this.eventsMap.get('RemoteAudioStateChanged') as callbackType)(
364
412
  user.uid,
365
413
  2,
@@ -404,6 +452,36 @@ export default class RtcEngine {
404
452
  }
405
453
  });
406
454
 
455
+ this.client.on('volume-indicator', (volumes) => {
456
+ const highestvolumeObj = volumes.reduce(
457
+ (highestVolume, volume, index) => {
458
+ if (highestVolume === null) {
459
+ return volume;
460
+ } else {
461
+ if (volume.level > highestVolume.level) {
462
+ return volume;
463
+ }
464
+ return highestVolume;
465
+ }
466
+ // console.log(`${index} UID ${volume.uid} Level ${volume.level}`);
467
+ },
468
+ null,
469
+ );
470
+ const activeSpeakerUid =
471
+ highestvolumeObj && highestvolumeObj?.level > 0 && highestvolumeObj?.uid
472
+ ? highestvolumeObj.uid
473
+ : undefined;
474
+
475
+ //To avoid infinite calling dispatch checking if condition.
476
+ if (this.activeSpeakerUid !== activeSpeakerUid) {
477
+ const activeSpeakerCallBack = this.eventsMap.get(
478
+ 'ActiveSpeaker',
479
+ ) as callbackType;
480
+ activeSpeakerCallBack(activeSpeakerUid);
481
+ this.activeSpeakerUid = activeSpeakerUid;
482
+ }
483
+ });
484
+
407
485
  // this.client.on('stream-fallback', (evt))
408
486
  this.client.on('stream-type-changed', function (uid, streamType) {
409
487
  console.log('[fallback]: ', uid, streamType);
@@ -468,7 +546,8 @@ export default class RtcEngine {
468
546
  event === 'ScreenshareStopped' ||
469
547
  event === 'RemoteAudioStateChanged' ||
470
548
  event === 'RemoteVideoStateChanged' ||
471
- event === 'NetworkQuality'
549
+ event === 'NetworkQuality' ||
550
+ event === 'ActiveSpeaker'
472
551
  ) {
473
552
  this.eventsMap.set(event, listener as callbackType);
474
553
  }
@@ -616,7 +695,7 @@ export default class RtcEngine {
616
695
  async changeCamera(cameraId, callback, error): Promise<void> {
617
696
  try {
618
697
  await this.localStream.video?.setDevice(cameraId);
619
- this.deviceId = cameraId;
698
+ this.videoDeviceId = cameraId;
620
699
  callback(cameraId);
621
700
  } catch (e) {
622
701
  error(e);
@@ -628,9 +707,9 @@ export default class RtcEngine {
628
707
  const devices = await AgoraRTC.getDevices(true);
629
708
  for (let i = 0; i < devices.length; i++) {
630
709
  let d = devices[i];
631
- if (d.kind === 'videoinput' && d.deviceId !== this.deviceId) {
710
+ if (d.kind === 'videoinput' && d.deviceId !== this.videoDeviceId) {
632
711
  await this.localStream.video?.setDevice(d.deviceId);
633
- this.deviceId = d.deviceId;
712
+ this.videoDeviceId = d.deviceId;
634
713
  break;
635
714
  }
636
715
  }
@@ -642,12 +721,26 @@ export default class RtcEngine {
642
721
  async changeMic(micId, callback, error) {
643
722
  try {
644
723
  await this.localStream.audio?.setDevice(micId);
724
+ this.audioDeviceId = micId;
645
725
  callback(micId);
646
726
  } catch (e) {
647
727
  error(e);
648
728
  }
649
729
  }
650
730
 
731
+ async changeSpeaker(speakerId, callback, error) {
732
+ try {
733
+ this.speakerDeviceId = speakerId;
734
+ // setting sepeaker for all remote stream (previously joined users)
735
+ this.remoteStreams?.forEach((stream, uid, map) => {
736
+ stream?.audio?.setPlaybackDevice(speakerId);
737
+ });
738
+ callback(speakerId);
739
+ } catch (e) {
740
+ error(e);
741
+ }
742
+ }
743
+
651
744
  async enableDualStreamMode(enable: boolean) {
652
745
  return this.client[enable ? 'enableDualStream' : 'disableDualStream']();
653
746
  // enable
@@ -4,7 +4,7 @@ export {default as PrimaryButton} from '../src/atoms/PrimaryButton';
4
4
  export {default as SecondaryButton} from '../src/atoms/SecondaryButton';
5
5
  export {default as TextInput} from '../src/atoms/TextInput';
6
6
  //Icons
7
- export {default as icons} from '../src/assets/icons';
7
+ export {Icons} from '../agora-rn-uikit';
8
8
 
9
9
  // commented for v1 release
10
10
  //create screen
@@ -18,7 +18,7 @@ import {
18
18
  UidType,
19
19
  } from '../agora-rn-uikit';
20
20
  import {I18nInterface} from '../src/language/i18nTypes';
21
- import {IconsInterface} from '../agora-rn-uikit/src/Controls/Icons';
21
+ import {IconsInterface} from '../src/atoms/CustomIcon';
22
22
  export type {RenderInterface, RenderStateInterface, UidType};
23
23
  export type {
24
24
  ChatTextInputProps,
@@ -56,6 +56,7 @@ export interface ChatCmpInterface {
56
56
 
57
57
  export interface renderComponentInterface {
58
58
  user: RenderInterface;
59
+ isMax?: boolean;
59
60
  }
60
61
 
61
62
  export interface renderComponentObjectInterface {
@@ -1,29 +1,29 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
-
7
- <base href="./">
8
- <title><%= htmlWebpackPlugin.options.title %></title>
9
- </head>
10
- <body>
11
- <style>
12
- .video-container > *{
13
- background-color: #000 !important;
14
-
15
- }
16
- .video-container video{
17
- background-color: #000;
18
- }
19
- .video-container{
20
- background-color: #000;
21
- }
22
- </style>
23
- <div id="react-app" style="
24
- height: 100vh;
25
- display: flex;
26
- ">
27
- </div>
28
- </body>
29
- </html>
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
7
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
8
+ <link
9
+ href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap"
10
+ rel="stylesheet"
11
+ />
12
+ <base href="./" />
13
+ <title><%= htmlWebpackPlugin.options.title %></title>
14
+ </head>
15
+ <body>
16
+ <style>
17
+ .video-container > * {
18
+ background-color: #000 !important;
19
+ }
20
+ .video-container video {
21
+ background-color: #000;
22
+ }
23
+ .video-container {
24
+ background-color: #000;
25
+ }
26
+ </style>
27
+ <div id="react-app" style="height: 100vh; display: flex"></div>
28
+ </body>
29
+ </html>
@@ -1,5 +1,6 @@
1
1
  import Video from '../../src/App';
2
2
  import {AppRegistry} from 'react-native';
3
+ import '../../src/assets/font-styles.css';
3
4
  // import React from 'react';
4
5
 
5
6
  // const Video = () => <div>Hello </div>;
@@ -47,7 +47,6 @@ interface ConfigInterface {
47
47
  APP_NAME: string;
48
48
  LOGO: string;
49
49
  APP_ID: string;
50
- PRIMARY_COLOR: string;
51
50
  FRONTEND_ENDPOINT: string;
52
51
  BACKEND_ENDPOINT: string;
53
52
  PSTN: boolean;
@@ -57,11 +56,8 @@ interface ConfigInterface {
57
56
  SCREEN_SHARING: boolean;
58
57
  CLIENT_ID: string;
59
58
  LANDING_SUB_HEADING: string;
60
- BG: string;
61
59
  ENCRYPTION_ENABLED: boolean;
62
60
  PROFILE: VideoProfile;
63
- PRIMARY_FONT_COLOR: string;
64
- SECONDARY_FONT_COLOR: string;
65
61
  SENTRY_DSN: string;
66
62
  ENABLE_GOOGLE_OAUTH: boolean;
67
63
  ENABLE_SLACK_OAUTH: boolean;
@@ -76,6 +72,31 @@ interface ConfigInterface {
76
72
  GEO_FENCING: boolean;
77
73
  LOG_ENABLED: boolean;
78
74
  AUDIO_ROOM: boolean;
75
+ PRIMARY_ACTION_BRAND_COLOR: string;
76
+ PRIMARY_ACTION_TEXT_COLOR: string;
77
+ SECONDARY_ACTION_COLOR: string;
78
+ FONT_COLOR: string;
79
+ BG: string;
80
+ BACKGROUND_COLOR: string;
81
+ VIDEO_AUDIO_TILE_COLOR: string;
82
+ VIDEO_AUDIO_TILE_OVERLAY_COLOR: string;
83
+ VIDEO_AUDIO_TILE_TEXT_COLOR: string;
84
+ VIDEO_AUDIO_TILE_AVATAR_COLOR: string;
85
+ SEMANTIC_ERROR: string;
86
+ SEMANTIC_SUCCESS: string;
87
+ SEMANTIC_WARNING: string;
88
+ SEMANTIC_NEUTRAL: string;
89
+ INPUT_FIELD_BACKGROUND_COLOR: string;
90
+ INPUT_FIELD_BORDER_COLOR: string;
91
+ CARD_LAYER_1_COLOR: string;
92
+ CARD_LAYER_2_COLOR: string;
93
+ CARD_LAYER_3_COLOR: string;
94
+ CARD_LAYER_4_COLOR: string;
95
+ CARD_LAYER_5_COLOR: string;
96
+ HARD_CODED_BLACK_COLOR: string;
97
+ ICON_TEXT: boolean;
98
+ ICON_BG_COLOR: string;
99
+ TOOLBAR_COLOR: string;
79
100
  }
80
101
  declare var $config: ConfigInterface;
81
102
  declare module 'customization' {
@@ -18,6 +18,7 @@ import SDKAppWrapper, {
18
18
  } from './src/SDKAppWrapper';
19
19
  import React from 'react';
20
20
  import * as RN from 'react-native-web';
21
+ import './src/assets/font-styles.css';
21
22
 
22
23
  export * from 'customization-api';
23
24
  export * from 'customization-implementation';
@@ -9,9 +9,10 @@
9
9
  information visit https://appbuilder.agora.io.
10
10
  *********************************************
11
11
  */
12
- import {AppRegistry} from 'react-native';
12
+ import { AppRegistry } from 'react-native';
13
13
  import * as Sentry from '@sentry/browser';
14
14
  import Video from './src/App';
15
+ import './src/assets/font-styles.css'
15
16
 
16
17
  Sentry.init({
17
18
  dsn: 'https://b5df0450fe284baa8376e62ace331580@o615358.ingest.sentry.io/5749898',
@@ -6,7 +6,7 @@ import SDKAppWrapper, {
6
6
  import SDKEvents from './src/utils/SdkEvents';
7
7
  import React from 'react';
8
8
  import * as RN from 'react-native-web';
9
-
9
+ import './src/assets/font-styles.css';
10
10
  export * from 'customization-api';
11
11
  export * from 'customization-implementation';
12
12
 
@@ -53,9 +53,18 @@
53
53
  <key>NSCameraUsageDescription</key>
54
54
  <string>Camera access</string>
55
55
  <key>NSLocationWhenInUseUsageDescription</key>
56
- <string></string>
56
+ <string/>
57
57
  <key>NSMicrophoneUsageDescription</key>
58
58
  <string>Mic access</string>
59
+ <key>UIAppFonts</key>
60
+ <array>
61
+ <string>SourceSansPro-Regular.ttf</string>
62
+ <string>icomoon.ttf</string>
63
+ </array>
64
+ <key>UIBackgroundModes</key>
65
+ <array>
66
+ <string>audio</string>
67
+ </array>
59
68
  <key>UILaunchStoryboardName</key>
60
69
  <string>LaunchScreen</string>
61
70
  <key>UIRequiredDeviceCapabilities</key>
@@ -65,8 +74,12 @@
65
74
  <key>UISupportedInterfaceOrientations</key>
66
75
  <array>
67
76
  <string>UIInterfaceOrientationPortrait</string>
77
+ </array>
78
+ <key>UISupportedInterfaceOrientations~ipad</key>
79
+ <array>
68
80
  <string>UIInterfaceOrientationLandscapeLeft</string>
69
81
  <string>UIInterfaceOrientationLandscapeRight</string>
82
+ <string>UIInterfaceOrientationPortrait</string>
70
83
  </array>
71
84
  <key>UIViewControllerBasedStatusBarAppearance</key>
72
85
  <false/>
@@ -18,6 +18,8 @@
18
18
  65580BB1266EDC8000B310B6 /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65580BB0266EDC8000B310B6 /* File.swift */; };
19
19
  65580BB3266EDD6300B310B6 /* HelloWorld.entitlements in Resources */ = {isa = PBXBuildFile; fileRef = 65580BB2266EDCA400B310B6 /* HelloWorld.entitlements */; };
20
20
  81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
21
+ 49B7B61E43464F098E87335F /* icomoon.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FF34150ABA37458FB48221FB /* icomoon.ttf */; };
22
+ 76624C45E19C435BACC727C7 /* SourceSansPro-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = E72FF36D2A984B10BA9C6F91 /* SourceSansPro-Regular.ttf */; };
21
23
  /* End PBXBuildFile section */
22
24
 
23
25
  /* Begin PBXContainerItemProxy section */
@@ -56,6 +58,8 @@
56
58
  81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = HelloWorld/LaunchScreen.storyboard; sourceTree = "<group>"; };
57
59
  ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
58
60
  ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; };
61
+ FF34150ABA37458FB48221FB /* icomoon.ttf */ = {isa = PBXFileReference; name = "icomoon.ttf"; path = "../src/assets/fonts/icomoon.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
62
+ E72FF36D2A984B10BA9C6F91 /* SourceSansPro-Regular.ttf */ = {isa = PBXFileReference; name = "SourceSansPro-Regular.ttf"; path = "../src/assets/fonts/SourceSansPro-Regular.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
59
63
  /* End PBXFileReference section */
60
64
 
61
65
  /* Begin PBXFrameworksBuildPhase section */
@@ -148,6 +152,7 @@
148
152
  00E356EF1AD99517003FC87E /* HelloWorldTests */,
149
153
  83CBBA001A601CBA00E9B192 /* Products */,
150
154
  2D16E6871FA4F8E400B85C8A /* Frameworks */,
155
+ A87D6475B3A64BB58397D417 /* Resources */,
151
156
  );
152
157
  indentWidth = 2;
153
158
  sourceTree = "<group>";
@@ -165,6 +170,16 @@
165
170
  name = Products;
166
171
  sourceTree = "<group>";
167
172
  };
173
+ A87D6475B3A64BB58397D417 /* Resources */ = {
174
+ isa = "PBXGroup";
175
+ children = (
176
+ FF34150ABA37458FB48221FB /* icomoon.ttf */,
177
+ E72FF36D2A984B10BA9C6F91 /* SourceSansPro-Regular.ttf */,
178
+ );
179
+ name = Resources;
180
+ sourceTree = "<group>";
181
+ path = "";
182
+ };
168
183
  /* End PBXGroup section */
169
184
 
170
185
  /* Begin PBXNativeTarget section */
@@ -304,6 +319,8 @@
304
319
  65580BB3266EDD6300B310B6 /* HelloWorld.entitlements in Resources */,
305
320
  81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
306
321
  13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
322
+ 49B7B61E43464F098E87335F /* icomoon.ttf in Resources */,
323
+ 76624C45E19C435BACC727C7 /* SourceSansPro-Regular.ttf in Resources */,
307
324
  );
308
325
  runOnlyForDeploymentPostprocessing = 0;
309
326
  };
@@ -16,7 +16,7 @@
16
16
  * @format
17
17
  */
18
18
 
19
- const blacklist = require('metro-config/src/defaults/blacklist');
19
+ const blacklist = require('metro-config/src/defaults/exclusionList');
20
20
 
21
21
  // blacklist is a function that takes an array of regexes and combines
22
22
  // them with the default blacklist to return a single regex.
@@ -49,13 +49,15 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@apollo/client": "3.3.20",
52
- "@react-native-community/async-storage": "1.12.1",
52
+ "@gorhom/bottom-sheet": "4.4.5",
53
+ "@react-native-async-storage/async-storage": "1.17.11",
53
54
  "@react-native-community/checkbox": "0.4.2",
54
55
  "@react-native-community/clipboard": "1.5.1",
55
56
  "@sentry/react": "6.5.1",
56
57
  "@sentry/react-native": "2.4.3",
57
58
  "@sentry/tracing": "6.2.1",
58
- "agora-react-native-rtm": "1.5.0",
59
+ "@supersami/rn-foreground-service": "^1.1.1",
60
+ "agora-react-native-rtm": "1.5.1",
59
61
  "agora-rtc-sdk-ng": "4.14.0",
60
62
  "agora-rtm-sdk": "1.4.3-203",
61
63
  "electron-log": "4.3.5",
@@ -66,19 +68,26 @@
66
68
  "nanoevents": "7.0.1",
67
69
  "nanoid": "4.0.0",
68
70
  "nosleep.js": "0.12.0",
69
- "react": "16.13.1",
70
- "react-dom": "16.13.1",
71
+ "react": "17.0.1",
72
+ "react-dom": "17.0.1",
71
73
  "react-is": "18.0.0",
72
- "react-native": "0.63.5",
74
+ "react-native": "0.64",
73
75
  "react-native-agora": "3.7.1",
76
+ "react-native-gesture-handler": "2.8.0",
74
77
  "react-native-hyperlink": "0.0.19",
75
78
  "react-native-inappbrowser-reborn": "3.5.1",
76
79
  "react-native-keep-awake": "4.0.0",
77
80
  "react-native-keyboard-manager": "6.5.4-1",
81
+ "react-native-reanimated": "2.12.0",
78
82
  "react-native-responsive-fontsize": "0.5.1",
83
+ "react-native-svg": "13.6.0",
84
+ "react-native-vector-icons": "9.2.0",
85
+ "react-native-walkthrough-tooltip": "1.4.0",
79
86
  "react-native-web": "0.14.13",
80
87
  "react-router-dom": "5.2.0",
81
- "react-router-native": "5.2.0"
88
+ "react-router-native": "5.2.0",
89
+ "react-spring-bottom-sheet": "3.4.1",
90
+ "react-tooltip": "4.5.1"
82
91
  },
83
92
  "devDependencies": {
84
93
  "@babel/core": "7.14.3",
@@ -107,6 +116,7 @@
107
116
  "babel-plugin-module-resolver": "4.1.0",
108
117
  "babel-plugin-transform-define": "2.0.1",
109
118
  "cross-env": "7.0.3",
119
+ "css-loader": "6.7.2",
110
120
  "del": "5.1.0",
111
121
  "electron": "16.0.1",
112
122
  "electron-builder": "23.6.0",
@@ -124,7 +134,8 @@
124
134
  "prettier": "2.3.1",
125
135
  "react-devtools-electron": "4.7.0",
126
136
  "react-refresh": "0.12.0",
127
- "react-test-renderer": "16.13.1",
137
+ "react-test-renderer": "17.0.1",
138
+ "style-loader": "3.3.1",
128
139
  "ts-loader": "^8.3.0",
129
140
  "typescript": "3.9.9",
130
141
  "webpack": "5.72.0",