agora-appbuilder-core 2.2.0 → 2.3.0-beta.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 (280) hide show
  1. package/Readme.md +7 -1
  2. package/package.json +4 -3
  3. package/template/Gulpfile.js +306 -87
  4. package/template/_gitignore +4 -1
  5. package/template/_package-lock.json +2297 -2533
  6. package/template/agora-rn-uikit/.git/HEAD +1 -1
  7. package/template/agora-rn-uikit/.git/config +3 -3
  8. package/template/agora-rn-uikit/.git/index +0 -0
  9. package/template/agora-rn-uikit/.git/logs/HEAD +2 -2
  10. package/template/agora-rn-uikit/.git/logs/refs/heads/master +1 -1
  11. package/template/agora-rn-uikit/.git/logs/refs/heads/release/fpe-1.0.0 +1 -0
  12. package/template/agora-rn-uikit/.git/logs/refs/remotes/origin/HEAD +1 -1
  13. package/template/agora-rn-uikit/.git/objects/pack/pack-f274a85fccfc9b5112d154bb3b6d34cb4b8dedde.idx +0 -0
  14. package/template/agora-rn-uikit/.git/objects/pack/{pack-0061d00cd98162a329a32b537488a35d0abeb069.pack → pack-f274a85fccfc9b5112d154bb3b6d34cb4b8dedde.pack} +0 -0
  15. package/template/agora-rn-uikit/.git/packed-refs +5 -1
  16. package/template/agora-rn-uikit/.git/refs/heads/release/fpe-1.0.0 +1 -0
  17. package/template/agora-rn-uikit/src/AgoraUIKit.tsx +23 -20
  18. package/template/agora-rn-uikit/src/Contexts/LocalUserContext.tsx +13 -8
  19. package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +25 -9
  20. package/template/agora-rn-uikit/src/Contexts/RenderContext.tsx +10 -0
  21. package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +11 -5
  22. package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +6 -2
  23. package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +1 -1
  24. package/template/agora-rn-uikit/src/Controls/Local/EndCall.tsx +6 -2
  25. package/template/agora-rn-uikit/src/Controls/Local/LocalAudioMute.tsx +2 -2
  26. package/template/agora-rn-uikit/src/Controls/Local/LocalVideoMute.tsx +2 -2
  27. package/template/agora-rn-uikit/src/Controls/Local/SwitchCamera.tsx +6 -2
  28. package/template/agora-rn-uikit/src/Controls/LocalControls.tsx +11 -6
  29. package/template/agora-rn-uikit/src/Controls/Remote/RemoteAudioMute.tsx +10 -6
  30. package/template/agora-rn-uikit/src/Controls/Remote/RemoteSwap.tsx +7 -6
  31. package/template/agora-rn-uikit/src/Controls/Remote/RemoteVideoMute.tsx +6 -5
  32. package/template/agora-rn-uikit/src/Controls/RemoteControls.tsx +3 -3
  33. package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +16 -13
  34. package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +16 -13
  35. package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +13 -13
  36. package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +16 -13
  37. package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +28 -31
  38. package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +48 -35
  39. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +11 -13
  40. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +11 -13
  41. package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +18 -15
  42. package/template/agora-rn-uikit/src/Rtc/Create.tsx +14 -2
  43. package/template/agora-rn-uikit/src/Rtc/Join.tsx +19 -3
  44. package/template/agora-rn-uikit/src/RtcConfigure.tsx +161 -44
  45. package/template/agora-rn-uikit/src/Utils/useLocalUid.ts +8 -0
  46. package/template/agora-rn-uikit/src/Views/MaxVideoView.native.tsx +8 -6
  47. package/template/agora-rn-uikit/src/Views/MaxVideoView.tsx +8 -6
  48. package/template/agora-rn-uikit/src/Views/MinVideoView.tsx +18 -9
  49. package/template/agora-rn-uikit/src/index.ts +12 -12
  50. package/template/babel.config.js +17 -1
  51. package/template/bridge/rtc/webNg/RtcEngine.ts +34 -28
  52. package/template/bridge/rtc/webNg/SurfaceView.tsx +3 -2
  53. package/template/bridge/rtc/webNg/Types.ts +14 -0
  54. package/template/bridge/rtc/webNg/index.ts +5 -2
  55. package/template/bridge/rtm/web/index.ts +13 -7
  56. package/template/electron-builder.js +3 -2
  57. package/template/esbuild.rsdk.go +226 -0
  58. package/template/{src/subComponents/LayoutEnum.tsx → esbuildConfigTransform.js} +1 -5
  59. package/template/fpe-api/components.ts +42 -0
  60. package/template/fpe-api/context.ts +45 -0
  61. package/template/fpe-api/fpeEvents.ts +9 -0
  62. package/template/fpe-api/index.ts +21 -0
  63. package/template/fpe-api/install.ts +128 -0
  64. package/template/fpe-api/typeDefinition.ts +143 -0
  65. package/template/fpe-api/useFpe.tsx +35 -0
  66. package/template/fpe-api/utils.ts +62 -0
  67. package/template/fpe-implementation/createHook.ts +33 -0
  68. package/template/fpe-implementation/dummyFpe.ts +17 -0
  69. package/template/fpe-implementation/index.ts +1 -0
  70. package/template/fpe-todo.txt +14 -0
  71. package/template/fpe.config.js +25 -0
  72. package/template/global.d.ts +4 -0
  73. package/template/index.rsdk.tsx +27 -0
  74. package/template/index.wsdk.tsx +27 -0
  75. package/template/package-lock.json +2297 -2533
  76. package/template/package.json +28 -12
  77. package/template/react-native-toast-message/src/index.js +9 -10
  78. package/template/react-native-toast-message/src/index.wsdk.js +419 -0
  79. package/template/src/App.tsx +97 -65
  80. package/template/src/AppWrapper.tsx +79 -0
  81. package/template/src/SDKAppWrapper.tsx +67 -0
  82. package/template/src/atoms/PrimaryButton.tsx +14 -8
  83. package/template/src/atoms/TextInput.tsx +13 -5
  84. package/template/src/components/Chat.tsx +171 -139
  85. package/template/src/components/ChatContext.ts +14 -22
  86. package/template/src/components/ColorConfigure.tsx +2 -2
  87. package/template/src/components/Controls.native.tsx +72 -62
  88. package/template/src/components/Controls.tsx +90 -69
  89. package/template/src/components/DeviceConfigure.tsx +1 -1
  90. package/template/src/components/DeviceContext.tsx +14 -7
  91. package/template/src/components/GraphQLProvider.tsx +9 -2
  92. package/template/src/components/GridVideo.tsx +20 -159
  93. package/template/src/components/HostControlView.tsx +54 -15
  94. package/template/src/components/Navbar.tsx +408 -157
  95. package/template/src/components/NetworkQualityContext.tsx +29 -22
  96. package/template/src/components/ParticipantsView.tsx +97 -119
  97. package/template/src/components/PinnedVideo.tsx +41 -188
  98. package/template/src/components/Precall.native.tsx +131 -97
  99. package/template/src/components/Precall.tsx +193 -158
  100. package/template/src/components/RTMConfigure.tsx +320 -398
  101. package/template/src/components/Router.sdk.ts +20 -0
  102. package/template/src/components/SessionContext.tsx +6 -3
  103. package/template/src/components/Settings.native.tsx +3 -0
  104. package/template/src/components/Settings.tsx +65 -31
  105. package/template/src/components/SettingsView.tsx +14 -8
  106. package/template/src/components/Share.tsx +188 -220
  107. package/template/src/components/StorageContext.tsx +5 -5
  108. package/template/src/components/StoreToken.tsx +5 -1
  109. package/template/src/components/chat-messages/useChatMessages.tsx +202 -0
  110. package/template/src/components/chat-notification/useChatNotification.tsx +78 -0
  111. package/template/src/components/chat-ui/useChatUIControl.tsx +66 -0
  112. package/template/src/components/common/Error.tsx +54 -0
  113. package/template/src/components/common/Logo.tsx +35 -0
  114. package/template/src/components/common/index.tsx +8 -0
  115. package/template/src/components/contexts/LiveStreamDataContext.tsx +79 -0
  116. package/template/src/components/contexts/ScreenShareContext.tsx +47 -0
  117. package/template/src/components/contexts/WhiteboardContext.tsx +59 -0
  118. package/template/src/components/dimension/DimensionContext.ts +27 -0
  119. package/template/src/components/dimension/DimensionProvider.tsx +34 -0
  120. package/template/src/components/livestream/LiveStreamContext.tsx +293 -272
  121. package/template/src/components/livestream/Types.ts +26 -7
  122. package/template/src/components/livestream/index.ts +13 -2
  123. package/template/src/components/livestream/views/LiveStreamControls.tsx +5 -1
  124. package/template/src/components/meeting-info/useMeetingInfo.tsx +63 -0
  125. package/template/src/components/meeting-info/useSetMeetingInfo.tsx +38 -0
  126. package/template/src/components/participants/AllAudienceParticipants.tsx +26 -21
  127. package/template/src/components/participants/AllHostParticipants.tsx +36 -53
  128. package/template/src/components/participants/MeParticipant.tsx +9 -10
  129. package/template/src/components/participants/ParticipantName.tsx +2 -1
  130. package/template/src/components/participants/RemoteParticipants.tsx +3 -3
  131. package/template/src/components/precall/LocalMute.native.tsx +91 -0
  132. package/template/src/components/precall/LocalMute.tsx +90 -0
  133. package/template/src/components/precall/VideoPreview.native.tsx +35 -0
  134. package/template/src/components/precall/VideoPreview.tsx +33 -0
  135. package/template/src/components/precall/index.tsx +28 -0
  136. package/template/src/components/precall/joinCallBtn.native.tsx +69 -0
  137. package/template/src/components/precall/joinCallBtn.tsx +91 -0
  138. package/template/src/components/precall/meetingTitle.tsx +26 -0
  139. package/template/src/components/precall/selectDevice.tsx +46 -0
  140. package/template/src/components/precall/textInput.tsx +43 -0
  141. package/template/src/components/precall/usePreCall.tsx +41 -0
  142. package/template/src/components/styles.ts +20 -3
  143. package/template/src/components/useShareLink.tsx +222 -0
  144. package/template/src/components/useWakeLock.tsx +3 -3
  145. package/template/src/custom-events/CustomEvents.ts +197 -0
  146. package/template/src/custom-events/index.tsx +4 -0
  147. package/template/src/custom-events/types.ts +51 -0
  148. package/template/src/language/default-labels/commonLabels.ts +21 -0
  149. package/template/src/language/default-labels/createScreenLabels.ts +22 -0
  150. package/template/src/language/default-labels/index.ts +38 -0
  151. package/template/src/language/default-labels/joinScreenLabels.ts +13 -0
  152. package/template/src/language/default-labels/precallScreenLabels.ts +33 -0
  153. package/template/src/language/default-labels/shareLinkScreenLabels.ts +44 -0
  154. package/template/src/language/default-labels/videoCallScreenLabels.ts +189 -0
  155. package/template/src/language/i18nTypes.ts +10 -0
  156. package/template/src/language/index.ts +18 -0
  157. package/template/src/language/useLanguage.tsx +92 -0
  158. package/template/src/pages/Authenticate.tsx +21 -15
  159. package/template/src/pages/Create.tsx +176 -159
  160. package/template/src/pages/Join.tsx +44 -32
  161. package/template/src/pages/VideoCall.tsx +134 -406
  162. package/template/src/pages/create/useCreate.tsx +37 -0
  163. package/template/src/pages/video-call/CustomLayout.ts +17 -0
  164. package/template/src/pages/video-call/CustomUserContextHolder.tsx +12 -0
  165. package/template/src/pages/video-call/DefaultLayouts.ts +65 -0
  166. package/template/src/pages/video-call/NameWithMicStatus.tsx +62 -0
  167. package/template/src/pages/video-call/RenderComponent.tsx +52 -0
  168. package/template/src/pages/video-call/VideoCallScreen.tsx +191 -0
  169. package/template/src/pages/video-call/VideoComponent.tsx +34 -0
  170. package/template/src/pages/video-call/VideoRenderer.tsx +86 -0
  171. package/template/src/pages/video-call/index.ts +20 -0
  172. package/template/src/rtm/RTMEngine.ts +58 -0
  173. package/template/src/rtm/utils.ts +28 -0
  174. package/template/src/rtm-events/EventUtils.ts +268 -0
  175. package/template/src/rtm-events/EventsQueue.ts +38 -0
  176. package/template/src/rtm-events/constants.ts +40 -0
  177. package/template/src/rtm-events/index.tsx +8 -0
  178. package/template/src/rtm-events/types.ts +7 -0
  179. package/template/src/subComponents/ChatBubble.tsx +18 -11
  180. package/template/src/subComponents/ChatContainer.tsx +78 -29
  181. package/template/src/subComponents/ChatInput.tsx +146 -70
  182. package/template/src/subComponents/CopyJoinInfo.tsx +52 -67
  183. package/template/src/subComponents/Error.tsx +35 -24
  184. package/template/src/subComponents/LanguageSelector.tsx +85 -0
  185. package/template/src/subComponents/LayoutIconDropdown.native.tsx +163 -0
  186. package/template/src/subComponents/LayoutIconDropdown.tsx +198 -0
  187. package/template/src/subComponents/LocalAudioMute.tsx +52 -30
  188. package/template/src/subComponents/LocalEndCall.tsx +52 -0
  189. package/template/src/subComponents/LocalSwitchCamera.tsx +61 -0
  190. package/template/src/subComponents/LocalVideoMute.tsx +48 -30
  191. package/template/src/subComponents/LogoutButton.tsx +20 -5
  192. package/template/src/subComponents/NetworkQualityPill.tsx +43 -13
  193. package/template/src/subComponents/OpenInNativeButton.tsx +3 -2
  194. package/template/src/subComponents/Recording.tsx +46 -138
  195. package/template/src/subComponents/RemoteAudioMute.tsx +30 -34
  196. package/template/src/subComponents/RemoteEndCall.tsx +18 -7
  197. package/template/src/subComponents/RemoteVideoMute.tsx +17 -9
  198. package/template/src/subComponents/ScreenShareNotice.tsx +40 -40
  199. package/template/src/subComponents/SelectDevice.tsx +88 -45
  200. package/template/src/subComponents/SelectOAuth.tsx +30 -6
  201. package/template/src/subComponents/SidePanelButtons.ts +39 -0
  202. package/template/src/subComponents/TextWithTooltip.native.tsx +2 -1
  203. package/template/src/subComponents/TextWithTooltip.tsx +15 -20
  204. package/template/src/subComponents/chat/ChatParticipants.tsx +31 -32
  205. package/template/src/subComponents/livestream/ApprovedLiveStreamControlsView.tsx +7 -3
  206. package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +32 -18
  207. package/template/src/subComponents/livestream/controls/LocalRaiseHand.tsx +22 -8
  208. package/template/src/subComponents/livestream/controls/RemoteLiveStreamApprovedRequestRecall.tsx +12 -7
  209. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestApprove.tsx +24 -27
  210. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestReject.tsx +23 -26
  211. package/template/src/subComponents/livestream/index.ts +10 -2
  212. package/template/src/subComponents/recording/useRecording.tsx +209 -0
  213. package/template/src/subComponents/recording/useRecordingLayoutQuery.tsx +64 -0
  214. package/template/src/subComponents/screenshare/ScreenshareButton.native.tsx +18 -0
  215. package/template/src/subComponents/screenshare/ScreenshareButton.tsx +59 -31
  216. package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +57 -52
  217. package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +97 -138
  218. package/template/src/subComponents/screenshare/useScreenshare.tsx +29 -0
  219. package/template/src/subComponents/toastConfig.tsx +25 -20
  220. package/template/src/utils/IsAttendeeUser.ts +34 -0
  221. package/template/src/utils/SdkEvents.ts +68 -0
  222. package/template/src/utils/common.tsx +40 -0
  223. package/template/src/utils/eventEmitter.ts +29 -0
  224. package/template/src/utils/getMeetingInvite.ts +30 -0
  225. package/template/src/utils/index.tsx +11 -2
  226. package/template/src/utils/isAudioEnabled.ts +29 -0
  227. package/template/src/utils/isHostUser.ts +33 -0
  228. package/template/src/utils/isMobileOrTablet.native.ts +5 -0
  229. package/template/src/utils/{mobileWebTest.tsx → isMobileOrTablet.ts} +5 -2
  230. package/template/src/utils/isPSTNUser.ts +30 -0
  231. package/template/src/utils/isSDK.sdk.ts +5 -0
  232. package/template/src/utils/isSDK.ts +5 -0
  233. package/template/src/utils/isScreenShareUser.ts +31 -0
  234. package/template/src/utils/isVideoEnabled.ts +29 -0
  235. package/template/src/utils/useButtonTemplate.tsx +43 -0
  236. package/template/src/utils/useCreateMeeting.ts +74 -0
  237. package/template/src/utils/useGetLiveStreamingRequests.ts +24 -0
  238. package/template/src/utils/useGetMeetingPhrase.ts +68 -0
  239. package/template/src/utils/useGetName.ts +20 -0
  240. package/template/src/{subComponents/screenshare/ScreenshareContext.tsx → utils/useGroupMessages.ts} +10 -7
  241. package/template/src/utils/useJoinMeeting.ts +120 -0
  242. package/template/src/utils/useLayout.tsx +40 -0
  243. package/template/src/utils/useLiveStreamingUids.ts +26 -0
  244. package/template/src/utils/useMutePSTN.ts +43 -0
  245. package/template/src/utils/useMuteToggleLocal.ts +109 -0
  246. package/template/src/utils/useNavParams.ts +6 -0
  247. package/template/src/utils/useNavigateTo.ts +8 -0
  248. package/template/src/utils/usePrivateMessages.ts +33 -0
  249. package/template/src/utils/useRemoteEndCall.ts +27 -0
  250. package/template/src/utils/useRemoteMute.ts +64 -0
  251. package/template/src/utils/useSendControlMessage.ts +51 -0
  252. package/template/src/utils/useSendMessage.ts +40 -0
  253. package/template/src/utils/useSetName.ts +20 -0
  254. package/template/src/utils/useSetUnreadMessageCount.ts +43 -0
  255. package/template/src/utils/useSidePanel.tsx +41 -0
  256. package/template/src/utils/useString.ts +61 -0
  257. package/template/src/utils/useUnreadMessageCount.ts +50 -0
  258. package/template/src/utils/useUserList.ts +26 -0
  259. package/template/tsconfig.json +4 -4
  260. package/template/tsconfig_fpeApi.json +103 -0
  261. package/template/tsconfig_rsdk_index.json +105 -0
  262. package/template/tsconfig_wsdk_index.json +104 -0
  263. package/template/webpack.commons.js +40 -16
  264. package/template/webpack.main.config.js +2 -1
  265. package/template/webpack.renderer.config.js +1 -1
  266. package/template/webpack.rsdk.config.js +33 -0
  267. package/template/webpack.ts.config.js +89 -0
  268. package/template/webpack.web.config.js +8 -1
  269. package/template/webpack.wsdk.config.js +34 -0
  270. package/template/agora-rn-uikit/.git/logs/refs/heads/ab-dev-auto +0 -1
  271. package/template/agora-rn-uikit/.git/objects/pack/pack-0061d00cd98162a329a32b537488a35d0abeb069.idx +0 -0
  272. package/template/agora-rn-uikit/.git/refs/heads/ab-dev-auto +0 -1
  273. package/template/agora-rn-uikit/src/Contexts/MaxUidContext.tsx +0 -7
  274. package/template/agora-rn-uikit/src/Contexts/MinUidContext.tsx +0 -8
  275. package/template/src/components/participants/context/ParticipantContext.tsx +0 -97
  276. package/template/src/subComponents/ScreenshareButton.tsx +0 -257
  277. package/template/src/subComponents/SwitchCamera.tsx +0 -35
  278. package/template/src/utils/hasBrandLogo.tsx +0 -3
  279. package/template/src/utils/mobileWebTest.native.tsx +0 -5
  280. 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,226 @@
1
+ package main
2
+
3
+ import (
4
+ "log"
5
+ "os"
6
+ "path/filepath"
7
+
8
+ "github.com/davecgh/go-spew/spew"
9
+ "github.com/evanw/esbuild/pkg/api"
10
+ )
11
+
12
+ func commonAliasResolver() api.Plugin {
13
+ aliasResolvers := api.Plugin{
14
+ Name: "importAliases",
15
+ Setup: func(pb api.PluginBuild) {
16
+ pb.OnResolve(api.OnResolveOptions{Filter: "react-native$"},
17
+ func(args api.OnResolveArgs) (api.OnResolveResult, error) {
18
+ path, err := filepath.Abs("./node_modules/react-native-web/dist/cjs/index.js")
19
+ if err != nil {
20
+ log.Fatalln(err)
21
+ }
22
+ return api.OnResolveResult{Path: path}, nil
23
+ },
24
+ )
25
+
26
+ // Using rtm bridge to translate React Native RTM SDK calls to web SDK calls
27
+ pb.OnResolve(api.OnResolveOptions{Filter: "agora-react-native-rtm$"},
28
+ func(args api.OnResolveArgs) (api.OnResolveResult, error) {
29
+ path, err := filepath.Abs("./bridge/rtm/web/index.ts")
30
+ if err != nil {
31
+ log.Fatalln(err)
32
+ }
33
+ return api.OnResolveResult{Path: path}, nil
34
+ },
35
+ )
36
+
37
+ // Using rtc bridge to translate React Native RTC SDK calls to web SDK calls for web and linux
38
+ // Using rtc bridge to translate React Native RTC SDK calls to electron SDK calls for windows and mac
39
+ pb.OnResolve(api.OnResolveOptions{Filter: "react-native-agora$"},
40
+ func(args api.OnResolveArgs) (api.OnResolveResult, error) {
41
+ path, err := filepath.Abs("./bridge/rtc/webNg/index.ts")
42
+ if err != nil {
43
+ log.Fatalln(err)
44
+ }
45
+ return api.OnResolveResult{Path: path}, nil
46
+ },
47
+ )
48
+
49
+ pb.OnResolve(api.OnResolveOptions{Filter: "fpe-api/install"},
50
+ func(args api.OnResolveArgs) (api.OnResolveResult, error) {
51
+ path, err := filepath.Abs("./fpe-api/install.ts")
52
+ if err != nil {
53
+ log.Fatalln(err)
54
+ }
55
+ return api.OnResolveResult{Path: path}, nil
56
+ },
57
+ )
58
+
59
+ pb.OnResolve(api.OnResolveOptions{Filter: "fpe-api"},
60
+ func(args api.OnResolveArgs) (api.OnResolveResult, error) {
61
+ path, err := filepath.Abs("./fpe-api/index.ts")
62
+ if err != nil {
63
+ log.Fatalln(err)
64
+ }
65
+ return api.OnResolveResult{Path: path}, nil
66
+ },
67
+ )
68
+
69
+ pb.OnResolve(api.OnResolveOptions{Filter: "fpe-implementation"},
70
+ func(args api.OnResolveArgs) (api.OnResolveResult, error) {
71
+ path, err := filepath.Abs("./fpe-implementation/index.ts")
72
+ if err != nil {
73
+ log.Fatalln(err)
74
+ }
75
+ return api.OnResolveResult{Path: path}, nil
76
+ },
77
+ )
78
+
79
+ pb.OnResolve(api.OnResolveOptions{Filter: "test-fpe"},
80
+ func(args api.OnResolveArgs) (api.OnResolveResult, error) {
81
+ fpePath, err := filepath.Abs("./test-fpe/index.ts")
82
+ if err != nil {
83
+ log.Fatalln(err)
84
+ }
85
+ fpeDummyPath, err := filepath.Abs("./fpe-implementation/dummyFpe.ts")
86
+ if err != nil {
87
+ log.Fatalln(err)
88
+ }
89
+
90
+ _, err = os.Stat(fpePath)
91
+ if err != nil {
92
+ return api.OnResolveResult{Path: fpeDummyPath}, nil
93
+ }
94
+
95
+ return api.OnResolveResult{Path: fpePath}, nil
96
+ },
97
+ )
98
+
99
+ pb.OnResolve(api.OnResolveOptions{Filter: "agora-react-native-rtm/lib/typescript/src"},
100
+ func(args api.OnResolveArgs) (api.OnResolveResult, error) {
101
+ path, err := filepath.Abs("./bridge/rtm/web/index.ts")
102
+ if err != nil {
103
+ log.Fatalln(err)
104
+ }
105
+ return api.OnResolveResult{Path: path}, nil
106
+ },
107
+ )
108
+ },
109
+ }
110
+
111
+ return aliasResolvers
112
+ }
113
+
114
+ func commonResolveExtensions() []string {
115
+ // Adds platform specific extensions and OS specific extensions
116
+ // .web.tsx works for web specific code
117
+ resolveExtensions := []string{
118
+ ".rsdk.tsx",
119
+ ".rsdk.ts",
120
+ ".sdk.ts",
121
+ ".sdk.tsx",
122
+ ".web.ts",
123
+ ".web.tsx",
124
+ ".tsx",
125
+ ".ts",
126
+ ".jsx",
127
+ ".js",
128
+ ".node",
129
+ }
130
+
131
+ return resolveExtensions
132
+ }
133
+
134
+ func commonLoader() map[string]api.Loader {
135
+ loader := map[string]api.Loader{
136
+ // since esbuild targets latest js by default we dont need plugins that
137
+ // convert optional chaining and class properties (node 16.11.0+ has both features)
138
+
139
+ // use sx loaders for js|ts files as well
140
+ ".js": api.LoaderTSX,
141
+ ".jsx": api.LoaderTSX,
142
+ ".ts": api.LoaderTSX,
143
+ ".tsx": api.LoaderTSX,
144
+
145
+ // todo: might need to deal with non-lowercase extensions for these media files
146
+ ".png": api.LoaderDataURL,
147
+ ".jpg": api.LoaderDataURL,
148
+ ".jpeg": api.LoaderDataURL,
149
+ ".gif": api.LoaderDataURL,
150
+ }
151
+
152
+ return loader
153
+ }
154
+
155
+ func common() api.BuildOptions {
156
+ commonBuildOpts := api.BuildOptions{
157
+ // we can safely ignore (webpack) plugins for now because they seem to be used only for not reactsdk
158
+
159
+ Plugins: []api.Plugin{commonAliasResolver()},
160
+ ResolveExtensions: commonResolveExtensions(),
161
+ Loader: commonLoader(),
162
+
163
+ // embed config variables values into the code
164
+ Define: map[string]string{
165
+ "$config": "config",
166
+ },
167
+ Inject: []string{"./esbuildConfigTransform.js"},
168
+ }
169
+
170
+ return commonBuildOpts
171
+ }
172
+
173
+ func rsdk() api.BuildResult {
174
+ commonBuildOpts := common()
175
+ rsdkBuildOpts := api.BuildOptions{
176
+ // build options common to rsdk and other components
177
+ Plugins: commonBuildOpts.Plugins,
178
+ ResolveExtensions: commonBuildOpts.ResolveExtensions,
179
+ Loader: commonBuildOpts.Loader,
180
+
181
+ // rsdk specific build options
182
+ EntryPoints: []string{"./index.rsdk.tsx"},
183
+ External: []string{
184
+ "react",
185
+ "react-dom",
186
+ "react-router",
187
+ "react-router-dom",
188
+ "@apollo/client",
189
+ },
190
+ Define: commonBuildOpts.Define,
191
+ Inject: commonBuildOpts.Inject,
192
+
193
+ // target es6 because other host applications typically do not transpile node_modules
194
+ // i.e. they will not transpile agora-app-builder-sdk
195
+ Target: api.Target(api.ES2015),
196
+
197
+ // bundle in cjs format because this index.js is meant to be used by other host applications
198
+ // like webpack which runs on node
199
+ Format: api.FormatCommonJS,
200
+ Outfile: "../Builds/react-sdk/index.js",
201
+
202
+ // other esbuild options
203
+ Write: true,
204
+ Bundle: true,
205
+ MinifyWhitespace: true,
206
+ MinifyIdentifiers: true,
207
+ MinifySyntax: true,
208
+
209
+ // debug options. does not affect bundle size
210
+ // Metafile: true,
211
+ }
212
+
213
+ rsdk := api.Build(rsdkBuildOpts)
214
+ return rsdk
215
+ }
216
+
217
+ func main() {
218
+ rsdkRes := rsdk()
219
+ if len(rsdkRes.Errors) > 0 {
220
+ spew.Dump(rsdkRes)
221
+ log.Fatalln("build failed")
222
+ }
223
+
224
+ // text := api.AnalyzeMetafile(rsdkRes.Metafile, api.AnalyzeMetafileOptions{Verbose: false})
225
+ // log.Printf("%s", text)
226
+ }
@@ -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,42 @@
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
+ } from '../src/pages/video-call/index';
22
+ export {default as GridLayout} from '../src/components/GridVideo';
23
+ export {default as PinnedLayout} from '../src/components/PinnedVideo';
24
+ export {default as VideoComponent} from '../src/pages/video-call/VideoComponent';
25
+ export {MaxVideoRenderer as MaxVideoView} from '../src/pages/video-call/VideoRenderer';
26
+ export {default as RenderComponent} from '../src/pages/video-call/RenderComponent';
27
+ export {NameWithMicStatus} from '../src/pages/video-call/NameWithMicStatus';
28
+ export {NetworkQualityPill} from '../src/subComponents/NetworkQualityPill';
29
+ //videocall screen
30
+ export {default as VideocallScreen} from '../src/pages/video-call/VideoCallScreen';
31
+
32
+ // commented for v1 release
33
+ //Settings screen
34
+ //export {default as HostControlView} from '../src/components/HostControlView';
35
+ // export {
36
+ // default as SelectDevice,
37
+ // SelectDeviceComponentsArray,
38
+ // } from '../src/subComponents/SelectDevice';
39
+ //export {default as LanguageSelector} from '../src/subComponents/LanguageSelector';
40
+
41
+ //Sidepanel buttons
42
+ 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};
@@ -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';