agora-appbuilder-core 3.0.10 → 3.0.12

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 (249) hide show
  1. package/Readme.md +0 -6
  2. package/package.json +2 -2
  3. package/template/_package-lock.json +4979 -7086
  4. package/template/agora-rn-uikit/src/Contexts/LocalUserContext.tsx +0 -4
  5. package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +0 -18
  6. package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +0 -2
  7. package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +26 -30
  8. package/template/agora-rn-uikit/src/Controls/Icons.ts +83 -30
  9. package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +6 -6
  10. package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +0 -1
  11. package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +0 -1
  12. package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +0 -1
  13. package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +0 -1
  14. package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +0 -1
  15. package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +0 -2
  16. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +0 -1
  17. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +0 -1
  18. package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +0 -1
  19. package/template/agora-rn-uikit/src/Reducer/index.ts +0 -3
  20. package/template/agora-rn-uikit/src/Rtc/Create.tsx +1 -89
  21. package/template/agora-rn-uikit/src/RtcConfigure.tsx +2 -39
  22. package/template/agora-rn-uikit/src/Views/MaxVideoView.native.tsx +5 -15
  23. package/template/agora-rn-uikit/src/Views/MaxVideoView.tsx +9 -15
  24. package/template/agora-rn-uikit/src/index.ts +1 -3
  25. package/template/android/app/build.gradle +0 -1
  26. package/template/android/app/src/main/AndroidManifest.xml +15 -22
  27. package/template/android/app/src/main/java/com/helloworld/MainActivity.java +0 -50
  28. package/template/android/build.gradle +3 -3
  29. package/template/babel.config.js +0 -1
  30. package/template/bridge/rtc/webNg/RtcEngine.ts +17 -110
  31. package/template/customization-api/sub-components.ts +1 -1
  32. package/template/customization-api/typeDefinition.ts +1 -2
  33. package/template/electron/index.html +27 -27
  34. package/template/electron/renderer/index.js +0 -1
  35. package/template/global.d.ts +4 -26
  36. package/template/index.js +0 -4
  37. package/template/index.rsdk.tsx +0 -1
  38. package/template/index.web.js +1 -7
  39. package/template/index.wsdk.tsx +1 -1
  40. package/template/ios/HelloWorld/Info.plist +1 -14
  41. package/template/ios/HelloWorld.xcodeproj/project.pbxproj +0 -17
  42. package/template/metro.config.js +1 -1
  43. package/template/package.json +7 -21
  44. package/template/react-native-toast-message/index.d.ts +43 -43
  45. package/template/react-native-toast-message/src/colors/index.js +2 -3
  46. package/template/react-native-toast-message/src/components/base/index.js +59 -46
  47. package/template/react-native-toast-message/src/components/base/styles.js +32 -16
  48. package/template/react-native-toast-message/src/components/error.js +2 -3
  49. package/template/react-native-toast-message/src/components/info.js +2 -3
  50. package/template/react-native-toast-message/src/components/success.js +2 -3
  51. package/template/react-native-toast-message/src/index.js +31 -122
  52. package/template/react-native-toast-message/src/index.sdk.tsx +35 -125
  53. package/template/react-native-toast-message/src/styles.js +4 -3
  54. package/template/react-native-toast-message/src/styles.sdk.ts +4 -3
  55. package/template/src/App.tsx +0 -6
  56. package/template/src/AppWrapper.tsx +28 -63
  57. package/template/src/assets/icons.ts +102 -0
  58. package/template/src/atoms/HorizontalRule.tsx +1 -3
  59. package/template/src/atoms/PrimaryButton.tsx +26 -51
  60. package/template/src/atoms/SecondaryButton.tsx +5 -8
  61. package/template/src/atoms/TextInput.tsx +14 -12
  62. package/template/src/components/Chat.tsx +214 -86
  63. package/template/src/components/ChatContext.ts +1 -8
  64. package/template/src/components/ColorConfigure.tsx +1 -1
  65. package/template/src/components/ColorContext.ts +1 -1
  66. package/template/src/components/{Controls1.native.tsx → Controls.native.tsx} +4 -6
  67. package/template/src/components/Controls.tsx +42 -342
  68. package/template/src/components/DeviceConfigure.tsx +101 -461
  69. package/template/src/components/DeviceContext.tsx +4 -8
  70. package/template/src/components/EventsConfigure.tsx +7 -144
  71. package/template/src/components/GraphQLProvider.tsx +1 -1
  72. package/template/src/components/GridVideo.tsx +44 -59
  73. package/template/src/components/HostControlView.tsx +35 -114
  74. package/template/src/components/Navbar.tsx +398 -216
  75. package/template/src/components/NetworkQualityContext.tsx +20 -20
  76. package/template/src/components/ParticipantsView.tsx +154 -177
  77. package/template/src/components/PinnedVideo.tsx +120 -207
  78. package/template/src/components/Precall.native.tsx +119 -358
  79. package/template/src/components/Precall.tsx +135 -269
  80. package/template/src/components/RTMConfigure.tsx +4 -27
  81. package/template/src/components/Router.electron.ts +0 -1
  82. package/template/src/components/Router.native.ts +0 -1
  83. package/template/src/components/Router.sdk.ts +0 -1
  84. package/template/src/components/Router.ts +0 -1
  85. package/template/src/components/Settings.tsx +95 -26
  86. package/template/src/components/SettingsView.tsx +56 -251
  87. package/template/src/components/Share.tsx +273 -302
  88. package/template/src/components/StorageContext.tsx +3 -30
  89. package/template/src/components/chat-messages/useChatMessages.tsx +23 -69
  90. package/template/src/components/chat-ui/useChatUIControl.tsx +0 -7
  91. package/template/src/components/common/Error.tsx +6 -20
  92. package/template/src/components/common/Logo.tsx +15 -16
  93. package/template/src/components/contexts/LiveStreamDataContext.tsx +5 -10
  94. package/template/src/components/contexts/VideoMeetingDataContext.tsx +7 -37
  95. package/template/src/components/livestream/LiveStreamContext.tsx +36 -270
  96. package/template/src/components/livestream/Types.ts +14 -39
  97. package/template/src/components/livestream/index.ts +0 -1
  98. package/template/src/components/livestream/views/LiveStreamControls.tsx +4 -12
  99. package/template/src/components/participants/AllAudienceParticipants.tsx +30 -101
  100. package/template/src/components/participants/AllHostParticipants.tsx +34 -103
  101. package/template/src/components/participants/MeParticipant.tsx +38 -0
  102. package/template/src/components/participants/ParticipantName.tsx +7 -13
  103. package/template/src/components/participants/ParticipantSectionTitle.tsx +10 -35
  104. package/template/src/components/participants/RemoteParticipants.tsx +71 -0
  105. package/template/src/components/participants/ScreenshareParticipants.tsx +12 -144
  106. package/template/src/components/precall/{LocalMute1.native.tsx → LocalMute.native.tsx} +5 -21
  107. package/template/src/components/precall/LocalMute.tsx +14 -84
  108. package/template/src/components/precall/VideoPreview.native.tsx +3 -48
  109. package/template/src/components/precall/VideoPreview.tsx +7 -163
  110. package/template/src/components/precall/joinCallBtn.tsx +2 -15
  111. package/template/src/components/precall/meetingTitle.tsx +12 -15
  112. package/template/src/components/precall/selectDevice.tsx +21 -1
  113. package/template/src/components/precall/textInput.tsx +4 -32
  114. package/template/src/components/precall/usePreCall.tsx +0 -16
  115. package/template/src/components/styles.ts +21 -42
  116. package/template/src/components/useShareLink.tsx +14 -12
  117. package/template/src/language/default-labels/precallScreenLabels.ts +3 -3
  118. package/template/src/pages/Authenticate.tsx +15 -5
  119. package/template/src/pages/Create.tsx +165 -293
  120. package/template/src/pages/Join.tsx +67 -93
  121. package/template/src/pages/VideoCall.tsx +64 -89
  122. package/template/src/pages/video-call/DefaultLayouts.ts +4 -4
  123. package/template/src/pages/video-call/NameWithMicIcon.tsx +44 -120
  124. package/template/src/pages/video-call/RenderComponent.tsx +2 -3
  125. package/template/src/pages/video-call/VideoCallScreen.tsx +9 -45
  126. package/template/src/pages/video-call/VideoComponent.tsx +3 -18
  127. package/template/src/pages/video-call/VideoRenderer.tsx +60 -218
  128. package/template/src/rtm-events/constants.ts +0 -2
  129. package/template/src/subComponents/ChatBubble.tsx +83 -123
  130. package/template/src/subComponents/ChatContainer.tsx +84 -257
  131. package/template/src/subComponents/ChatInput.tsx +46 -61
  132. package/template/src/subComponents/Checkbox.native.tsx +5 -16
  133. package/template/src/subComponents/Checkbox.tsx +2 -2
  134. package/template/src/subComponents/CopyJoinInfo.tsx +58 -36
  135. package/template/src/subComponents/FallbackLogo.tsx +40 -122
  136. package/template/src/subComponents/LanguageSelector.tsx +1 -1
  137. package/template/src/subComponents/{LayoutIconDropdown1.native.tsx → LayoutIconDropdown.native.tsx} +18 -4
  138. package/template/src/subComponents/LayoutIconDropdown.tsx +134 -131
  139. package/template/src/subComponents/LocalAudioMute.tsx +27 -119
  140. package/template/src/subComponents/LocalEndCall.tsx +33 -71
  141. package/template/src/subComponents/LocalSwitchCamera.tsx +30 -17
  142. package/template/src/subComponents/LocalVideoMute.tsx +27 -117
  143. package/template/src/subComponents/Logo.tsx +4 -3
  144. package/template/src/subComponents/LogoutButton.tsx +1 -1
  145. package/template/src/subComponents/NetworkQualityPill.tsx +63 -60
  146. package/template/src/subComponents/OpenInNativeButton.tsx +3 -3
  147. package/template/src/subComponents/Recording.tsx +29 -28
  148. package/template/src/subComponents/RemoteAudioMute.tsx +29 -83
  149. package/template/src/subComponents/RemoteEndCall.tsx +5 -8
  150. package/template/src/subComponents/RemoteVideoMute.tsx +21 -74
  151. package/template/src/subComponents/ScreenShareNotice.tsx +8 -83
  152. package/template/src/subComponents/SelectDevice.tsx +61 -404
  153. package/template/src/subComponents/SelectOAuth.tsx +8 -9
  154. package/template/src/subComponents/ToastConfig.tsx +10 -150
  155. package/template/src/subComponents/chat/ChatParticipants.tsx +78 -187
  156. package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +32 -95
  157. package/template/src/subComponents/livestream/controls/LocalRaiseHand.tsx +33 -29
  158. package/template/src/subComponents/livestream/controls/RemoteLiveStreamApprovedRequestRecall.tsx +6 -6
  159. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestApprove.tsx +11 -24
  160. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestReject.tsx +10 -17
  161. package/template/src/subComponents/recording/useRecording.tsx +27 -79
  162. package/template/src/subComponents/screenshare/ScreenshareButton.tsx +70 -52
  163. package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +2 -11
  164. package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +4 -26
  165. package/template/src/utils/common.tsx +1 -155
  166. package/template/src/utils/index.tsx +0 -19
  167. package/template/src/utils/isMobileOrTablet.ts +2 -7
  168. package/template/src/utils/useButtonTemplate.tsx +0 -1
  169. package/template/src/utils/useMuteToggleLocal.ts +3 -54
  170. package/template/web/index.html +0 -5
  171. package/template/webpack.commons.js +8 -13
  172. package/template/webpack.web.config.js +0 -1
  173. package/template/agora-rn-uikit/src/Reducer/ActiveSpeakerDetected.ts +0 -11
  174. package/template/agora-rn-uikit/src/Reducer/LocalPermissionState.ts +0 -24
  175. package/template/agora-rn-uikit/src/Reducer/UserPin.ts +0 -11
  176. package/template/android/app/src/main/assets/fonts/SourceSansPro-Regular.ttf +0 -0
  177. package/template/android/app/src/main/assets/fonts/icomoon.ttf +0 -0
  178. package/template/android/app/src/main/res/values/colors.xml +0 -7
  179. package/template/react-native-toast-message/src/components/checkbox.js +0 -178
  180. package/template/react-native.config.js +0 -7
  181. package/template/src/assets/font-styles.css +0 -329
  182. package/template/src/assets/fonts/SourceSansPro-Regular.ttf +0 -0
  183. package/template/src/assets/fonts/icomoon.ttf +0 -0
  184. package/template/src/assets/permission.png +0 -0
  185. package/template/src/assets/selection.json +0 -1
  186. package/template/src/atoms/ActionMenu.tsx +0 -236
  187. package/template/src/atoms/AnimatedActiveSpeaker.native.tsx +0 -71
  188. package/template/src/atoms/AnimatedActiveSpeaker.tsx +0 -84
  189. package/template/src/atoms/AnimatedRings.native.tsx +0 -68
  190. package/template/src/atoms/AnimatedRings.tsx +0 -70
  191. package/template/src/atoms/Card.tsx +0 -61
  192. package/template/src/atoms/CircularProgress.native.tsx +0 -121
  193. package/template/src/atoms/CircularProgress.tsx +0 -102
  194. package/template/src/atoms/CustomIcon.tsx +0 -88
  195. package/template/src/atoms/CustomSwitch.tsx +0 -287
  196. package/template/src/atoms/Dropdown.tsx +0 -306
  197. package/template/src/atoms/IconButton.tsx +0 -162
  198. package/template/src/atoms/ImageIcon.tsx +0 -98
  199. package/template/src/atoms/InfoBubble.tsx +0 -291
  200. package/template/src/atoms/Input.tsx +0 -87
  201. package/template/src/atoms/InviteInfo.tsx +0 -166
  202. package/template/src/atoms/LinkButton.tsx +0 -28
  203. package/template/src/atoms/OutlineButton.tsx +0 -61
  204. package/template/src/atoms/ParticipantsCount.tsx +0 -73
  205. package/template/src/atoms/Popup.tsx +0 -147
  206. package/template/src/atoms/RecordingInfo.tsx +0 -49
  207. package/template/src/atoms/Spacer.tsx +0 -22
  208. package/template/src/atoms/TertiaryButton.tsx +0 -78
  209. package/template/src/atoms/Toggle.tsx +0 -47
  210. package/template/src/atoms/Tooltip.native.tsx +0 -65
  211. package/template/src/atoms/Tooltip.tsx +0 -94
  212. package/template/src/atoms/UserAvatar.tsx +0 -60
  213. package/template/src/components/CommonStyles.ts +0 -44
  214. package/template/src/components/ToastComponent.tsx +0 -8
  215. package/template/src/components/participants/Participant.tsx +0 -302
  216. package/template/src/components/participants/UserActionMenuOptions.tsx +0 -398
  217. package/template/src/components/popups/InvitePopup.tsx +0 -115
  218. package/template/src/components/popups/StopRecordingPopup.tsx +0 -114
  219. package/template/src/components/precall/PermissionHelper.native.tsx +0 -5
  220. package/template/src/components/precall/PermissionHelper.tsx +0 -126
  221. package/template/src/components/precall/PreCallSettings.tsx +0 -52
  222. package/template/src/components/useToast.tsx +0 -41
  223. package/template/src/components/useVideoCall.tsx +0 -65
  224. package/template/src/pages/Endcall.tsx +0 -148
  225. package/template/src/pages/video-call/ActionSheet.native.tsx +0 -215
  226. package/template/src/pages/video-call/ActionSheet.tsx +0 -226
  227. package/template/src/pages/video-call/ActionSheetContent.tsx +0 -479
  228. package/template/src/pages/video-call/ActionSheetHandle.tsx +0 -38
  229. package/template/src/pages/video-call/ActionSheetStyles.css +0 -138
  230. package/template/src/pages/video-call/SidePanelHeader.tsx +0 -190
  231. package/template/src/pages/video-call/VideoCallMobileView.tsx +0 -139
  232. package/template/src/pages/video-call/VideoCallScreen.native.tsx +0 -37
  233. package/template/src/subComponents/ChatInput.ios.tsx +0 -237
  234. package/template/src/subComponents/EndcallPopup.tsx +0 -107
  235. package/template/src/subComponents/LayoutIconButton.tsx +0 -201
  236. package/template/src/subComponents/RemoteMutePopup.tsx +0 -193
  237. package/template/src/subComponents/RemoveMeetingPopup.tsx +0 -109
  238. package/template/src/subComponents/RemoveScreensharePopup.tsx +0 -109
  239. package/template/src/subComponents/SelectDeviceSettings.backup.tsx +0 -207
  240. package/template/src/subComponents/SidePanelHeader.tsx +0 -112
  241. package/template/src/theme/index.ts +0 -46
  242. package/template/src/utils/PlatformWrapper.tsx +0 -21
  243. package/template/src/utils/hexadecimalTransparency.ts +0 -108
  244. package/template/src/utils/pendingStateUpdateHelper.ts +0 -19
  245. package/template/src/utils/useFocus.tsx +0 -46
  246. package/template/src/utils/useIsActiveSpeaker.ts +0 -27
  247. package/template/src/utils/useIsHandRaised.ts +0 -13
  248. package/template/src/utils/useRemoteEndScreenshare.ts +0 -26
  249. package/template/src/utils/useRemoteRequest.ts +0 -84
@@ -10,51 +10,46 @@
10
10
  *********************************************
11
11
  */
12
12
  import React, {useContext} from 'react';
13
+ import {StyleSheet} from 'react-native';
13
14
  import LiveStreamContext, {
14
15
  RaiseHandValue,
15
16
  } from '../../../components/livestream';
17
+ import {PropsContext} from '../../../../agora-rn-uikit';
18
+ import {BtnTemplate} from '../../../../agora-rn-uikit';
19
+ import icons from '../../../assets/icons';
16
20
  import {useString} from '../../../utils/useString';
17
- import Styles from '../../../components/styles';
18
21
  import ChatContext from '../../../components/ChatContext';
19
- import IconButton from '../../../atoms/IconButton';
20
- import ThemeConfig from '../../../theme';
21
- import {ClientRole, PropsContext} from '../../../../agora-rn-uikit';
22
- import {useRender} from 'customization-api';
23
- import {isMobileUA} from '../../../utils/common';
24
22
 
25
- interface LocalRaiseHandProps {
26
- showLabel?: boolean;
27
- }
28
- const LocalRaiseHand = (props: LocalRaiseHandProps) => {
23
+ const LocalRaiseHand = () => {
24
+ const {styleProps} = useContext(PropsContext);
29
25
  const {audienceSendsRequest, audienceRecallsRequest, raiseHandList} =
30
26
  useContext(LiveStreamContext);
31
- const {rtcProps} = useContext(PropsContext);
32
27
  const {localUid} = useContext(ChatContext);
33
- const {activeUids} = useRender();
34
- const {showLabel = $config.ICON_TEXT} = props;
28
+ const {localBtnStyles} = styleProps || {};
29
+ const {theme} = styleProps || {};
30
+ const {muteLocalAudio} = localBtnStyles || {};
35
31
  //commented for v1 release
36
32
  //const handStatusText = useString<boolean>('raiseHandButton');
37
33
  const handStatusText = (toggle: boolean) =>
38
34
  toggle ? 'Lower hand' : 'Raise Hand';
39
- const isHandRasied = raiseHandList[localUid]?.raised === RaiseHandValue.TRUE;
40
35
  return (
41
- <IconButton
42
- iconProps={{
43
- name: isHandRasied ? 'lower-hand' : 'raise-hand',
44
- tintColor: isHandRasied
45
- ? $config.PRIMARY_ACTION_TEXT_COLOR
46
- : $config.SECONDARY_ACTION_COLOR,
47
- iconBackgroundColor: isHandRasied
48
- ? $config.PRIMARY_ACTION_BRAND_COLOR
49
- : '',
50
- base64: isMobileUA() ? true : false,
51
- }}
52
- btnTextProps={{
53
- text: showLabel ? handStatusText(isHandRasied) : '',
54
- textColor: $config.FONT_COLOR,
36
+ <BtnTemplate
37
+ icon={icons['raiseHandIcon']}
38
+ btnText={handStatusText(
39
+ raiseHandList[localUid]?.raised === RaiseHandValue.TRUE,
40
+ )}
41
+ color={
42
+ raiseHandList[localUid]?.raised === RaiseHandValue.TRUE
43
+ ? '#FD0845'
44
+ : theme
45
+ }
46
+ style={{
47
+ ...style.localBtn,
48
+ ...(localBtnStyles as object),
49
+ ...(muteLocalAudio as object),
55
50
  }}
56
51
  onPress={() => {
57
- if (isHandRasied) {
52
+ if (raiseHandList[localUid]?.raised === RaiseHandValue.TRUE) {
58
53
  audienceRecallsRequest();
59
54
  } else {
60
55
  audienceSendsRequest();
@@ -64,4 +59,13 @@ const LocalRaiseHand = (props: LocalRaiseHandProps) => {
64
59
  );
65
60
  };
66
61
 
62
+ const style = StyleSheet.create({
63
+ localBtn: {
64
+ borderRadius: 23,
65
+ borderWidth: 4 * StyleSheet.hairlineWidth,
66
+ borderColor: '#007aff',
67
+ backgroundColor: '#007aff',
68
+ },
69
+ });
70
+
67
71
  export default LocalRaiseHand;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import IconButton from '../../../atoms/IconButton';
3
- import {UidType} from '../../../../agora-rn-uikit';
2
+ import {BtnTemplate, UidType} from '../../../../agora-rn-uikit';
4
3
  import {LiveStreamControlMessageEnum} from '../../../components/livestream';
4
+ import icons from '../../../assets/icons';
5
5
  import events, {EventPersistLevel} from '../../../rtm-events-api';
6
6
 
7
7
  export interface RemoteLiveStreamApprovedRequestRecallProps {
@@ -11,7 +11,8 @@ const RemoteLiveStreamApprovedRequestRecall = (
11
11
  props: RemoteLiveStreamApprovedRequestRecallProps,
12
12
  ) => {
13
13
  return (
14
- <IconButton
14
+ <BtnTemplate
15
+ style={{width: 24, height: 22}}
15
16
  onPress={() => {
16
17
  events.send(
17
18
  LiveStreamControlMessageEnum.raiseHandRequestRejected,
@@ -20,9 +21,8 @@ const RemoteLiveStreamApprovedRequestRecall = (
20
21
  props.uid,
21
22
  );
22
23
  }}
23
- // color="#FD0845"
24
- //todo hari
25
- //icon={Icons['demoteIcon']}
24
+ color="#FD0845"
25
+ icon={icons['demoteIcon']}
26
26
  />
27
27
  );
28
28
  };
@@ -1,43 +1,30 @@
1
1
  import React, {useContext} from 'react';
2
2
  import {View} from 'react-native';
3
- import {PropsContext, UidType} from '../../../../agora-rn-uikit';
3
+ import {BtnTemplate, PropsContext, UidType} from '../../../../agora-rn-uikit';
4
4
  import LiveStreamContext from '../../../components/livestream';
5
- import PrimaryButton from '../../../atoms/PrimaryButton';
6
- import ThemeConfig from '../../../theme';
7
- import Toast from '../../../../react-native-toast-message';
5
+ import icons from '../../../assets/icons';
8
6
 
9
7
  export interface RemoteLiveStreamControlProps {
10
8
  uid: UidType;
11
- toastId: number;
12
9
  }
13
10
 
14
11
  const RemoteLiveStreamRequestApprove = (
15
12
  props: RemoteLiveStreamControlProps,
16
13
  ) => {
17
- const {uid, toastId} = props;
14
+ const {uid} = props;
18
15
  const {hostApprovesRequestOfUID} = useContext(LiveStreamContext);
16
+ const {styleProps} = useContext(PropsContext);
17
+ const {remoteBtnStyles} = styleProps || {};
18
+
19
+ const {liveStreamHostControlBtns} = remoteBtnStyles || {};
19
20
 
20
21
  return (
21
- <View style={{flex: 1}}>
22
- <PrimaryButton
23
- containerStyle={{
24
- minWidth: 'auto',
25
- borderRadius: ThemeConfig.BorderRadius.small,
26
- height: 38,
27
- paddingHorizontal: 8,
28
- paddingVertical: 8,
29
- }}
30
- textStyle={{
31
- fontWeight: '600',
32
- fontSize: 12,
33
- }}
22
+ <View style={{...(liveStreamHostControlBtns as object), marginRight: 15}}>
23
+ <BtnTemplate
34
24
  disabled={!uid}
35
- text={'Accept'}
25
+ icon={icons['checkCircleIcon']}
26
+ style={{...(liveStreamHostControlBtns as object)}}
36
27
  onPress={() => {
37
- //Hiding the toast if its get approved in the participant panel
38
- if (Toast.getToastId() === toastId) {
39
- Toast.hide();
40
- }
41
28
  hostApprovesRequestOfUID(uid);
42
29
  }}
43
30
  />
@@ -1,36 +1,29 @@
1
1
  import React, {useContext} from 'react';
2
2
  import {View} from 'react-native';
3
- import {PropsContext, UidType} from '../../../../agora-rn-uikit';
3
+ import {BtnTemplate, PropsContext, UidType} from '../../../../agora-rn-uikit';
4
4
  import LiveStreamContext from '../../../components/livestream';
5
- import TertiaryButton from '../../../atoms/TertiaryButton';
6
- import Toast from '../../../../react-native-toast-message';
5
+ import icons from '../../../assets/icons';
7
6
 
8
7
  interface RemoteLiveStreamControlProps {
9
8
  uid: UidType;
10
- toastId: number;
11
9
  }
12
10
 
13
11
  const RemoteLiveStreamRequestReject = (props: RemoteLiveStreamControlProps) => {
14
- const {uid, toastId} = props;
12
+ const {uid} = props;
15
13
  const {hostRejectsRequestOfUID} = useContext(LiveStreamContext);
14
+ const {styleProps} = useContext(PropsContext);
15
+ const {remoteBtnStyles} = styleProps || {};
16
+ const {liveStreamHostControlBtns} = remoteBtnStyles || {};
16
17
 
17
18
  return (
18
- <View style={{flex: 1}}>
19
- <TertiaryButton
20
- containerStyle={{
21
- paddingHorizontal: 8,
22
- paddingVertical: 8,
23
- height: 38,
24
- }}
19
+ <View style={{...(liveStreamHostControlBtns as object)}}>
20
+ <BtnTemplate
25
21
  disabled={!uid}
22
+ icon={icons['crossCircleIcon']}
23
+ style={{...(liveStreamHostControlBtns as object)}}
26
24
  onPress={() => {
27
- //Hiding the toast if its get rejected in the participant panel
28
- if (Toast.getToastId() === toastId) {
29
- Toast.hide();
30
- }
31
25
  hostRejectsRequestOfUID(uid);
32
26
  }}
33
- text={'DENY'}
34
27
  />
35
28
  </View>
36
29
  );
@@ -15,7 +15,6 @@ import React, {
15
15
  useContext,
16
16
  useEffect,
17
17
  useRef,
18
- useState,
19
18
  } from 'react';
20
19
  import {gql, useMutation} from '@apollo/client';
21
20
  import {useParams} from '../../components/Router';
@@ -28,21 +27,17 @@ import events, {EventPersistLevel} from '../../rtm-events-api';
28
27
  import {EventActions, EventNames} from '../../rtm-events';
29
28
  import useRecordingLayoutQuery from './useRecordingLayoutQuery';
30
29
  import {useScreenContext} from '../../components/contexts/ScreenShareContext';
31
- import {useRender} from 'customization-api';
32
- import {trimText} from '../../utils/common';
33
30
 
34
31
  export interface RecordingContextInterface {
35
32
  startRecording: () => void;
36
33
  stopRecording: () => void;
37
34
  isRecordingActive: boolean;
38
- inProgress: boolean;
39
35
  }
40
36
 
41
37
  const RecordingContext = createContext<RecordingContextInterface>({
42
38
  startRecording: () => {},
43
39
  stopRecording: () => {},
44
40
  isRecordingActive: false,
45
- inProgress: false,
46
41
  });
47
42
 
48
43
  const START_RECORDING = gql`
@@ -87,9 +82,6 @@ interface RecordingProviderProps {
87
82
  const RecordingProvider = (props: RecordingProviderProps) => {
88
83
  const {rtcProps} = useContext(PropsContext);
89
84
  const {setRecordingActive, isRecordingActive} = props?.value;
90
- const [inProgress, setInProgress] = useState(false);
91
- const [uidWhoStarted, setUidWhoStarted] = useState(0);
92
- const {renderList, activeUids} = useRender();
93
85
  const {phrase} = useParams<{phrase: string}>();
94
86
  const [startRecordingQuery] = useMutation(START_RECORDING);
95
87
  const [stopRecordingQuery] = useMutation(STOP_RECORDING);
@@ -109,17 +101,14 @@ const RecordingProvider = (props: RecordingProviderProps) => {
109
101
  const payload = JSON.parse(data.payload);
110
102
  const action = payload.action;
111
103
  const value = payload.value;
104
+
112
105
  switch (action) {
113
106
  case EventActions.RECORDING_STARTED:
114
- setUidWhoStarted(parseInt(value));
115
107
  setRecordingActive(true);
116
108
  break;
117
109
  case EventActions.RECORDING_STOPPED:
118
110
  setRecordingActive(false);
119
111
  break;
120
- case EventActions.RECORDING_STOP_REQUEST:
121
- stopRecording();
122
- break;
123
112
  default:
124
113
  break;
125
114
  }
@@ -139,22 +128,14 @@ const RecordingProvider = (props: RecordingProviderProps) => {
139
128
  if (prevRecordingState) {
140
129
  if (prevRecordingState?.isRecordingActive === isRecordingActive) return;
141
130
  Toast.show({
142
- type: 'info',
131
+ type: 'success',
143
132
  text1: recordingStartedText(isRecordingActive),
144
- text2: isRecordingActive
145
- ? `This meeting is being recorded by ${
146
- trimText(renderList[uidWhoStarted]?.name) || 'user'
147
- }`
148
- : '',
149
- visibilityTime: 3000,
150
- primaryBtn: null,
151
- secondaryBtn: null,
133
+ visibilityTime: 1000,
152
134
  });
153
135
  }
154
136
  }, [isRecordingActive]);
155
137
 
156
138
  const startRecording = () => {
157
- setInProgress(true);
158
139
  // If recording is not going on, start the recording by executing the graphql query
159
140
  startRecordingQuery({
160
141
  variables: {
@@ -167,7 +148,6 @@ const RecordingProvider = (props: RecordingProviderProps) => {
167
148
  })
168
149
  .then((res) => {
169
150
  console.log(res.data);
170
- setInProgress(false);
171
151
  if (res.data.startRecordingSession === 'success') {
172
152
  /**
173
153
  * 1. Once the backend sucessfuly starts recording, send message
@@ -182,7 +162,6 @@ const RecordingProvider = (props: RecordingProviderProps) => {
182
162
  EventPersistLevel.LEVEL3,
183
163
  );
184
164
  // 2. set the local recording state to true to update the UI
185
- setUidWhoStarted(localUid);
186
165
  setRecordingActive(true);
187
166
  // 3. set the presenter mode if screen share is active
188
167
  // 3.a Get the most recent screenshare uid
@@ -203,71 +182,40 @@ const RecordingProvider = (props: RecordingProviderProps) => {
203
182
  }
204
183
  })
205
184
  .catch((err) => {
206
- setInProgress(false);
207
185
  console.log(err);
208
186
  });
209
187
  };
210
188
 
211
189
  const stopRecording = () => {
212
- /**
213
- * if condition added for below issue
214
- *
215
- * user 1 and user 2 in the call
216
- * user 1 start the recording
217
- * user 2 stops the recording
218
- * user 2 join the call getting stop recording notification which is not needed
219
- *
220
- * solution
221
- * case 1 - if recording is not started by the host then we will send level1 message to host who started the recording
222
- * case 2 - if person who started the recording no longer available in the call then will stop the recording
223
- */
224
- if (
225
- localUid === uidWhoStarted ||
226
- activeUids.indexOf(uidWhoStarted) === -1
227
- ) {
228
- setInProgress(true);
229
- // If recording is already going on, stop the recording by executing the graphql query.
230
- stopRecordingQuery({variables: {passphrase: phrase}})
231
- .then((res) => {
232
- console.log(res.data);
233
- setInProgress(false);
234
- if (res.data.stopRecordingSession === 'success') {
235
- /**
236
- * 1. Once the backend sucessfuly starts recording, send message
237
- * in the channel indicating that cloud recording is now inactive.
238
- */
239
- events.send(
240
- EventNames.RECORDING_ATTRIBUTE,
241
- JSON.stringify({
242
- action: EventActions.RECORDING_STOPPED,
243
- value: '',
244
- }),
245
- EventPersistLevel.LEVEL3,
246
- );
247
- // 2. set the local recording state to false to update the UI
248
- setRecordingActive(false);
249
- }
250
- })
251
- .catch((err) => {
252
- setInProgress(false);
253
- console.log(err);
254
- });
255
- } else {
256
- events.send(
257
- EventNames.RECORDING_ATTRIBUTE,
258
- JSON.stringify({
259
- action: EventActions.RECORDING_STOP_REQUEST,
260
- value: '',
261
- }),
262
- EventPersistLevel.LEVEL1,
263
- );
264
- }
190
+ // If recording is already going on, stop the recording by executing the graphql query.
191
+ stopRecordingQuery({variables: {passphrase: phrase}})
192
+ .then((res) => {
193
+ console.log(res.data);
194
+ if (res.data.stopRecordingSession === 'success') {
195
+ /**
196
+ * 1. Once the backend sucessfuly starts recording, send message
197
+ * in the channel indicating that cloud recording is now inactive.
198
+ */
199
+ events.send(
200
+ EventNames.RECORDING_ATTRIBUTE,
201
+ JSON.stringify({
202
+ action: EventActions.RECORDING_STOPPED,
203
+ value: '',
204
+ }),
205
+ EventPersistLevel.LEVEL3,
206
+ );
207
+ // 2. set the local recording state to false to update the UI
208
+ setRecordingActive(false);
209
+ }
210
+ })
211
+ .catch((err) => {
212
+ console.log(err);
213
+ });
265
214
  };
266
215
 
267
216
  return (
268
217
  <RecordingContext.Provider
269
218
  value={{
270
- inProgress,
271
219
  startRecording,
272
220
  stopRecording,
273
221
  isRecordingActive,
@@ -9,16 +9,15 @@
9
9
  information visit https://appbuilder.agora.io.
10
10
  *********************************************
11
11
  */
12
- import React, {useContext} from 'react';
13
- import ThemeConfig from '../../theme';
14
- import IconButton, {IconButtonProps} from '../../atoms/IconButton';
15
- import Styles from '../../components/styles';
12
+ import React from 'react';
13
+ import {StyleSheet} from 'react-native';
14
+ import {BtnTemplate, BtnTemplateInterface} from '../../../agora-rn-uikit';
16
15
  import {useString} from '../../utils/useString';
17
16
  import {useScreenshare} from './useScreenshare';
18
- import hexadecimalTransparency from '../../utils/hexadecimalTransparency';
19
- import {PropsContext, ClientRole} from '../../../agora-rn-uikit';
20
- import {useLocalUserInfo, useMeetingInfo} from 'customization-api';
21
- import useIsHandRaised from '../../utils/useIsHandRaised';
17
+ import {
18
+ ButtonTemplateName,
19
+ useButtonTemplate,
20
+ } from '../../utils/useButtonTemplate';
22
21
  /**
23
22
  * A component to start and stop screen sharing on web clients.
24
23
  * Screen sharing is not yet implemented on mobile platforms.
@@ -26,67 +25,86 @@ import useIsHandRaised from '../../utils/useIsHandRaised';
26
25
  */
27
26
 
28
27
  export interface ScreenshareButtonProps {
29
- render?: (onPress: () => void, isScreenshareActive: boolean) => JSX.Element;
28
+ buttonTemplateName?: ButtonTemplateName;
29
+ render?: (
30
+ onPress: () => void,
31
+ isScreenshareActive: boolean,
32
+ buttonTemplateName?: ButtonTemplateName,
33
+ ) => JSX.Element;
30
34
  }
31
35
 
32
36
  const ScreenshareButton = (props: ScreenshareButtonProps) => {
33
- const {rtcProps} = useContext(PropsContext);
34
- const {
35
- data: {isHost},
36
- } = useMeetingInfo();
37
- const local = useLocalUserInfo();
38
- const isHandRaised = useIsHandRaised();
39
37
  const {isScreenshareActive, startUserScreenshare, stopUserScreenShare} =
40
38
  useScreenshare();
41
39
  //commented for v1 release
42
40
  //const screenShareButton = useString('screenShareButton')();
43
-
41
+ const screenShareButton = 'Share';
42
+ const defaultTemplateValue = useButtonTemplate().buttonTemplateName;
43
+ const {buttonTemplateName = defaultTemplateValue} = props;
44
44
  const onPress = () =>
45
45
  isScreenshareActive ? stopUserScreenShare() : startUserScreenshare();
46
- const screenShareButton = isScreenshareActive ? 'Stop Share' : 'Share';
47
- let iconButtonProps: IconButtonProps = {
48
- iconProps: {
49
- name: isScreenshareActive ? 'stop-screen-share' : 'screen-share',
50
- tintColor: isScreenshareActive
51
- ? $config.SEMANTIC_ERROR
52
- : $config.SECONDARY_ACTION_COLOR,
53
- },
46
+ let btnTemplateProps: BtnTemplateInterface = {
47
+ name: isScreenshareActive ? 'screenshareOffIcon' : 'screenshareIcon',
54
48
  onPress,
55
- btnTextProps: {
56
- text: $config.ICON_TEXT ? screenShareButton : '',
57
- textColor: $config.FONT_COLOR,
58
- },
59
49
  };
60
50
 
61
- if (
62
- rtcProps.role == ClientRole.Audience &&
63
- $config.EVENT_MODE &&
64
- !$config.RAISE_HAND
65
- ) {
66
- return null;
67
- }
68
-
69
- if (
70
- rtcProps.role == ClientRole.Audience &&
71
- $config.EVENT_MODE &&
72
- $config.RAISE_HAND &&
73
- !isHost
74
- ) {
75
- iconButtonProps.iconProps = {
76
- ...iconButtonProps.iconProps,
77
- tintColor: $config.SEMANTIC_NEUTRAL,
78
- };
79
- iconButtonProps.toolTipMessage = isHandRaised(local.uid)
80
- ? 'Waiting for host to appove the request'
81
- : 'Raise Hand in order to present';
82
- iconButtonProps.disabled = true;
51
+ if (buttonTemplateName === ButtonTemplateName.topBar) {
52
+ btnTemplateProps.style = isScreenshareActive
53
+ ? (style.activeBtn as Object)
54
+ : (style.nonActiveBtn as Object);
55
+ } else {
56
+ btnTemplateProps.btnText = screenShareButton;
57
+ btnTemplateProps.style = isScreenshareActive
58
+ ? style.greenLocalButton
59
+ : style.localButton;
83
60
  }
84
61
 
85
62
  return props?.render ? (
86
- props.render(onPress, isScreenshareActive)
63
+ props.render(onPress, isScreenshareActive, buttonTemplateName)
87
64
  ) : (
88
- <IconButton {...iconButtonProps} />
65
+ <BtnTemplate {...btnTemplateProps} />
89
66
  );
90
67
  };
91
68
 
69
+ const style = StyleSheet.create({
70
+ localButton: {
71
+ backgroundColor: $config.SECONDARY_FONT_COLOR,
72
+ borderRadius: 20,
73
+ borderColor: $config.PRIMARY_COLOR,
74
+ width: 40,
75
+ height: 40,
76
+ display: 'flex',
77
+ alignSelf: 'center',
78
+ alignItems: 'center',
79
+ justifyContent: 'center',
80
+ },
81
+ activeBtn: {
82
+ backgroundColor: '#4BEB5B',
83
+ borderRadius: 20,
84
+ borderColor: '#F86051',
85
+ width: '100%',
86
+ height: '100%',
87
+ resizeMode: 'contain',
88
+ },
89
+ nonActiveBtn: {
90
+ width: '100%',
91
+ height: '100%',
92
+ resizeMode: 'contain',
93
+ },
94
+ greenLocalButton: {
95
+ backgroundColor: '#4BEB5B',
96
+ borderRadius: 20,
97
+ borderColor: '#F86051',
98
+ width: 40,
99
+ height: 40,
100
+ alignSelf: 'center',
101
+ alignItems: 'center',
102
+ justifyContent: 'center',
103
+ },
104
+ buttonIcon: {
105
+ width: '90%',
106
+ height: '90%',
107
+ },
108
+ });
109
+
92
110
  export default ScreenshareButton;
@@ -27,7 +27,7 @@ import {filterObject} from '../../utils';
27
27
 
28
28
  export const ScreenshareConfigure = (props: {children: React.ReactNode}) => {
29
29
  const {dispatch} = useRtc();
30
- const {renderList, activeUids, lastJoinedUid, pinnedUid} = useRender();
30
+ const {renderList, activeUids, lastJoinedUid} = useRender();
31
31
  const isPinned = useRef(0);
32
32
  const {setScreenShareData, screenShareData} = useScreenContext();
33
33
  // commented for v1 release
@@ -41,12 +41,6 @@ export const ScreenshareConfigure = (props: {children: React.ReactNode}) => {
41
41
  const renderListRef = useRef({renderList: renderList});
42
42
  const currentLayoutRef = useRef({currentLayout: currentLayout});
43
43
 
44
- const pinnedUidRef = useRef({pinnedUid: pinnedUid});
45
-
46
- useEffect(() => {
47
- pinnedUidRef.current.pinnedUid = pinnedUid;
48
- }, [pinnedUid]);
49
-
50
44
  useEffect(() => {
51
45
  renderListRef.current.renderList = renderList;
52
46
  }, [renderList]);
@@ -125,10 +119,7 @@ export const ScreenshareConfigure = (props: {children: React.ReactNode}) => {
125
119
  };
126
120
  });
127
121
  //if remote user started/stopped the screenshare then change the layout to pinned/grid
128
- //if user pinned somebody then don't triggerlayout change
129
- if (!pinnedUidRef.current.pinnedUid) {
130
- triggerChangeLayout(false);
131
- }
122
+ triggerChangeLayout(false);
132
123
  break;
133
124
  default:
134
125
  break;
@@ -26,12 +26,7 @@ import {IAgoraRTC} from 'agora-rtc-sdk-ng';
26
26
  import useRecordingLayoutQuery from '../recording/useRecordingLayoutQuery';
27
27
  import {useString} from '../../utils/useString';
28
28
  import {timeNow} from '../../rtm/utils';
29
- import {
30
- controlMessageEnum,
31
- useLayout,
32
- useRender,
33
- useRtc,
34
- } from 'customization-api';
29
+ import {useLayout, useRender, useRtc} from 'customization-api';
35
30
  import {filterObject} from '../../utils';
36
31
 
37
32
  export const ScreenshareContextConsumer = ScreenshareContext.Consumer;
@@ -40,7 +35,7 @@ export const ScreenshareConfigure = (props: {children: React.ReactNode}) => {
40
35
  const [isScreenshareActive, setScreenshareActive] = useState(false);
41
36
  const rtc = useRtc();
42
37
  const {dispatch} = rtc;
43
- const {renderList, activeUids, lastJoinedUid, pinnedUid} = useRender();
38
+ const {renderList, activeUids, lastJoinedUid} = useRender();
44
39
  const isPinned = useRef(0);
45
40
  const {isRecordingActive} = useRecording();
46
41
  const {executeNormalQuery, executePresenterQuery} = useRecordingLayoutQuery();
@@ -59,11 +54,6 @@ export const ScreenshareConfigure = (props: {children: React.ReactNode}) => {
59
54
  useContext(PropsContext).rtcProps;
60
55
 
61
56
  const renderListRef = useRef({renderList: renderList});
62
- const pinnedUidRef = useRef({pinnedUid: pinnedUid});
63
-
64
- useEffect(() => {
65
- pinnedUidRef.current.pinnedUid = pinnedUid;
66
- }, [pinnedUid]);
67
57
 
68
58
  useEffect(() => {
69
59
  renderListRef.current.renderList = renderList;
@@ -119,12 +109,6 @@ export const ScreenshareConfigure = (props: {children: React.ReactNode}) => {
119
109
  };
120
110
 
121
111
  useEffect(() => {
122
- events.on(controlMessageEnum.kickScreenshare, () => {
123
- //if screenscreen already active. then below method will stop the screen share
124
- // @ts-ignore
125
- rtc.RtcEngine.startScreenshare();
126
- });
127
-
128
112
  events.on(EventNames.SCREENSHARE_ATTRIBUTE, (data) => {
129
113
  const payload = JSON.parse(data.payload);
130
114
  const action = payload.action;
@@ -157,10 +141,7 @@ export const ScreenshareConfigure = (props: {children: React.ReactNode}) => {
157
141
  };
158
142
  });
159
143
  //if remote user started/stopped the screenshare then change the layout to pinned/grid
160
- //if user pinned somebody then don't triggerlayout change
161
- if (!pinnedUidRef.current.pinnedUid) {
162
- triggerChangeLayout(false);
163
- }
144
+ triggerChangeLayout(false);
164
145
  break;
165
146
  default:
166
147
  break;
@@ -193,10 +174,7 @@ export const ScreenshareConfigure = (props: {children: React.ReactNode}) => {
193
174
  };
194
175
  });
195
176
  //if local user stopped the screenshare then change layout to grid
196
- //if user pinned somebody then don't triggerlayout change
197
- if (!pinnedUidRef.current.pinnedUid) {
198
- triggerChangeLayout(false);
199
- }
177
+ triggerChangeLayout(false);
200
178
  });
201
179
  }, []);
202
180