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
@@ -9,152 +9,20 @@
9
9
  information visit https://appbuilder.agora.io.
10
10
  *********************************************
11
11
  */
12
- import React, {useRef, useState} from 'react';
13
- import {View, Text, StyleSheet, TouchableOpacity} from 'react-native';
14
- import ThemeConfig from '../../theme';
15
- import UserAvatar from '../../atoms/UserAvatar';
16
- import hexadecimalTransparency from '../../utils/hexadecimalTransparency';
17
- import {RenderInterface} from 'customization-api';
18
- import {isWebInternal, isMobileUA} from '../../utils/common';
19
- import IconButton from '../../atoms/IconButton';
20
- import UserActionMenuOptionsOptions from './UserActionMenuOptions';
12
+ import React from 'react';
13
+ import {View, Text} from 'react-native';
14
+ import ParticipantName from './ParticipantName';
21
15
 
22
- const ScreenshareParticipants = (props: {user: RenderInterface}) => {
23
- const screenshareRef = useRef();
24
- const [isHovered, setIsHovered] = useState(false);
25
- const [actionMenuVisible, setActionMenuVisible] = useState(false);
26
-
27
- const showModal = () => {
28
- setActionMenuVisible((state) => !state);
29
- };
16
+ const ScreenshareParticipants = (props: any) => {
17
+ const {p_styles, name} = props;
30
18
  return (
31
- <>
32
- {/* {renderActionMenu()} */}
33
- <UserActionMenuOptionsOptions
34
- actionMenuVisible={actionMenuVisible}
35
- setActionMenuVisible={setActionMenuVisible}
36
- user={props.user}
37
- btnRef={screenshareRef}
38
- from={'screenshare-participant'}
39
- />
40
- <PlatformWrapper showModal={showModal} setIsHovered={setIsHovered}>
41
- <View style={styles.container}>
42
- <View style={styles.userInfoContainer}>
43
- <View style={styles.bgContainerStyle}>
44
- <UserAvatar
45
- name={props.user.name}
46
- containerStyle={styles.containerStyle}
47
- textStyle={styles.textStyle}
48
- />
49
- </View>
50
- <View style={{alignSelf: 'center'}}>
51
- <Text style={styles.participantNameText}>{props.user.name}</Text>
52
- </View>
53
- </View>
54
- {true ? (
55
- <View
56
- style={styles.iconContainer}
57
- ref={screenshareRef}
58
- collapsable={false}>
59
- {isHovered || actionMenuVisible || isMobileUA() ? (
60
- //todo mobile by default it should show
61
- <View
62
- style={{
63
- width: 24,
64
- height: 24,
65
- alignSelf: 'center',
66
- justifyContent: 'center',
67
- alignItems: 'center',
68
- borderRadius: 20,
69
- }}>
70
- <IconButton
71
- hoverEffect={true}
72
- hoverEffectStyle={{
73
- backgroundColor:
74
- $config.CARD_LAYER_5_COLOR +
75
- hexadecimalTransparency['20%'],
76
- borderRadius: 20,
77
- padding: 5,
78
- }}
79
- iconProps={{
80
- iconType: 'plain',
81
- name: 'more-menu',
82
- iconSize: 20,
83
- tintColor: $config.SECONDARY_ACTION_COLOR,
84
- }}
85
- onPress={() => {
86
- showModal();
87
- }}
88
- />
89
- </View>
90
- ) : (
91
- <></>
92
- )}
93
- </View>
94
- ) : (
95
- <></>
96
- )}
97
- </View>
98
- </PlatformWrapper>
99
- </>
19
+ <View style={p_styles.participantRow}>
20
+ <ParticipantName value={name} />
21
+ <View style={p_styles.dummyView}>
22
+ {/** its just the placeholder to adjust the UI. if no icon option to be shown */}
23
+ <Text>local screen sharing</Text>
24
+ </View>
25
+ </View>
100
26
  );
101
27
  };
102
28
  export default ScreenshareParticipants;
103
-
104
- const PlatformWrapper = ({children, showModal, setIsHovered}) => {
105
- return isWebInternal() ? (
106
- <div
107
- onMouseEnter={() => {
108
- setIsHovered(true);
109
- }}
110
- onMouseLeave={() => {
111
- setIsHovered(false);
112
- }}>
113
- {children}
114
- </div>
115
- ) : (
116
- <>{children}</>
117
- );
118
- };
119
-
120
- const styles = StyleSheet.create({
121
- bgContainerStyle: {
122
- backgroundColor: $config.VIDEO_AUDIO_TILE_AVATAR_COLOR,
123
- width: 36,
124
- height: 36,
125
- borderRadius: 18,
126
- marginRight: 8,
127
- },
128
- containerStyle: {
129
- width: 36,
130
- height: 36,
131
- borderRadius: 18,
132
- },
133
- textStyle: {
134
- fontSize: ThemeConfig.FontSize.tiny,
135
- lineHeight: 10,
136
- fontWeight: '400',
137
- color: $config.CARD_LAYER_1_COLOR,
138
- },
139
- participantNameText: {
140
- fontWeight: '400',
141
- fontSize: 12,
142
- lineHeight: 15,
143
- fontFamily: ThemeConfig.FontFamily.sansPro,
144
- flexDirection: 'row',
145
- color: $config.FONT_COLOR,
146
- textAlign: 'left',
147
- },
148
- container: {
149
- flexDirection: 'row',
150
- justifyContent: 'space-between',
151
- paddingHorizontal: 20,
152
- paddingVertical: 8,
153
- },
154
- userInfoContainer: {
155
- flexDirection: 'row',
156
- },
157
- iconContainer: {
158
- flexDirection: 'row',
159
- },
160
- });
@@ -10,7 +10,7 @@
10
10
  *********************************************
11
11
  */
12
12
  import React from 'react';
13
- import {View, StyleSheet, Text} from 'react-native';
13
+ import {View, StyleSheet} from 'react-native';
14
14
  import {useCustomization} from 'customization-implementation';
15
15
  import {isValidReactComponent} from '../../utils/common';
16
16
  import LocalAudioMute, {
@@ -22,7 +22,6 @@ import LocalVideoMute, {
22
22
  import LocalSwitchCamera, {
23
23
  LocalSwitchCameraProps,
24
24
  } from '../../subComponents/LocalSwitchCamera';
25
- import hexadecimalTransparency from '../../utils/hexadecimalTransparency';
26
25
 
27
26
  const PreCallLocalMute: React.FC = () => {
28
27
  const {VideoMute, AudioMute} = useCustomization((data) => {
@@ -64,18 +63,9 @@ const PreCallLocalMute: React.FC = () => {
64
63
  // }
65
64
  return components;
66
65
  });
67
-
68
66
  return (
69
- <View style={style.precallControls} testID="precall-controls">
70
- {!$config.AUDIO_ROOM && (
71
- <View style={{alignSelf: 'center', marginRight: 30}}>
72
- <VideoMute />
73
- </View>
74
- )}
75
- <View style={{alignSelf: 'center'}}>
76
- <AudioMute />
77
- </View>
78
- {/* <View style={style.width50}>
67
+ <>
68
+ <View style={style.width50}>
79
69
  <AudioMute />
80
70
  </View>
81
71
  {!$config.AUDIO_ROOM && (
@@ -89,8 +79,8 @@ const PreCallLocalMute: React.FC = () => {
89
79
  <LocalSwitchCamera />
90
80
  </View>
91
81
  </>
92
- )} */}
93
- </View>
82
+ )}
83
+ </>
94
84
  );
95
85
  };
96
86
  export const PreCallLocalMuteComponentsArray: [
@@ -102,10 +92,4 @@ export default PreCallLocalMute;
102
92
 
103
93
  const style = StyleSheet.create({
104
94
  width50: {width: 50},
105
- precallControls: {
106
- flexDirection: 'row',
107
- paddingVertical: 10,
108
- justifyContent: 'center',
109
- backgroundColor: $config.CARD_LAYER_1_COLOR,
110
- },
111
95
  });
@@ -9,28 +9,18 @@
9
9
  information visit https://appbuilder.agora.io.
10
10
  *********************************************
11
11
  */
12
- import React, {useState, useEffect, useContext} from 'react';
12
+ import React from 'react';
13
13
  import {View, StyleSheet} from 'react-native';
14
14
  import {useCustomization} from 'customization-implementation';
15
- import {
16
- isAndroid,
17
- isIOS,
18
- isMobileUA,
19
- isValidReactComponent,
20
- } from '../../utils/common';
15
+ import {isValidReactComponent} from '../../utils/common';
21
16
  import LocalVideoMute, {
22
17
  LocalVideoMuteProps,
23
18
  } from '../../subComponents/LocalVideoMute';
24
19
  import LocalAudioMute, {
25
20
  LocalAudioMuteProps,
26
21
  } from '../../subComponents/LocalAudioMute';
27
- import hexadecimalTransparency from '../../utils/hexadecimalTransparency';
28
- import PreCallSettings from './PreCallSettings';
29
- import Spacer from '../../atoms/Spacer';
30
- import {usePreCall} from './usePreCall';
31
- import DeviceContext from '../DeviceContext';
32
22
 
33
- const PreCallLocalMute = (props: {isMobileView?: boolean}) => {
23
+ const PreCallLocalMute: React.FC = () => {
34
24
  const {VideoMute, AudioMute} = useCustomization((data) => {
35
25
  let components: {
36
26
  VideoMute: React.ComponentType<LocalAudioMuteProps>;
@@ -70,74 +60,15 @@ const PreCallLocalMute = (props: {isMobileView?: boolean}) => {
70
60
  // }
71
61
  return components;
72
62
  });
73
- const {isMobileView = false} = props;
74
- const isNative = isAndroid() || isIOS();
75
- // for mweb check for camera * mic availablity for desktop it happens in settings panel
76
- // refactor later to set mic/camera availablity oustside settings panel <selectDevice>
77
- const {deviceList} = useContext(DeviceContext);
78
- const {setCameraAvailable, setMicAvailable} = usePreCall();
79
- const audioDevices = deviceList.filter((device) => {
80
- if (device.kind === 'audioinput') {
81
- return true;
82
- }
83
- });
84
- const videoDevices = deviceList.filter((device) => {
85
- if (device.kind === 'videoinput') {
86
- return true;
87
- }
88
- });
89
- useEffect(() => {
90
- if (audioDevices && audioDevices.length) {
91
- isMobileView && !isNative && setMicAvailable(true);
92
- }
93
- }, [audioDevices]);
94
-
95
- useEffect(() => {
96
- if (videoDevices && videoDevices.length) {
97
- isMobileView && !isNative && setCameraAvailable(true);
98
- }
99
- }, [videoDevices]);
100
63
  return (
101
- <View
102
- style={[style.precallControls, isMobileView && {paddingVertical: 10}]}
103
- testID="precall-controls">
104
- <View style={{width: 52, height: 52}}>
105
- <AudioMute
106
- isMobileView={isMobileView}
107
- showLabel={isMobileUA() ? !isMobileView : $config.ICON_TEXT}
108
- showToolTip={true}
109
- />
64
+ <View style={style.precallControls}>
65
+ <View style={{alignSelf: 'center'}}>
66
+ <AudioMute />
110
67
  </View>
111
-
112
68
  {!$config.AUDIO_ROOM && (
113
- <>
114
- <Spacer size={isMobileView ? 24 : 16} horizontal={true} />
115
- <View
116
- style={{
117
- width: 52,
118
- height: 52,
119
- }}>
120
- <VideoMute
121
- isMobileView={isMobileView}
122
- showLabel={isMobileUA() ? !isMobileView : $config.ICON_TEXT}
123
- showToolTip={true}
124
- />
125
- </View>
126
- </>
127
- )}
128
-
129
- {/* Settings View in Mobile */}
130
- {isMobileView && !isNative && (
131
- <>
132
- <Spacer size={isMobileView ? 24 : 16} horizontal={true} />
133
- <View
134
- style={{
135
- width: 52,
136
- height: 52,
137
- }}>
138
- <PreCallSettings />
139
- </View>
140
- </>
69
+ <View style={{alignSelf: 'center'}}>
70
+ <VideoMute />
71
+ </View>
141
72
  )}
142
73
  </View>
143
74
  );
@@ -152,11 +83,10 @@ export default PreCallLocalMute;
152
83
  const style = StyleSheet.create({
153
84
  precallControls: {
154
85
  flexDirection: 'row',
155
- paddingVertical: 32,
156
- justifyContent: 'center',
157
- alignItems: 'center',
158
- backgroundColor: $config.CARD_LAYER_1_COLOR,
159
- // borderBottomLeftRadius: 4,
160
- // borderBottomRightRadius: 4,
86
+ alignSelf: 'center',
87
+ padding: 10,
88
+ width: '40%',
89
+ justifyContent: 'space-around',
90
+ marginVertical: '5%',
161
91
  },
162
92
  });
@@ -12,10 +12,8 @@
12
12
 
13
13
  import {useRender, useRtc} from 'customization-api';
14
14
  import React from 'react';
15
- import {View, StyleSheet} from 'react-native';
15
+ import {View} from 'react-native';
16
16
  import {MaxVideoView} from '../../../agora-rn-uikit';
17
- import PreCallLocalMute from './LocalMute';
18
- import {ImageIcon as UiKitImageIcon} from '../../../agora-rn-uikit';
19
17
 
20
18
  const VideoPreview: React.FC = () => {
21
19
  const rtc = useRtc();
@@ -29,52 +27,9 @@ const VideoPreview: React.FC = () => {
29
27
  }
30
28
 
31
29
  return (
32
- <View style={styles.container}>
33
- <View style={{flex: 1}}>
34
- <MaxVideoView
35
- user={renderList[maxUid]}
36
- key={maxUid}
37
- fallback={Fallback}
38
- containerStyle={{
39
- width: '100%',
40
- height: '100%',
41
- borderBottomLeftRadius: 8,
42
- borderBottomRightRadius: 8,
43
- }}
44
- />
45
- </View>
46
- <PreCallLocalMute isMobileView={true} />
30
+ <View style={{borderRadius: 10, flex: 1}}>
31
+ <MaxVideoView user={renderList[maxUid]} key={maxUid} />
47
32
  </View>
48
33
  );
49
34
  };
50
35
  export default VideoPreview;
51
-
52
- const Fallback = () => {
53
- return (
54
- <View style={styles.fallbackRootContainer}>
55
- <View style={styles.avatar}>
56
- {/*TODO fix ttf file <ImageIcon name="profile" customSize={{width: 100, height: 100}} /> */}
57
- <UiKitImageIcon name={'profile'} />
58
- </View>
59
- </View>
60
- );
61
- };
62
-
63
- const styles = StyleSheet.create({
64
- container: {
65
- flex: 1,
66
- position: 'relative',
67
- justifyContent: 'space-between',
68
- },
69
- avatar: {
70
- height: 100,
71
- width: 100,
72
- },
73
- fallbackRootContainer: {
74
- flex: 1,
75
- backgroundColor: $config.VIDEO_AUDIO_TILE_COLOR,
76
- justifyContent: 'center',
77
- alignItems: 'center',
78
- position: 'relative',
79
- },
80
- });
@@ -10,92 +10,12 @@
10
10
  *********************************************
11
11
  */
12
12
 
13
- import React, {useContext, useState} from 'react';
14
- import {
15
- View,
16
- StyleSheet,
17
- Image,
18
- Text,
19
- TouchableOpacity,
20
- Linking,
21
- } from 'react-native';
22
- import {MaxVideoView} from '../../../agora-rn-uikit';
23
- import PreCallLocalMute from './LocalMute';
24
- import {
25
- LocalContext,
26
- PermissionState,
27
- ImageIcon as UiKitImageIcon,
28
- } from '../../../agora-rn-uikit';
29
13
  import {useRender} from 'customization-api';
30
- import {usePreCall} from './usePreCall';
31
- import ImageIcon from '../../atoms/ImageIcon';
32
- import ThemeConfig from '../../theme';
33
- import Spacer from '../../atoms/Spacer';
34
- import {isMobileUA, isWebInternal, useResponsive} from '../../utils/common';
35
-
36
- const Fallback = () => {
37
- const {isCameraAvailable, isMicAvailable} = usePreCall();
38
- const local = useContext(LocalContext);
39
- const requestCameraAndAudioPermission = () => {
40
- try {
41
- const URL =
42
- 'https://support.google.com/chrome/answer/2693767?hl=en&co=GENIE.Platform%3DDesktop';
43
- if (isWebInternal()) {
44
- window.open(URL, '_blank');
45
- } else {
46
- Linking.openURL(URL);
47
- }
48
- } catch (error) {
49
- console.error(`Couldn't open the support url`);
50
- }
51
- };
52
- const styles = useStyles();
53
- return (
54
- <View style={styles.fallbackRootContainer}>
55
- {isCameraAvailable ||
56
- ($config.AUDIO_ROOM && isMicAvailable) ||
57
- local.permissionStatus === PermissionState.NOT_REQUESTED ||
58
- local.permissionStatus === PermissionState.REQUESTED ? (
59
- <View style={styles.avatar}>
60
- <UiKitImageIcon name={'profile'} />
61
- </View>
62
- ) : (
63
- <View style={styles.fallbackContainer}>
64
- <Text style={styles.infoText1}>
65
- Can’t Find Your{$config.AUDIO_ROOM ? ' Microphone' : ' Camera'}
66
- </Text>
67
- <Text style={styles.infoText2}>
68
- Check your system settings to make sure that a
69
- {$config.AUDIO_ROOM ? ' microphone' : ' camera'} is available. If
70
- not, plug one in and restart your browser.
71
- </Text>
72
- <Spacer size={33} />
73
- <TouchableOpacity
74
- style={{
75
- flexDirection: 'row',
76
- alignSelf: 'center',
77
- }}
78
- onPress={() => {
79
- requestCameraAndAudioPermission();
80
- }}>
81
- <Text style={styles.retryBtn}>Learn More</Text>
82
- <Spacer horizontal={true} size={4} />
83
- <View style={{alignSelf: 'center'}}>
84
- <ImageIcon
85
- iconType="plain"
86
- name={'link-share'}
87
- tintColor={$config.PRIMARY_ACTION_BRAND_COLOR}
88
- />
89
- </View>
90
- </TouchableOpacity>
91
- <Spacer size={23} />
92
- </View>
93
- )}
94
- </View>
95
- );
96
- };
14
+ import React from 'react';
15
+ import {View} from 'react-native';
16
+ import {MaxVideoView} from '../../../agora-rn-uikit';
97
17
 
98
- const VideoPreview = () => {
18
+ const VideoPreview: React.FC = () => {
99
19
  const {renderList, activeUids} = useRender();
100
20
 
101
21
  const [maxUid] = activeUids;
@@ -103,87 +23,11 @@ const VideoPreview = () => {
103
23
  if (!maxUid) {
104
24
  return null;
105
25
  }
106
- const styles = useStyles();
26
+
107
27
  return (
108
- <View style={[styles.container]}>
109
- <View
110
- style={{
111
- flex: 1,
112
- }}>
113
- <MaxVideoView
114
- user={renderList[maxUid]}
115
- key={maxUid}
116
- fallback={Fallback}
117
- containerStyle={{
118
- minHeight: 200,
119
- width: '100%',
120
- height: '100%',
121
- // borderTopLeftRadius: 4,
122
- // borderTopRightRadius: 4,
123
- }}
124
- />
125
- </View>
126
- <PreCallLocalMute isMobileView={isMobileUA() ? true : false} />
28
+ <View style={{borderRadius: 10, flex: 1}}>
29
+ <MaxVideoView user={renderList[maxUid]} key={maxUid} />
127
30
  </View>
128
31
  );
129
32
  };
130
33
  export default VideoPreview;
131
-
132
- const useStyles = () => {
133
- const getResponsiveValue = useResponsive();
134
- return StyleSheet.create({
135
- infoText1: {
136
- fontFamily: ThemeConfig.FontFamily.sansPro,
137
- fontWeight: '700',
138
- fontSize: 20,
139
- textAlign: 'center',
140
- color: $config.FONT_COLOR,
141
- paddingTop: 24,
142
- paddingBottom: 12,
143
- paddingHorizontal: 10,
144
- },
145
- infoText2: {
146
- fontFamily: ThemeConfig.FontFamily.sansPro,
147
- fontWeight: '400',
148
- fontSize: ThemeConfig.FontSize.small,
149
- textAlign: 'center',
150
- color: $config.FONT_COLOR + ThemeConfig.EmphasisPlus.disabled,
151
- paddingHorizontal: getResponsiveValue(48),
152
- },
153
- fallbackRootContainer: {
154
- flex: 1,
155
- backgroundColor: $config.VIDEO_AUDIO_TILE_COLOR,
156
- justifyContent: 'center',
157
- alignItems: 'center',
158
- // borderTopLeftRadius: 4,
159
- // borderTopRightRadius: 4,
160
- },
161
- fallbackContainer: {
162
- minHeight: 200,
163
- maxWidth: 440,
164
- backgroundColor: $config.CARD_LAYER_4_COLOR,
165
- borderRadius: ThemeConfig.BorderRadius.large,
166
- justifyContent: 'center',
167
- alignItems: 'center',
168
- margin: 40,
169
- },
170
- retryBtn: {
171
- fontFamily: ThemeConfig.FontFamily.sansPro,
172
- fontWeight: '600',
173
- fontSize: ThemeConfig.FontSize.normal,
174
- color: $config.PRIMARY_ACTION_BRAND_COLOR,
175
- alignSelf: 'center',
176
- },
177
- container: {
178
- flex: 1,
179
- position: 'relative',
180
- justifyContent: 'space-between',
181
- overflow: 'hidden',
182
- },
183
- avatar: {
184
- width: 100,
185
- height: 100,
186
- margin: 40,
187
- },
188
- });
189
- };
@@ -21,7 +21,6 @@ import useGetName from '../../utils/useGetName';
21
21
  import {useWakeLock} from '../../components/useWakeLock';
22
22
  import isMobileOrTablet from '../../utils/isMobileOrTablet';
23
23
  import {isWebInternal} from '../../utils/common';
24
- import useSetName from '../../utils/useSetName';
25
24
 
26
25
  const audio = new Audio(
27
26
  'https://dl.dropboxusercontent.com/s/1cdwpm3gca9mlo0/kick.mp3',
@@ -39,7 +38,6 @@ const JoinCallBtn = (props: PreCallJoinCallBtnProps) => {
39
38
  const {rtcProps} = useContext(PropsContext);
40
39
  const {setCallActive} = usePreCall();
41
40
  const username = useGetName();
42
- const setUsername = useSetName();
43
41
  const {isJoinDataFetched} = useMeetingInfo();
44
42
  const {awake, request} = useWakeLock();
45
43
  const joinRoomButton =
@@ -53,7 +51,6 @@ const JoinCallBtn = (props: PreCallJoinCallBtnProps) => {
53
51
  );
54
52
 
55
53
  const onSubmit = () => {
56
- setUsername(username.trim());
57
54
  setCallActive(true);
58
55
  // Play a sound to avoid autoblocking in safari
59
56
  if (isWebInternal() || isMobileOrTablet()) {
@@ -83,21 +80,11 @@ const JoinCallBtn = (props: PreCallJoinCallBtnProps) => {
83
80
 
84
81
  const title = buttonText;
85
82
  const onPress = () => onSubmit();
86
- const disabled = !isJoinDataFetched || username?.trim() === '';
83
+ const disabled = !isJoinDataFetched || username === '';
87
84
  return props?.render ? (
88
85
  props.render(onPress, title, disabled)
89
86
  ) : (
90
- <PrimaryButton
91
- // iconName={'video-on'}
92
- onPress={onPress}
93
- disabled={disabled}
94
- text={title}
95
- containerStyle={{
96
- minWidth: '100%',
97
- paddingHorizontal: 10,
98
- }}
99
- textStyle={{textAlign: 'center'}}
100
- />
87
+ <PrimaryButton onPress={onPress} disabled={disabled} text={title} />
101
88
  );
102
89
  };
103
90