agora-appbuilder-core 2.2.0 → 2.3.0-beta.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 (303) hide show
  1. package/Readme.md +7 -1
  2. package/package.json +4 -3
  3. package/template/Gulpfile.js +389 -82
  4. package/template/_gitignore +4 -1
  5. package/template/_package-lock.json +32214 -3080
  6. package/template/agora-rn-uikit/src/AgoraUIKit.tsx +23 -20
  7. package/template/agora-rn-uikit/src/Contexts/LocalUserContext.tsx +13 -8
  8. package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +25 -9
  9. package/template/agora-rn-uikit/src/Contexts/RenderContext.tsx +10 -0
  10. package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +11 -5
  11. package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +6 -2
  12. package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +1 -1
  13. package/template/agora-rn-uikit/src/Controls/Local/EndCall.tsx +6 -2
  14. package/template/agora-rn-uikit/src/Controls/Local/LocalAudioMute.tsx +2 -2
  15. package/template/agora-rn-uikit/src/Controls/Local/LocalVideoMute.tsx +2 -2
  16. package/template/agora-rn-uikit/src/Controls/Local/SwitchCamera.tsx +6 -2
  17. package/template/agora-rn-uikit/src/Controls/LocalControls.tsx +11 -6
  18. package/template/agora-rn-uikit/src/Controls/Remote/RemoteAudioMute.tsx +10 -6
  19. package/template/agora-rn-uikit/src/Controls/Remote/RemoteSwap.tsx +7 -6
  20. package/template/agora-rn-uikit/src/Controls/Remote/RemoteVideoMute.tsx +6 -5
  21. package/template/agora-rn-uikit/src/Controls/RemoteControls.tsx +3 -3
  22. package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +16 -13
  23. package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +16 -13
  24. package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +13 -13
  25. package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +16 -13
  26. package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +28 -31
  27. package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +48 -35
  28. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +11 -13
  29. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +11 -13
  30. package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +18 -15
  31. package/template/agora-rn-uikit/src/Rtc/Create.tsx +22 -3
  32. package/template/agora-rn-uikit/src/Rtc/Join.tsx +19 -3
  33. package/template/agora-rn-uikit/src/RtcConfigure.tsx +161 -44
  34. package/template/agora-rn-uikit/src/Utils/useLocalUid.ts +8 -0
  35. package/template/agora-rn-uikit/src/Views/MaxVideoView.native.tsx +8 -6
  36. package/template/agora-rn-uikit/src/Views/MaxVideoView.tsx +8 -6
  37. package/template/agora-rn-uikit/src/Views/MinVideoView.tsx +18 -9
  38. package/template/agora-rn-uikit/src/index.ts +12 -12
  39. package/template/babel.config.js +17 -1
  40. package/template/bridge/rtc/webNg/RtcEngine.ts +34 -28
  41. package/template/bridge/rtc/webNg/SurfaceView.tsx +3 -2
  42. package/template/bridge/rtc/webNg/Types.ts +14 -0
  43. package/template/bridge/rtc/webNg/index.ts +5 -2
  44. package/template/bridge/rtm/web/index.ts +13 -7
  45. package/template/electron-builder.js +3 -2
  46. package/template/esbuild.rsdk.go +240 -0
  47. package/template/{src/subComponents/LayoutEnum.tsx → esbuildConfigTransform.js} +1 -5
  48. package/template/fpe-api/components.ts +43 -0
  49. package/template/fpe-api/context.ts +45 -0
  50. package/template/fpe-api/fpeEvents.ts +9 -0
  51. package/template/fpe-api/index.ts +21 -0
  52. package/template/fpe-api/install.ts +138 -0
  53. package/template/fpe-api/typeDefinition.ts +144 -0
  54. package/template/fpe-api/useFpe.tsx +35 -0
  55. package/template/fpe-api/utils.ts +61 -0
  56. package/template/fpe-implementation/createHook.ts +33 -0
  57. package/template/fpe-implementation/dummyFpe.ts +17 -0
  58. package/template/fpe-implementation/index.ts +1 -0
  59. package/template/fpe-todo.txt +14 -0
  60. package/template/fpe.config.js +29 -0
  61. package/template/global.d.ts +4 -0
  62. package/template/index.rsdk.tsx +27 -0
  63. package/template/index.wsdk.tsx +27 -0
  64. package/template/package.json +30 -13
  65. package/template/react-native-toast-message/src/index.js +9 -10
  66. package/template/react-native-toast-message/src/index.wsdk.js +419 -0
  67. package/template/src/App.tsx +97 -65
  68. package/template/src/AppWrapper.tsx +79 -0
  69. package/template/src/SDKAppWrapper.tsx +67 -0
  70. package/template/src/atoms/PrimaryButton.tsx +14 -8
  71. package/template/src/atoms/TextInput.tsx +13 -5
  72. package/template/src/components/Chat.tsx +178 -137
  73. package/template/src/components/ChatContext.ts +18 -22
  74. package/template/src/components/ColorConfigure.tsx +2 -2
  75. package/template/src/components/Controls.native.tsx +72 -62
  76. package/template/src/components/Controls.tsx +90 -69
  77. package/template/src/components/DeviceConfigure.tsx +1 -1
  78. package/template/src/components/DeviceContext.tsx +14 -7
  79. package/template/src/components/GraphQLProvider.tsx +9 -2
  80. package/template/src/components/GridVideo.tsx +20 -159
  81. package/template/src/components/HostControlView.tsx +54 -15
  82. package/template/src/components/Navbar.tsx +408 -157
  83. package/template/src/components/NetworkQualityContext.tsx +29 -22
  84. package/template/src/components/ParticipantsView.tsx +91 -115
  85. package/template/src/components/PinnedVideo.tsx +41 -188
  86. package/template/src/components/Precall.native.tsx +131 -97
  87. package/template/src/components/Precall.tsx +193 -158
  88. package/template/src/components/RTMConfigure.tsx +309 -415
  89. package/template/src/components/Router.sdk.ts +20 -0
  90. package/template/src/components/SessionContext.tsx +6 -3
  91. package/template/src/components/Settings.native.tsx +3 -0
  92. package/template/src/components/Settings.tsx +65 -31
  93. package/template/src/components/SettingsView.tsx +14 -8
  94. package/template/src/components/Share.tsx +188 -220
  95. package/template/src/components/StorageContext.tsx +5 -5
  96. package/template/src/components/StoreToken.tsx +5 -1
  97. package/template/src/components/chat-messages/useChatMessages.tsx +208 -0
  98. package/template/src/components/chat-notification/useChatNotification.tsx +78 -0
  99. package/template/src/components/chat-ui/useChatUIControl.tsx +66 -0
  100. package/template/src/components/common/Error.tsx +54 -0
  101. package/template/src/components/common/Logo.tsx +35 -0
  102. package/template/src/components/common/index.tsx +8 -0
  103. package/template/src/components/contexts/LiveStreamDataContext.tsx +79 -0
  104. package/template/src/components/contexts/ScreenShareContext.tsx +47 -0
  105. package/template/src/components/contexts/WhiteboardContext.tsx +59 -0
  106. package/template/src/components/dimension/DimensionContext.ts +27 -0
  107. package/template/src/components/dimension/DimensionProvider.tsx +34 -0
  108. package/template/src/components/livestream/LiveStreamContext.tsx +297 -273
  109. package/template/src/components/livestream/Types.ts +26 -7
  110. package/template/src/components/livestream/index.ts +13 -2
  111. package/template/src/components/livestream/views/LiveStreamControls.tsx +5 -1
  112. package/template/src/components/meeting-info/useMeetingInfo.tsx +63 -0
  113. package/template/src/components/meeting-info/useSetMeetingInfo.tsx +38 -0
  114. package/template/src/components/participants/AllAudienceParticipants.tsx +26 -21
  115. package/template/src/components/participants/AllHostParticipants.tsx +41 -53
  116. package/template/src/components/participants/MeParticipant.tsx +9 -10
  117. package/template/src/components/participants/ParticipantName.tsx +2 -1
  118. package/template/src/components/participants/RemoteParticipants.tsx +3 -3
  119. package/template/src/components/precall/LocalMute.native.tsx +91 -0
  120. package/template/src/components/precall/LocalMute.tsx +90 -0
  121. package/template/src/components/precall/VideoPreview.native.tsx +35 -0
  122. package/template/src/components/precall/VideoPreview.tsx +33 -0
  123. package/template/src/components/precall/index.tsx +28 -0
  124. package/template/src/components/precall/joinCallBtn.native.tsx +69 -0
  125. package/template/src/components/precall/joinCallBtn.tsx +91 -0
  126. package/template/src/components/precall/meetingTitle.tsx +26 -0
  127. package/template/src/components/precall/selectDevice.tsx +46 -0
  128. package/template/src/components/precall/textInput.tsx +43 -0
  129. package/template/src/components/precall/usePreCall.tsx +41 -0
  130. package/template/src/components/styles.ts +20 -3
  131. package/template/src/components/useShareLink.tsx +237 -0
  132. package/template/src/components/useUserPreference.tsx +125 -0
  133. package/template/src/components/useWakeLock.tsx +3 -3
  134. package/template/src/custom-events/CustomEvents.ts +238 -0
  135. package/template/src/custom-events/index.tsx +4 -0
  136. package/template/src/custom-events/types.ts +51 -0
  137. package/template/src/language/default-labels/commonLabels.ts +21 -0
  138. package/template/src/language/default-labels/createScreenLabels.ts +22 -0
  139. package/template/src/language/default-labels/index.ts +38 -0
  140. package/template/src/language/default-labels/joinScreenLabels.ts +13 -0
  141. package/template/src/language/default-labels/precallScreenLabels.ts +33 -0
  142. package/template/src/language/default-labels/shareLinkScreenLabels.ts +44 -0
  143. package/template/src/language/default-labels/videoCallScreenLabels.ts +191 -0
  144. package/template/src/language/i18nTypes.ts +10 -0
  145. package/template/src/language/index.ts +18 -0
  146. package/template/src/language/useLanguage.tsx +92 -0
  147. package/template/src/pages/Authenticate.tsx +21 -15
  148. package/template/src/pages/Create.tsx +180 -159
  149. package/template/src/pages/Join.tsx +47 -32
  150. package/template/src/pages/VideoCall.tsx +138 -407
  151. package/template/src/pages/create/useCreate.tsx +37 -0
  152. package/template/src/pages/video-call/CustomLayout.ts +17 -0
  153. package/template/src/pages/video-call/CustomUserContextHolder.tsx +20 -0
  154. package/template/src/pages/video-call/DefaultLayouts.ts +65 -0
  155. package/template/src/pages/video-call/NameWithMicStatus.tsx +62 -0
  156. package/template/src/pages/video-call/RenderComponent.tsx +52 -0
  157. package/template/src/pages/video-call/VideoCallScreen.tsx +191 -0
  158. package/template/src/pages/video-call/VideoComponent.tsx +34 -0
  159. package/template/src/pages/video-call/VideoRenderer.tsx +86 -0
  160. package/template/src/pages/video-call/index.ts +20 -0
  161. package/template/src/rtm/RTMEngine.ts +58 -0
  162. package/template/src/rtm/utils.ts +44 -0
  163. package/template/src/rtm-events/EventUtils.ts +267 -0
  164. package/template/src/rtm-events/EventsQueue.ts +38 -0
  165. package/template/src/rtm-events/constants.ts +42 -0
  166. package/template/src/rtm-events/index.tsx +8 -0
  167. package/template/src/rtm-events/types.ts +7 -0
  168. package/template/src/subComponents/ChatBubble.tsx +21 -12
  169. package/template/src/subComponents/ChatContainer.tsx +79 -30
  170. package/template/src/subComponents/ChatInput.tsx +146 -70
  171. package/template/src/subComponents/CopyJoinInfo.tsx +52 -67
  172. package/template/src/subComponents/Error.tsx +35 -24
  173. package/template/src/subComponents/LanguageSelector.tsx +85 -0
  174. package/template/src/subComponents/LayoutIconDropdown.native.tsx +163 -0
  175. package/template/src/subComponents/LayoutIconDropdown.tsx +198 -0
  176. package/template/src/subComponents/LocalAudioMute.tsx +52 -30
  177. package/template/src/subComponents/LocalEndCall.tsx +52 -0
  178. package/template/src/subComponents/LocalSwitchCamera.tsx +61 -0
  179. package/template/src/subComponents/LocalVideoMute.tsx +48 -30
  180. package/template/src/subComponents/LogoutButton.tsx +20 -5
  181. package/template/src/subComponents/NetworkQualityPill.tsx +43 -13
  182. package/template/src/subComponents/OpenInNativeButton.tsx +3 -2
  183. package/template/src/subComponents/Recording.tsx +46 -138
  184. package/template/src/subComponents/RemoteAudioMute.tsx +30 -34
  185. package/template/src/subComponents/RemoteEndCall.tsx +18 -7
  186. package/template/src/subComponents/RemoteVideoMute.tsx +17 -9
  187. package/template/src/subComponents/ScreenShareNotice.tsx +40 -40
  188. package/template/src/subComponents/SelectDevice.tsx +88 -45
  189. package/template/src/subComponents/SelectOAuth.tsx +30 -6
  190. package/template/src/subComponents/SidePanelButtons.ts +39 -0
  191. package/template/src/subComponents/TextWithTooltip.native.tsx +2 -1
  192. package/template/src/subComponents/TextWithTooltip.tsx +15 -20
  193. package/template/src/subComponents/chat/ChatParticipants.tsx +31 -32
  194. package/template/src/subComponents/livestream/ApprovedLiveStreamControlsView.tsx +7 -3
  195. package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +32 -18
  196. package/template/src/subComponents/livestream/controls/LocalRaiseHand.tsx +22 -8
  197. package/template/src/subComponents/livestream/controls/RemoteLiveStreamApprovedRequestRecall.tsx +12 -7
  198. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestApprove.tsx +24 -27
  199. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestReject.tsx +23 -26
  200. package/template/src/subComponents/livestream/index.ts +10 -2
  201. package/template/src/subComponents/recording/useRecording.tsx +209 -0
  202. package/template/src/subComponents/recording/useRecordingLayoutQuery.tsx +64 -0
  203. package/template/src/subComponents/screenshare/ScreenshareButton.native.tsx +18 -0
  204. package/template/src/subComponents/screenshare/ScreenshareButton.tsx +61 -31
  205. package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +57 -52
  206. package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +104 -144
  207. package/template/src/subComponents/screenshare/useScreenshare.tsx +29 -0
  208. package/template/src/subComponents/toastConfig.tsx +25 -20
  209. package/template/src/utils/IsAttendeeUser.ts +34 -0
  210. package/template/src/utils/SdkEvents.ts +68 -0
  211. package/template/src/utils/common.tsx +40 -0
  212. package/template/src/utils/eventEmitter.ts +29 -0
  213. package/template/src/utils/getMeetingInvite.ts +53 -0
  214. package/template/src/utils/index.tsx +11 -2
  215. package/template/src/utils/isAudioEnabled.ts +29 -0
  216. package/template/src/utils/isHostUser.ts +33 -0
  217. package/template/src/utils/isMobileOrTablet.native.ts +5 -0
  218. package/template/src/utils/{mobileWebTest.tsx → isMobileOrTablet.ts} +5 -2
  219. package/template/src/utils/isPSTNUser.ts +30 -0
  220. package/template/src/utils/isSDK.sdk.ts +5 -0
  221. package/template/src/utils/isSDK.ts +5 -0
  222. package/template/src/utils/isScreenShareUser.ts +31 -0
  223. package/template/src/utils/isVideoEnabled.ts +29 -0
  224. package/template/src/utils/useButtonTemplate.tsx +43 -0
  225. package/template/src/utils/useCreateMeeting.ts +74 -0
  226. package/template/src/utils/useGetLiveStreamingRequests.ts +24 -0
  227. package/template/src/utils/useGetMeetingPhrase.ts +68 -0
  228. package/template/src/utils/useGetName.ts +19 -0
  229. package/template/src/{subComponents/screenshare/ScreenshareContext.tsx → utils/useGroupMessages.ts} +10 -7
  230. package/template/src/utils/useJoinMeeting.ts +128 -0
  231. package/template/src/utils/useLayout.tsx +40 -0
  232. package/template/src/utils/useLiveStreamingUids.ts +26 -0
  233. package/template/src/utils/useLocalShareScreenUid.ts +19 -0
  234. package/template/src/utils/useMutePSTN.ts +43 -0
  235. package/template/src/utils/useMuteToggleLocal.ts +109 -0
  236. package/template/src/utils/useNavParams.ts +6 -0
  237. package/template/src/utils/useNavigateTo.ts +8 -0
  238. package/template/src/utils/usePrivateMessages.ts +33 -0
  239. package/template/src/utils/useRemoteEndCall.ts +27 -0
  240. package/template/src/utils/useRemoteMute.ts +64 -0
  241. package/template/src/utils/useSendControlMessage.ts +51 -0
  242. package/template/src/utils/useSendMessage.ts +40 -0
  243. package/template/src/utils/useSetName.ts +18 -0
  244. package/template/src/utils/useSetUnreadMessageCount.ts +43 -0
  245. package/template/src/utils/useSidePanel.tsx +41 -0
  246. package/template/src/utils/useString.ts +61 -0
  247. package/template/src/utils/useUnreadMessageCount.ts +50 -0
  248. package/template/src/utils/useUserList.ts +26 -0
  249. package/template/tsconfig.json +4 -4
  250. package/template/tsconfig_fpeApi.json +103 -0
  251. package/template/tsconfig_rsdk_index.json +105 -0
  252. package/template/tsconfig_wsdk_index.json +104 -0
  253. package/template/webpack.commons.js +40 -16
  254. package/template/webpack.main.config.js +2 -1
  255. package/template/webpack.renderer.config.js +1 -1
  256. package/template/webpack.rsdk.config.js +33 -0
  257. package/template/webpack.ts.config.js +89 -0
  258. package/template/webpack.web.config.js +8 -1
  259. package/template/webpack.wsdk.config.js +34 -0
  260. package/template/agora-rn-uikit/.git/HEAD +0 -1
  261. package/template/agora-rn-uikit/.git/config +0 -16
  262. package/template/agora-rn-uikit/.git/description +0 -1
  263. package/template/agora-rn-uikit/.git/hooks/applypatch-msg.sample +0 -15
  264. package/template/agora-rn-uikit/.git/hooks/commit-msg.sample +0 -24
  265. package/template/agora-rn-uikit/.git/hooks/fsmonitor-watchman.sample +0 -173
  266. package/template/agora-rn-uikit/.git/hooks/post-update.sample +0 -8
  267. package/template/agora-rn-uikit/.git/hooks/pre-applypatch.sample +0 -14
  268. package/template/agora-rn-uikit/.git/hooks/pre-commit.sample +0 -49
  269. package/template/agora-rn-uikit/.git/hooks/pre-merge-commit.sample +0 -13
  270. package/template/agora-rn-uikit/.git/hooks/pre-push.sample +0 -53
  271. package/template/agora-rn-uikit/.git/hooks/pre-rebase.sample +0 -169
  272. package/template/agora-rn-uikit/.git/hooks/pre-receive.sample +0 -24
  273. package/template/agora-rn-uikit/.git/hooks/prepare-commit-msg.sample +0 -42
  274. package/template/agora-rn-uikit/.git/hooks/push-to-checkout.sample +0 -78
  275. package/template/agora-rn-uikit/.git/hooks/update.sample +0 -128
  276. package/template/agora-rn-uikit/.git/index +0 -0
  277. package/template/agora-rn-uikit/.git/info/exclude +0 -6
  278. package/template/agora-rn-uikit/.git/logs/HEAD +0 -2
  279. package/template/agora-rn-uikit/.git/logs/refs/heads/ab-dev-auto +0 -1
  280. package/template/agora-rn-uikit/.git/logs/refs/heads/master +0 -1
  281. package/template/agora-rn-uikit/.git/logs/refs/remotes/origin/HEAD +0 -1
  282. package/template/agora-rn-uikit/.git/objects/pack/pack-0061d00cd98162a329a32b537488a35d0abeb069.idx +0 -0
  283. package/template/agora-rn-uikit/.git/objects/pack/pack-0061d00cd98162a329a32b537488a35d0abeb069.pack +0 -0
  284. package/template/agora-rn-uikit/.git/packed-refs +0 -24
  285. package/template/agora-rn-uikit/.git/refs/heads/ab-dev-auto +0 -1
  286. package/template/agora-rn-uikit/.git/refs/heads/master +0 -1
  287. package/template/agora-rn-uikit/.git/refs/remotes/origin/HEAD +0 -1
  288. package/template/agora-rn-uikit/.gitignore +0 -63
  289. package/template/agora-rn-uikit/package-lock.json +0 -7612
  290. package/template/agora-rn-uikit/src/Contexts/MaxUidContext.tsx +0 -7
  291. package/template/agora-rn-uikit/src/Contexts/MinUidContext.tsx +0 -8
  292. package/template/package-lock.json +0 -22923
  293. package/template/react-native-toast-message/.gitignore +0 -5
  294. package/template/react-native-toast-message/.npmignore +0 -5
  295. package/template/react-native-toast-message/package-lock.json +0 -10553
  296. package/template/src/.DS_Store +0 -0
  297. package/template/src/components/participants/context/ParticipantContext.tsx +0 -97
  298. package/template/src/subComponents/.DS_Store +0 -0
  299. package/template/src/subComponents/ScreenshareButton.tsx +0 -257
  300. package/template/src/subComponents/SwitchCamera.tsx +0 -35
  301. package/template/src/utils/hasBrandLogo.tsx +0 -3
  302. package/template/src/utils/mobileWebTest.native.tsx +0 -5
  303. package/template/src/utils/shouldAuthenticate.tsx +0 -7
@@ -9,6 +9,7 @@
9
9
  information visit https://appbuilder.agora.io.
10
10
  *********************************************
11
11
  */
12
+ // @ts-nocheck
12
13
  import AgoraRTC, {
13
14
  IAgoraRTCClient,
14
15
  ILocalAudioTrack,
@@ -30,7 +31,6 @@ import type {
30
31
  import {VideoProfile} from '../quality';
31
32
  import {ChannelProfile, ClientRole} from '../../../agora-rn-uikit';
32
33
  import {role, mode} from './Types';
33
- import {LOG_ENABLED, GEO_FENCING} from '../../../config.json';
34
34
  interface MediaDeviceInfo {
35
35
  readonly deviceId: string;
36
36
  readonly label: string;
@@ -116,6 +116,18 @@ export enum RnEncryptionEnum {
116
116
  * @since v3.1.2.
117
117
  */
118
118
  SM4128ECB = 4,
119
+ /**
120
+ * 5: 128-bit AES encryption, GCM mode.
121
+ *
122
+ * @since v3.3.1
123
+ */
124
+ AES128GCM = 5,
125
+ /**
126
+ * 6: 256-bit AES encryption, GCM mode.
127
+ *
128
+ * @since v3.3.1
129
+ */
130
+ AES256GCM = 6
119
131
  }
120
132
 
121
133
  export enum VideoStreamType {
@@ -135,20 +147,25 @@ interface RemoteStream {
135
147
  audio?: IRemoteAudioTrack;
136
148
  video?: IRemoteVideoTrack;
137
149
  }
138
- if (GEO_FENCING) {
150
+ if ($config.GEO_FENCING) {
139
151
  AgoraRTC.setArea({
140
152
  areaCode: AREAS.GLOBAL,
141
153
  excludedArea: AREAS.CHINA,
142
154
  });
143
155
  }
144
156
 
145
- if (LOG_ENABLED) {
157
+ if ($config.LOG_ENABLED) {
146
158
  AgoraRTC.setLogLevel(0);
147
159
  AgoraRTC.enableLogUpload();
148
160
  } else {
149
161
  AgoraRTC.disableLogUpload();
150
162
  }
151
163
 
164
+ interface CustomEvents {
165
+ ScreenshareStopped: callbackType
166
+ }
167
+
168
+
152
169
  export default class RtcEngine {
153
170
  public appId: string;
154
171
  // public AgoraRTC: any;
@@ -182,8 +199,6 @@ export default class RtcEngine {
182
199
 
183
200
  // Create channel profile and set it here
184
201
 
185
- // Create channel profile and set it here
186
-
187
202
  constructor(appId: string) {
188
203
  this.appId = appId;
189
204
  // this.AgoraRTC = AgoraRTC;
@@ -280,20 +295,15 @@ export default class RtcEngine {
280
295
  ): Promise<void> {
281
296
  // TODO create agora client here
282
297
  this.client.on('user-joined', (user) => {
283
- const uid = this.inScreenshare
284
- ? user.uid !== this.screenClient.uid
285
- ? user.uid
286
- : 1
287
- : user.uid;
288
- (this.eventsMap.get('UserJoined') as callbackType)(uid);
298
+ (this.eventsMap.get('UserJoined') as callbackType)(user.uid);
289
299
  (this.eventsMap.get('RemoteVideoStateChanged') as callbackType)(
290
- uid,
300
+ user.uid,
291
301
  0,
292
302
  0,
293
303
  0,
294
304
  );
295
305
  (this.eventsMap.get('RemoteAudioStateChanged') as callbackType)(
296
- uid,
306
+ user.uid,
297
307
  0,
298
308
  0,
299
309
  0,
@@ -301,17 +311,7 @@ export default class RtcEngine {
301
311
  });
302
312
 
303
313
  this.client.on('user-left', (user) => {
304
- const uid = this.inScreenshare
305
- ? user.uid !== this.screenClient.uid
306
- ? user.uid
307
- : 1
308
- : user.uid;
309
- // if (uid ===1) {
310
- // this.screenStream.audio?.close();
311
- // this.screenStream.video?.close();
312
- // this.screenStream = {}
313
- // }
314
- // else
314
+ const uid = user.uid;
315
315
  if (this.remoteStreams.has(uid)) {
316
316
  this.remoteStreams.delete(uid);
317
317
  }
@@ -322,7 +322,7 @@ export default class RtcEngine {
322
322
  // Initiate the subscription
323
323
  if (this.inScreenshare && user.uid === this.screenClient.uid) {
324
324
  (this.eventsMap.get('RemoteVideoStateChanged') as callbackType)(
325
- 1,
325
+ user.uid,
326
326
  2,
327
327
  0,
328
328
  0,
@@ -721,7 +721,9 @@ export default class RtcEngine {
721
721
 
722
722
  async destroy(): Promise<void> {
723
723
  if (this.inScreenshare) {
724
- (this.eventsMap.get('UserOffline') as callbackType)(1);
724
+ (this.eventsMap.get('UserOffline') as callbackType)(
725
+ this.screenClient.uid,
726
+ );
725
727
  this.screenClient.leave();
726
728
  (this.eventsMap.get('ScreenshareStopped') as callbackType)();
727
729
  }
@@ -828,7 +830,9 @@ export default class RtcEngine {
828
830
  );
829
831
 
830
832
  this.screenStream.video.on('track-ended', () => {
831
- (this.eventsMap.get('UserOffline') as callbackType)(1);
833
+ (this.eventsMap.get('UserOffline') as callbackType)(
834
+ this.screenClient.uid,
835
+ );
832
836
 
833
837
  this.screenClient.leave();
834
838
 
@@ -840,7 +844,9 @@ export default class RtcEngine {
840
844
  this.inScreenshare = false;
841
845
  });
842
846
  } else {
843
- (this.eventsMap.get('UserOffline') as callbackType)(1);
847
+ (this.eventsMap.get('UserOffline') as callbackType)(
848
+ this.screenClient.uid,
849
+ );
844
850
  this.screenClient.leave();
845
851
  (this.eventsMap.get('ScreenshareStopped') as callbackType)();
846
852
  try {
@@ -9,6 +9,7 @@
9
9
  information visit https://appbuilder.agora.io.
10
10
  *********************************************
11
11
  */
12
+
12
13
  import {ILocalVideoTrack, IRemoteVideoTrack} from 'agora-rtc-sdk-ng';
13
14
  import React, {useEffect} from 'react';
14
15
  import {StyleProp, StyleSheet, ViewProps, ViewStyle} from 'react-native';
@@ -17,9 +18,9 @@ import {VideoMirrorMode, VideoRenderMode} from 'react-native-agora';
17
18
  export interface RtcSurfaceViewProps extends ViewProps {
18
19
  zOrderMediaOverlay?: boolean;
19
20
  zOrderOnTop?: boolean;
20
- renderMode?: VideoRenderMode;
21
+ renderMode?: any;
21
22
  channelId?: string;
22
- mirrorMode?: VideoMirrorMode;
23
+ mirrorMode?: any;
23
24
  }
24
25
  export interface RtcUidProps {
25
26
  uid: number;
@@ -14,6 +14,20 @@ export enum VideoRenderMode {
14
14
  Fit,
15
15
  Adaptive,
16
16
  }
17
+ export enum VideoMirrorMode {
18
+ /**
19
+ * 0: (Default) The SDK determines the mirror mode.
20
+ */
21
+ Auto = 0,
22
+ /**
23
+ * 1: Enables mirror mode.
24
+ */
25
+ Enabled = 1,
26
+ /**
27
+ * 2: Disables mirror mode.
28
+ */
29
+ Disabled = 2
30
+ }
17
31
  /**
18
32
  *
19
33
  * The latency level of an audience member in a live interactive streaming. Takes effect only when the user role is `"audience"`.
@@ -20,10 +20,13 @@ export const RtcLocalView = {
20
20
  };
21
21
 
22
22
  export const RtcRemoteView = {
23
- SurfaceView: SurfaceView,
24
- TextureView: SurfaceView,
23
+ SurfaceView: SurfaceView as any,
24
+ TextureView: SurfaceView as any,
25
25
  };
26
26
 
27
27
  export const VideoRenderMode = {...Types.VideoRenderMode};
28
+ export const VideoMirrorMode = {...Types.VideoRenderMode};
28
29
 
30
+ export {RnEncryptionEnum as EncryptionMode} from './RtcEngine';
31
+ export {AREAS as AreaCode} from './RtcEngine'
29
32
  export default RtcEngine;
@@ -1,22 +1,28 @@
1
1
  /*
2
2
  ********************************************
3
3
  Copyright © 2021 Agora Lab, Inc., all rights reserved.
4
- AppBuilder and all associated components, source code, APIs, services, and documentation
5
- (the “Materials”) are owned by Agora Lab, Inc. and its licensors. The Materials may not be
6
- accessed, used, modified, or distributed for any purpose without a license from Agora Lab, Inc.
7
- Use without a license or in violation of any license terms and conditions (including use for
8
- any purpose competitive to Agora Lab, Inc.’s business) is strictly prohibited. For more
9
- information visit https://appbuilder.agora.io.
4
+ AppBuilder and all associated components, source code, APIs, services, and documentation
5
+ (the “Materials”) are owned by Agora Lab, Inc. and its licensors. The Materials may not be
6
+ accessed, used, modified, or distributed for any purpose without a license from Agora Lab, Inc.
7
+ Use without a license or in violation of any license terms and conditions (including use for
8
+ any purpose competitive to Agora Lab, Inc.’s business) is strictly prohibited. For more
9
+ information visit https://appbuilder.agora.io.
10
10
  *********************************************
11
11
  */
12
+ // @ts-nocheck
12
13
  import {
13
14
  ChannelAttributeOptions,
14
15
  RtmAttribute,
15
16
  RtmChannelAttribute,
16
17
  Subscription,
17
- } from 'agora-react-native-rtm';
18
+ } from 'agora-react-native-rtm/lib/typescript/src';
18
19
  import {RtmClientEvents} from 'agora-react-native-rtm/lib/typescript/src/RtmEngine';
19
20
  import AgoraRTM, {VERSION} from 'agora-rtm-sdk';
21
+ // export {RtmAttribute}
22
+ //
23
+ interface RtmAttributePlaceholder {
24
+ };
25
+ export {RtmAttributePlaceholder as RtmAttribute};
20
26
 
21
27
  type callbackType = (args?: any) => void;
22
28
 
@@ -10,12 +10,13 @@
10
10
  *********************************************
11
11
  */
12
12
  const {PRODUCT_ID} = require('./config.json');
13
+
13
14
  module.exports = {
14
15
  appId: `com.${PRODUCT_ID.toLowerCase()}`,
15
16
  productName: PRODUCT_ID,
16
17
  directories: {
17
- output: './out',
18
- app: './.electron',
18
+ output: `../Builds/${process.env.TARGET}`,
19
+ app: '../Builds/.electron',
19
20
  },
20
21
  linux: {
21
22
  target: ['AppImage'],
@@ -0,0 +1,240 @@
1
+ package main
2
+
3
+ import (
4
+ "flag"
5
+ "log"
6
+ "os"
7
+ "path/filepath"
8
+
9
+ "github.com/davecgh/go-spew/spew"
10
+ "github.com/evanw/esbuild/pkg/api"
11
+ )
12
+
13
+ type ioPaths struct {
14
+ outPath string
15
+ configTransformerPath string
16
+ }
17
+
18
+ func commonAliasResolver() api.Plugin {
19
+ aliasResolvers := api.Plugin{
20
+ Name: "importAliases",
21
+ Setup: func(pb api.PluginBuild) {
22
+ pb.OnResolve(api.OnResolveOptions{Filter: "react-native$"},
23
+ func(args api.OnResolveArgs) (api.OnResolveResult, error) {
24
+ path, err := filepath.Abs("./node_modules/react-native-web/dist/cjs/index.js")
25
+ if err != nil {
26
+ log.Fatalln(err)
27
+ }
28
+ return api.OnResolveResult{Path: path}, nil
29
+ },
30
+ )
31
+
32
+ // Using rtm bridge to translate React Native RTM SDK calls to web SDK calls
33
+ pb.OnResolve(api.OnResolveOptions{Filter: "agora-react-native-rtm$"},
34
+ func(args api.OnResolveArgs) (api.OnResolveResult, error) {
35
+ path, err := filepath.Abs("./bridge/rtm/web/index.ts")
36
+ if err != nil {
37
+ log.Fatalln(err)
38
+ }
39
+ return api.OnResolveResult{Path: path}, nil
40
+ },
41
+ )
42
+
43
+ // Using rtc bridge to translate React Native RTC SDK calls to web SDK calls for web and linux
44
+ // Using rtc bridge to translate React Native RTC SDK calls to electron SDK calls for windows and mac
45
+ pb.OnResolve(api.OnResolveOptions{Filter: "react-native-agora$"},
46
+ func(args api.OnResolveArgs) (api.OnResolveResult, error) {
47
+ path, err := filepath.Abs("./bridge/rtc/webNg/index.ts")
48
+ if err != nil {
49
+ log.Fatalln(err)
50
+ }
51
+ return api.OnResolveResult{Path: path}, nil
52
+ },
53
+ )
54
+
55
+ pb.OnResolve(api.OnResolveOptions{Filter: "fpe-api/install"},
56
+ func(args api.OnResolveArgs) (api.OnResolveResult, error) {
57
+ path, err := filepath.Abs("./fpe-api/install.ts")
58
+ if err != nil {
59
+ log.Fatalln(err)
60
+ }
61
+ return api.OnResolveResult{Path: path}, nil
62
+ },
63
+ )
64
+
65
+ pb.OnResolve(api.OnResolveOptions{Filter: "fpe-api"},
66
+ func(args api.OnResolveArgs) (api.OnResolveResult, error) {
67
+ path, err := filepath.Abs("./fpe-api/index.ts")
68
+ if err != nil {
69
+ log.Fatalln(err)
70
+ }
71
+ return api.OnResolveResult{Path: path}, nil
72
+ },
73
+ )
74
+
75
+ pb.OnResolve(api.OnResolveOptions{Filter: "fpe-implementation"},
76
+ func(args api.OnResolveArgs) (api.OnResolveResult, error) {
77
+ path, err := filepath.Abs("./fpe-implementation/index.ts")
78
+ if err != nil {
79
+ log.Fatalln(err)
80
+ }
81
+ return api.OnResolveResult{Path: path}, nil
82
+ },
83
+ )
84
+
85
+ pb.OnResolve(api.OnResolveOptions{Filter: "test-fpe"},
86
+ func(args api.OnResolveArgs) (api.OnResolveResult, error) {
87
+ fpePath, err := filepath.Abs("./test-fpe/index.ts")
88
+ if err != nil {
89
+ log.Fatalln(err)
90
+ }
91
+ fpeDummyPath, err := filepath.Abs("./fpe-implementation/dummyFpe.ts")
92
+ if err != nil {
93
+ log.Fatalln(err)
94
+ }
95
+
96
+ _, err = os.Stat(fpePath)
97
+ if err != nil {
98
+ return api.OnResolveResult{Path: fpeDummyPath}, nil
99
+ }
100
+
101
+ return api.OnResolveResult{Path: fpePath}, nil
102
+ },
103
+ )
104
+
105
+ pb.OnResolve(api.OnResolveOptions{Filter: "agora-react-native-rtm/lib/typescript/src"},
106
+ func(args api.OnResolveArgs) (api.OnResolveResult, error) {
107
+ path, err := filepath.Abs("./bridge/rtm/web/index.ts")
108
+ if err != nil {
109
+ log.Fatalln(err)
110
+ }
111
+ return api.OnResolveResult{Path: path}, nil
112
+ },
113
+ )
114
+ },
115
+ }
116
+
117
+ return aliasResolvers
118
+ }
119
+
120
+ func commonResolveExtensions() []string {
121
+ // Adds platform specific extensions and OS specific extensions
122
+ // .web.tsx works for web specific code
123
+ resolveExtensions := []string{
124
+ ".rsdk.tsx",
125
+ ".rsdk.ts",
126
+ ".sdk.ts",
127
+ ".sdk.tsx",
128
+ ".web.ts",
129
+ ".web.tsx",
130
+ ".tsx",
131
+ ".ts",
132
+ ".jsx",
133
+ ".js",
134
+ ".node",
135
+ }
136
+
137
+ return resolveExtensions
138
+ }
139
+
140
+ func commonLoader() map[string]api.Loader {
141
+ loader := map[string]api.Loader{
142
+ // since esbuild targets latest js by default we dont need plugins that
143
+ // convert optional chaining and class properties (node 16.11.0+ has both features)
144
+
145
+ // use sx loaders for js|ts files as well
146
+ ".js": api.LoaderTSX,
147
+ ".jsx": api.LoaderTSX,
148
+ ".ts": api.LoaderTSX,
149
+ ".tsx": api.LoaderTSX,
150
+
151
+ // todo: might need to deal with non-lowercase extensions for these media files
152
+ ".png": api.LoaderDataURL,
153
+ ".jpg": api.LoaderDataURL,
154
+ ".jpeg": api.LoaderDataURL,
155
+ ".gif": api.LoaderDataURL,
156
+ }
157
+
158
+ return loader
159
+ }
160
+
161
+ func common(iopath *ioPaths) api.BuildOptions {
162
+ commonBuildOpts := api.BuildOptions{
163
+ // we can safely ignore (webpack) plugins for now because they seem to be used only for not reactsdk
164
+
165
+ Plugins: []api.Plugin{commonAliasResolver()},
166
+ ResolveExtensions: commonResolveExtensions(),
167
+ Loader: commonLoader(),
168
+
169
+ // embed config variables values into the code
170
+ Define: map[string]string{
171
+ "$config": "config",
172
+ },
173
+ Inject: []string{iopath.configTransformerPath},
174
+ }
175
+
176
+ return commonBuildOpts
177
+ }
178
+
179
+ func rsdk(iopath *ioPaths) api.BuildResult {
180
+ commonBuildOpts := common(iopath)
181
+ rsdkBuildOpts := api.BuildOptions{
182
+ // build options common to rsdk and other components
183
+ Plugins: commonBuildOpts.Plugins,
184
+ ResolveExtensions: commonBuildOpts.ResolveExtensions,
185
+ Loader: commonBuildOpts.Loader,
186
+
187
+ // rsdk specific build options
188
+ EntryPoints: []string{"./index.rsdk.tsx"},
189
+ External: []string{
190
+ "react",
191
+ "react-dom",
192
+ "react-router",
193
+ "react-router-dom",
194
+ "@apollo/client",
195
+ },
196
+ Define: commonBuildOpts.Define,
197
+ Inject: commonBuildOpts.Inject,
198
+
199
+ // target es6 because other host applications typically do not transpile node_modules
200
+ // i.e. they will not transpile agora-app-builder-sdk
201
+ Target: api.Target(api.ES2015),
202
+
203
+ // bundle in cjs format because this index.js is meant to be used by other host applications
204
+ // like webpack which runs on node
205
+ Format: api.FormatCommonJS,
206
+ Outfile: iopath.outPath,
207
+
208
+ // other esbuild options
209
+ Write: true,
210
+ Bundle: true,
211
+ MinifyWhitespace: true,
212
+ MinifyIdentifiers: true,
213
+ MinifySyntax: true,
214
+
215
+ // debug options. does not affect bundle size
216
+ // Metafile: true,
217
+ }
218
+
219
+ rsdk := api.Build(rsdkBuildOpts)
220
+ return rsdk
221
+ }
222
+
223
+ func main() {
224
+ outPath := flag.String("outpath", "../Builds/react-sdk/index.js", "path to write bundled js file")
225
+ configTransformerPath := flag.String("configtransformerpath", "./esbuildConfigTransform.js", "path to inject file")
226
+ flag.Parse()
227
+ iopath := &ioPaths{
228
+ outPath: *outPath,
229
+ configTransformerPath: *configTransformerPath,
230
+ }
231
+ log.Println("esbuild args = ", iopath)
232
+ rsdkRes := rsdk(iopath)
233
+ if len(rsdkRes.Errors) > 0 {
234
+ spew.Dump(rsdkRes)
235
+ log.Fatalln("build failed")
236
+ }
237
+
238
+ // text := api.AnalyzeMetafile(rsdkRes.Metafile, api.AnalyzeMetafileOptions{Verbose: false})
239
+ // log.Printf("%s", text)
240
+ }
@@ -9,8 +9,4 @@
9
9
  information visit https://appbuilder.agora.io.
10
10
  *********************************************
11
11
  */
12
- enum Layout {
13
- Grid,
14
- Pinned,
15
- }
16
- export default Layout;
12
+ export let config = require('./config.json');
@@ -0,0 +1,43 @@
1
+ //Icons
2
+ export {default as icons} from '../src/assets/icons';
3
+
4
+ // commented for v1 release
5
+ //create screen
6
+ //export {default as Create} from '../src/pages/Create';
7
+
8
+ // commented for v1 release
9
+ //share screen
10
+ //export {default as Share} from '../src/components/Share';
11
+
12
+ // commented for v1 release
13
+ //Precall components
14
+ //export * from '../src/components/precall/index';
15
+
16
+ //video call components
17
+ export {
18
+ ParticipantsView,
19
+ Controls,
20
+ ControlsComponentsArray,
21
+ ChatBubble,
22
+ } from '../src/pages/video-call/index';
23
+ export {default as GridLayout} from '../src/components/GridVideo';
24
+ export {default as PinnedLayout} from '../src/components/PinnedVideo';
25
+ export {default as VideoComponent} from '../src/pages/video-call/VideoComponent';
26
+ export {MaxVideoRenderer as MaxVideoView} from '../src/pages/video-call/VideoRenderer';
27
+ export {default as RenderComponent} from '../src/pages/video-call/RenderComponent';
28
+ export {NameWithMicStatus} from '../src/pages/video-call/NameWithMicStatus';
29
+ export {NetworkQualityPill} from '../src/subComponents/NetworkQualityPill';
30
+ //videocall screen
31
+ export {default as VideocallScreen} from '../src/pages/video-call/VideoCallScreen';
32
+
33
+ // commented for v1 release
34
+ //Settings screen
35
+ //export {default as HostControlView} from '../src/components/HostControlView';
36
+ // export {
37
+ // default as SelectDevice,
38
+ // SelectDeviceComponentsArray,
39
+ // } from '../src/subComponents/SelectDevice';
40
+ //export {default as LanguageSelector} from '../src/subComponents/LanguageSelector';
41
+
42
+ //Sidepanel buttons
43
+ export {SidePanelButtonsArray} from '../src/subComponents/SidePanelButtons';
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Core contexts
3
+ */
4
+ import {createHook} from 'fpe-implementation';
5
+ import {
6
+ RtcContext,
7
+ RenderContext,
8
+ PropsContext,
9
+ LocalContext,
10
+ } from '../agora-rn-uikit';
11
+ // commented for v1 release
12
+ //import {default as DeviceContext} from '../src/components/DeviceContext';
13
+ //import {default as StorageContext} from '../src/components/StorageContext';
14
+
15
+ export const useRtcContext = createHook(RtcContext);
16
+ export const useRenderContext = createHook(RenderContext);
17
+ export const usePropsContext = createHook(PropsContext);
18
+ export const useLocalContext = createHook(LocalContext);
19
+ // commented for v1 release
20
+ //export const useDeviceContext = createHook(DeviceContext);
21
+ //export const useStorageContext = createHook(StorageContext);
22
+
23
+ /**
24
+ * UI contexts
25
+ */
26
+ // commented for v1 release
27
+ //export {usePreCall} from '../src/components/precall/usePreCall';
28
+ //export type {PreCallContextInterface} from '../src/components/precall/usePreCall';
29
+ export {useLayout} from '../src/utils/useLayout';
30
+ export type {LayoutContextInterface} from '../src/utils/useLayout';
31
+ // commented for v1 release
32
+ // export {
33
+ // useShareLink,
34
+ // SHARE_LINK_CONTENT_TYPE,
35
+ // } from '../src/components/useShareLink';
36
+ //export type {ShareLinkContextInterface} from '../src/components/useShareLink';
37
+ // export {useScreenshare} from '../src/subComponents/screenshare/useScreenshare';
38
+ // export type {ScreenshareContextInterface} from '../src/subComponents/screenshare/useScreenshare';
39
+ export {useRecording} from '../src/subComponents/recording/useRecording';
40
+ export type {RecordingContextInterface} from '../src/subComponents/recording/useRecording';
41
+ export {useMeetingInfo} from '../src/components/meeting-info/useMeetingInfo';
42
+ export type {MeetingInfoContextInterface} from '../src/components/meeting-info/useMeetingInfo';
43
+ // commented for v1 release
44
+ // export {useChatUIControl} from '../src/components/chat-ui/useChatUIControl';
45
+ // export type {ChatUIControlInterface} from '../src/components/chat-ui/useChatUIControl';
@@ -0,0 +1,9 @@
1
+ // 1. Import customEvents
2
+ import CustomEvents from '../src/custom-events/CustomEvents';
3
+ import {EventSourceEnum} from '../src/custom-events';
4
+
5
+ // 2. Initialize with source "fpe"
6
+ const fpeEvents = new CustomEvents(EventSourceEnum.fpe);
7
+
8
+ // 3. export
9
+ export {fpeEvents as CustomEvents};
@@ -0,0 +1,21 @@
1
+ /*
2
+ ********************************************
3
+ Copyright © 2021 Agora Lab, Inc., all rights reserved.
4
+ AppBuilder and all associated components, source code, APIs, services, and documentation
5
+ (the “Materials”) are owned by Agora Lab, Inc. and its licensors. The Materials may not be
6
+ accessed, used, modified, or distributed for any purpose without a license from Agora Lab, Inc.
7
+ Use without a license or in violation of any license terms and conditions (including use for
8
+ any purpose competitive to Agora Lab, Inc.’s business) is strictly prohibited. For more
9
+ information visit https://appbuilder.agora.io.
10
+ *********************************************
11
+ */
12
+ import fpeConfig from 'test-fpe';
13
+
14
+ export {fpeConfig};
15
+
16
+ export * from './useFpe';
17
+ export * from './context';
18
+ export * from './components';
19
+ export * from './typeDefinition';
20
+ export * from './utils';
21
+ export * from './fpeEvents';