agora-appbuilder-core 2.0.1 → 2.0.3-rc2

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 (79) hide show
  1. package/Readme.md +2 -1
  2. package/package.json +1 -1
  3. package/template/_package-lock.json +8853 -8806
  4. package/template/agora-rn-uikit/.git/index +0 -0
  5. package/template/agora-rn-uikit/.git/logs/HEAD +2 -2
  6. package/template/agora-rn-uikit/.git/logs/refs/heads/ab-dev-auto +1 -1
  7. package/template/agora-rn-uikit/.git/logs/refs/heads/master +1 -1
  8. package/template/agora-rn-uikit/.git/logs/refs/remotes/origin/HEAD +1 -1
  9. package/template/agora-rn-uikit/.git/objects/pack/pack-2a0122bf5a3199f941e5a52535f43881623f752c.idx +0 -0
  10. package/template/agora-rn-uikit/.git/objects/pack/{pack-f379286d0537eb68377220b4929979324b8d5d1c.pack → pack-2a0122bf5a3199f941e5a52535f43881623f752c.pack} +0 -0
  11. package/template/agora-rn-uikit/.git/packed-refs +4 -2
  12. package/template/agora-rn-uikit/.git/refs/heads/ab-dev-auto +1 -1
  13. package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +21 -0
  14. package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +22 -14
  15. package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +17 -13
  16. package/template/agora-rn-uikit/src/Controls/types.ts +4 -0
  17. package/template/agora-rn-uikit/src/Rtc/Create.tsx +117 -19
  18. package/template/agora-rn-uikit/src/RtcConfigure.tsx +24 -13
  19. package/template/{src/utils/isSafariBrowser.tsx → agora-rn-uikit/src/Utils/isSafariBrowser.ts} +3 -0
  20. package/template/{src → agora-rn-uikit/src}/hooks/useImageDelay.tsx +5 -2
  21. package/template/agora-rn-uikit/src/index.ts +2 -0
  22. package/template/bridge/rtc/webNg/RtcEngine.ts +73 -70
  23. package/template/bridge/rtc/webNg/Types.ts +59 -5
  24. package/template/bridge/rtm/web/Types.ts +13 -0
  25. package/template/bridge/rtm/web/index.ts +78 -1
  26. package/template/global.d.ts +2 -0
  27. package/template/package-lock.json +8853 -8806
  28. package/template/package.json +3 -4
  29. package/template/react-native-toast-message/src/components/base/styles.js +4 -2
  30. package/template/src/assets/icons.ts +41 -28
  31. package/template/src/components/Chat.tsx +70 -184
  32. package/template/src/components/ChatContext.ts +13 -2
  33. package/template/src/components/Controls.native.tsx +37 -76
  34. package/template/src/components/Controls.tsx +50 -158
  35. package/template/src/components/DeviceConfigure.native.tsx +5 -1
  36. package/template/src/components/DeviceConfigure.tsx +38 -20
  37. package/template/src/components/Navbar.tsx +185 -226
  38. package/template/src/components/ParticipantsView.tsx +176 -184
  39. package/template/src/components/Precall.native.tsx +83 -69
  40. package/template/src/components/Precall.tsx +174 -191
  41. package/template/src/components/RTMConfigure.tsx +264 -78
  42. package/template/src/components/SettingsView.tsx +9 -19
  43. package/template/src/components/livestream/LiveStreamContext.tsx +411 -0
  44. package/template/src/components/livestream/Types.ts +69 -0
  45. package/template/src/components/livestream/index.ts +9 -0
  46. package/template/src/components/livestream/views/LiveStreamControls.tsx +27 -0
  47. package/template/src/components/participants/AllAudienceParticipants.tsx +53 -0
  48. package/template/src/components/participants/AllHostParticipants.tsx +65 -0
  49. package/template/src/components/participants/MeParticipant.tsx +37 -0
  50. package/template/src/components/participants/ParticipantName.tsx +47 -0
  51. package/template/src/components/participants/ParticipantSectionTitle.tsx +29 -0
  52. package/template/src/components/participants/RemoteParticipants.tsx +69 -0
  53. package/template/src/components/participants/ScreenshareParticipants.tsx +28 -0
  54. package/template/src/components/participants/context/ParticipantContext.tsx +97 -0
  55. package/template/src/components/styles.ts +13 -0
  56. package/template/src/pages/Create.tsx +25 -14
  57. package/template/src/pages/VideoCall.tsx +197 -159
  58. package/template/src/subComponents/ChatBubble.tsx +4 -1
  59. package/template/src/subComponents/ChatContainer.tsx +44 -20
  60. package/template/src/subComponents/ChatInput.tsx +4 -12
  61. package/template/src/subComponents/Checkbox.native.tsx +6 -5
  62. package/template/src/subComponents/Checkbox.tsx +1 -0
  63. package/template/src/subComponents/Recording.tsx +23 -9
  64. package/template/src/subComponents/RemoteVideoMute.tsx +2 -3
  65. package/template/src/subComponents/SelectDevice.tsx +70 -35
  66. package/template/src/subComponents/chat/ChatParticipants.tsx +121 -0
  67. package/template/src/subComponents/livestream/ApprovedLiveStreamControlsView.tsx +23 -0
  68. package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +70 -0
  69. package/template/src/subComponents/livestream/controls/LocalRaiseHand.tsx +57 -0
  70. package/template/src/subComponents/livestream/controls/RemoteLiveStreamApprovedRequestRecall.tsx +24 -0
  71. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestApprove.tsx +38 -0
  72. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestReject.tsx +37 -0
  73. package/template/src/subComponents/livestream/index.ts +18 -0
  74. package/template/src/subComponents/screenshare/ScreenshareButton.tsx +80 -0
  75. package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +24 -0
  76. package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +200 -0
  77. package/template/src/subComponents/screenshare/ScreenshareContext.tsx +21 -0
  78. package/template/src/utils/index.tsx +48 -0
  79. package/template/agora-rn-uikit/.git/objects/pack/pack-f379286d0537eb68377220b4929979324b8d5d1c.idx +0 -0
@@ -16,20 +16,15 @@ import {
16
16
  Text,
17
17
  StyleSheet,
18
18
  TouchableOpacity,
19
- ScrollView,
20
19
  Dimensions,
21
- useWindowDimensions
20
+ useWindowDimensions,
22
21
  } from 'react-native';
23
22
  import {RFValue} from 'react-native-responsive-fontsize';
24
23
  import ChatContainer from '../subComponents/ChatContainer';
25
24
  import ChatInput from '../subComponents/ChatInput';
26
- import {MinUidConsumer} from '../../agora-rn-uikit';
27
- import {MaxUidConsumer} from '../../agora-rn-uikit';
28
- import icons from '../assets/icons';
25
+ import ChatParticipants from '../subComponents/chat/ChatParticipants';
29
26
  import ColorContext from './ColorContext';
30
27
  import chatContext from './ChatContext';
31
- import {UserType} from './RTMConfigure';
32
- import TextWithTooltip from '../subComponents/TextWithTooltip';
33
28
 
34
29
  const Chat = (props: any) => {
35
30
  const {height, width} = useWindowDimensions();
@@ -40,7 +35,8 @@ const Chat = (props: any) => {
40
35
  ]);
41
36
  const isSmall = dim[0] < 700;
42
37
 
43
- const {userList, localUid} = useContext(chatContext);
38
+ const {userList} = useContext(chatContext);
39
+
44
40
  const {
45
41
  setChatDisplayed,
46
42
  pendingPrivateNotification,
@@ -48,21 +44,23 @@ const Chat = (props: any) => {
48
44
  lastCheckedPrivateState,
49
45
  privateMessageCountMap,
50
46
  setPrivateMessageLastSeen,
51
- setPrivateChatDisplayed
47
+ setPrivateChatDisplayed,
52
48
  } = props;
53
49
  const {primaryColor} = useContext(ColorContext);
54
50
  const [groupActive, setGroupActive] = useState(true);
55
51
  const [privateActive, setPrivateActive] = useState(false);
56
- const [selectedUser, setSelectedUser] = useState({uid: null});
57
- //initally private state should be false
58
- useEffect(()=>{
59
- setPrivateChatDisplayed(false)
60
- },[])
52
+ const [selectedUserID, setSelectedUser] = useState('');
53
+
54
+ //Initally private state should be false
55
+ useEffect(() => {
56
+ setPrivateChatDisplayed(false);
57
+ }, []);
58
+
61
59
  useEffect(() => {
62
- if (privateActive) {
60
+ if (privateActive && selectedUserID) {
63
61
  setPrivateMessageLastSeen({
64
- userId: selectedUser.uid,
65
- lastSeenCount: privateMessageCountMap[selectedUser.uid],
62
+ userId: selectedUserID,
63
+ lastSeenCount: privateMessageCountMap[selectedUserID],
66
64
  });
67
65
  }
68
66
  }, [pendingPrivateNotification]);
@@ -70,31 +68,26 @@ const Chat = (props: any) => {
70
68
  const selectGroup = () => {
71
69
  setPrivateActive(false);
72
70
  setGroupActive(true);
73
- setPrivateChatDisplayed(false)
71
+ setPrivateChatDisplayed(false);
74
72
  };
75
73
  const selectPrivate = () => {
76
74
  setGroupActive(false);
77
- setPrivateChatDisplayed(true)
75
+ setPrivateChatDisplayed(true);
78
76
  };
79
- const selectUser = (user: any) => {
80
- setSelectedUser(user);
77
+ const selectUser = (userUID: any) => {
78
+ setSelectedUser(userUID);
81
79
  setPrivateActive(true);
82
80
  };
81
+
83
82
  return (
84
83
  <View
85
- style={Platform.OS === 'web' ? !isSmall ? style.chatView : style.chatViewNative: style.chatViewNative}>
86
- {/* <View style={style.heading}>
87
- <TouchableOpacity
88
- style={style.backButton}
89
- onPress={() => setChatDisplayed(false)}>
90
- <Image
91
- resizeMode={'contain'}
92
- style={style.backIcon}
93
- source={{uri: icons.backBtn}}
94
- />
95
- <Text style={style.headingText}>Chats</Text>
96
- </TouchableOpacity>
97
- </View> */}
84
+ style={
85
+ Platform.OS === 'web'
86
+ ? !isSmall
87
+ ? style.chatView
88
+ : style.chatViewNative
89
+ : style.chatViewNative
90
+ }>
98
91
  <View style={style.chatNav}>
99
92
  <TouchableOpacity
100
93
  onPress={selectGroup}
@@ -133,9 +126,7 @@ const Chat = (props: any) => {
133
126
  }>
134
127
  {pendingPrivateNotification !== 0 ? (
135
128
  <View style={style.chatNotification}>
136
- <Text>
137
- {pendingPrivateNotification}
138
- </Text>
129
+ <Text>{pendingPrivateNotification}</Text>
139
130
  </View>
140
131
  ) : null}
141
132
  <Text style={!groupActive ? style.groupTextActive : style.groupText}>
@@ -146,131 +137,44 @@ const Chat = (props: any) => {
146
137
  {groupActive ? (
147
138
  <>
148
139
  <ChatContainer privateActive={privateActive} />
149
- <View
150
- style={{
151
- backgroundColor: $config.PRIMARY_FONT_COLOR + '80',
152
- width: '100%',
153
- height: 1,
154
- marginHorizontal: -20,
155
- alignSelf: 'center',
156
- opacity: 0.5,
157
- }}
158
- />
159
- {Platform.OS === 'ios' ? (
160
- <View>
161
- <View style={{backgroundColor: $config.SECONDARY_FONT_COLOR, paddingBottom: 10}}>
162
- <View
163
- style={{
164
- backgroundColor: $config.PRIMARY_FONT_COLOR + '80',
165
- width: '100%',
166
- height: 1,
167
- marginHorizontal: -20,
168
- alignSelf: 'center',
169
- opacity: 0.3,
170
- marginBottom: 10,
171
- }}
172
- />
173
- <ChatInput privateActive={privateActive} />
174
- </View>
175
- </View>
176
- ) : (
177
- <View style={{backgroundColor: $config.SECONDARY_FONT_COLOR, paddingBottom: 10}}>
178
- <View
179
- style={{
180
- backgroundColor: $config.PRIMARY_FONT_COLOR + '80',
181
- width: '100%',
182
- height: 1,
183
- marginHorizontal: -20,
184
- alignSelf: 'center',
185
- opacity: 0.5,
186
- marginBottom: 10,
187
- }}
188
- />
140
+ <View style={[style.chatInputLineSeparator, {marginBottom: 0}]} />
141
+ <View>
142
+ <View style={style.chatInputContainer}>
143
+ <View style={[style.chatInputLineSeparator, {opacity: 0.3}]} />
189
144
  <ChatInput privateActive={privateActive} />
190
145
  </View>
191
- )}
146
+ </View>
192
147
  </>
193
148
  ) : (
194
149
  <>
195
150
  {!privateActive ? (
196
- <ScrollView>
197
- <MinUidConsumer>
198
- {(minUsers) => (
199
- <MaxUidConsumer>
200
- {(maxUser) =>
201
- [...minUsers, ...maxUser].map((user) => {
202
- if (
203
- user.uid !== 'local' &&
204
- user.uid !== 1 &&
205
- userList[user.uid]?.type !== UserType.ScreenShare
206
- ) {
207
- return (
208
- <TouchableOpacity
209
- style={style.participantContainer}
210
- key={user.uid}
211
- onPress={() => {
212
- selectUser(user);
213
- setPrivateMessageLastSeen({
214
- userId: user.uid,
215
- lastSeenCount: privateMessageCountMap[user.uid],
216
- });
217
- }}>
218
- {(privateMessageCountMap[user.uid] || 0) -
219
- (lastCheckedPrivateState[user.uid] || 0) !==
220
- 0 ? (
221
- <View style={style.chatNotificationPrivate}>
222
- <Text>{(privateMessageCountMap[user.uid] || 0) -
223
- (lastCheckedPrivateState[user.uid] || 0)}</Text>
224
- </View>
225
- ) : null}
226
- <View style={{flex:1}}>
227
- <TextWithTooltip touchable={false} style={[style.participantText,{
228
- fontSize: RFValue(16, height > width ? height : width)
229
- }]} value={userList[user.uid]
230
- ? userList[user.uid].name + ' '
231
- : 'User '}
232
- />
233
- </View>
234
- <View>
235
- <Text style={{color: $config.PRIMARY_FONT_COLOR, fontSize: 18}}>{`>`}</Text>
236
- </View>
237
- </TouchableOpacity>
238
- );
239
- }
240
- })
241
- }
242
- </MaxUidConsumer>
243
- )}
244
- </MinUidConsumer>
245
- </ScrollView>
151
+ <ChatParticipants
152
+ selectUser={selectUser}
153
+ setPrivateMessageLastSeen={setPrivateMessageLastSeen}
154
+ privateMessageCountMap={privateMessageCountMap}
155
+ lastCheckedPrivateState={lastCheckedPrivateState}
156
+ />
246
157
  ) : (
247
158
  <>
248
159
  <ChatContainer
249
160
  privateActive={privateActive}
250
161
  setPrivateActive={setPrivateActive}
251
- selectedUser={selectedUser}
162
+ selectedUserID={selectedUserID}
252
163
  selectedUsername={
253
- userList[selectedUser.uid]
254
- ? userList[selectedUser.uid].name + ' '
164
+ userList[selectedUserID]
165
+ ? userList[selectedUserID]?.name + ' '
255
166
  : 'User '
256
167
  }
257
168
  />
258
- <View>
259
- <View style={{backgroundColor: $config.SECONDARY_FONT_COLOR, paddingBottom: 10}}>
169
+ <View style={[style.chatInputLineSeparator, {marginBottom: 0}]} />
170
+ <View>
171
+ <View style={style.chatInputContainer}>
260
172
  <View
261
- style={{
262
- backgroundColor: $config.PRIMARY_FONT_COLOR + '80',
263
- width: '100%',
264
- height: 1,
265
- marginHorizontal: -20,
266
- alignSelf: 'center',
267
- opacity: 0.3,
268
- marginBottom: 10,
269
- }}
173
+ style={[style.chatInputLineSeparator, {opacity: 0.3}]}
270
174
  />
271
175
  <ChatInput
272
176
  privateActive={privateActive}
273
- selectedUser={selectedUser}
177
+ selectedUserID={selectedUserID}
274
178
  />
275
179
  </View>
276
180
  </View>
@@ -279,7 +183,6 @@ const Chat = (props: any) => {
279
183
  </>
280
184
  )}
281
185
  </View>
282
- // </KeyboardAvoidingView>
283
186
  );
284
187
  };
285
188
 
@@ -290,7 +193,6 @@ const style = StyleSheet.create({
290
193
  maxWidth: 300,
291
194
  backgroundColor: $config.SECONDARY_FONT_COLOR,
292
195
  flex: 1,
293
- // paddingTop: 20,
294
196
  shadowColor: $config.PRIMARY_FONT_COLOR + '80',
295
197
  shadowOpacity: 0.5,
296
198
  shadowOffset: {width: -2, height: 1},
@@ -301,9 +203,7 @@ const style = StyleSheet.create({
301
203
  zIndex: 5,
302
204
  width: '100%',
303
205
  height: '100%',
304
- // flex: 1,
305
206
  right: 0,
306
- // top: 0,
307
207
  bottom: 0,
308
208
  backgroundColor: $config.SECONDARY_FONT_COLOR,
309
209
  },
@@ -327,13 +227,27 @@ const style = StyleSheet.create({
327
227
  chatNav: {
328
228
  flexDirection: 'row',
329
229
  height: '6%',
330
- // marginBottom: 15,
230
+ },
231
+ chatInputContainer: {
232
+ backgroundColor: $config.SECONDARY_FONT_COLOR,
233
+ paddingBottom: 10,
234
+ },
235
+ chatInputLineSeparator: {
236
+ backgroundColor: $config.PRIMARY_FONT_COLOR + '80',
237
+ width: '100%',
238
+ height: 1,
239
+ marginHorizontal: -20,
240
+ alignSelf: 'center',
241
+ opacity: 0.5,
242
+ marginBottom: 10,
331
243
  },
332
244
  groupActive: {
333
245
  backgroundColor: $config.SECONDARY_FONT_COLOR,
334
246
  flex: 1,
335
247
  height: '100%',
336
248
  textAlign: 'center',
249
+ alignItems: 'center',
250
+ justifyContent: 'center',
337
251
  },
338
252
  group: {
339
253
  backgroundColor: $config.PRIMARY_FONT_COLOR + 22,
@@ -341,19 +255,23 @@ const style = StyleSheet.create({
341
255
  height: '100%',
342
256
  textAlign: 'center',
343
257
  borderBottomRightRadius: 10,
258
+ alignItems: 'center',
259
+ justifyContent: 'center',
344
260
  },
345
261
  privateActive: {
346
262
  backgroundColor: $config.SECONDARY_FONT_COLOR,
347
263
  flex: 1,
348
264
  height: '100%',
349
- textAlign: 'center',
265
+ alignItems: 'center',
266
+ justifyContent: 'center',
350
267
  },
351
268
  private: {
352
269
  backgroundColor: $config.PRIMARY_FONT_COLOR + 22,
353
270
  flex: 1,
354
271
  height: '100%',
355
- textAlign: 'center',
356
272
  borderBottomLeftRadius: 10,
273
+ alignItems: 'center',
274
+ justifyContent: 'center',
357
275
  },
358
276
  groupTextActive: {
359
277
  marginVertical: 'auto',
@@ -373,38 +291,6 @@ const style = StyleSheet.create({
373
291
  justifyContent: 'center',
374
292
  color: $config.PRIMARY_FONT_COLOR + 50,
375
293
  },
376
- participantContainer: {
377
- flexDirection: 'row',
378
- flex: 1,
379
- height: 20,
380
- marginTop: 10,
381
- backgroundColor: $config.SECONDARY_FONT_COLOR,
382
- overflow: 'hidden',
383
- marginHorizontal: 10,
384
- },
385
- participantText: {
386
- flex: 1,
387
- fontWeight: Platform.OS === 'web' ? '500' : '700',
388
- flexDirection: 'row',
389
- color: $config.PRIMARY_FONT_COLOR,
390
- lineHeight: 20,
391
- textAlign:'left',
392
- flexShrink: 1 ,
393
- marginRight: 30
394
- },
395
- backButton: {
396
- // marginLeft: 5,
397
- flexDirection: 'row',
398
- justifyContent: 'center',
399
- alignSelf: 'center',
400
- },
401
- backIcon: {
402
- width: 20,
403
- height: 12,
404
- alignSelf: 'center',
405
- justifyContent: 'center',
406
- tintColor: $config.PRIMARY_FONT_COLOR,
407
- },
408
294
  chatNotification: {
409
295
  width: 20,
410
296
  height: 20,
@@ -419,7 +305,7 @@ const style = StyleSheet.create({
419
305
  left: 25,
420
306
  top: -5,
421
307
  },
422
- chatNotificationPrivate:{
308
+ chatNotificationPrivate: {
423
309
  width: 20,
424
310
  height: 20,
425
311
  display: 'flex',
@@ -432,7 +318,7 @@ const style = StyleSheet.create({
432
318
  position: 'absolute',
433
319
  right: 20,
434
320
  top: 0,
435
- }
321
+ },
436
322
  });
437
323
 
438
324
  export default Chat;
@@ -9,7 +9,7 @@
9
9
  information visit https://appbuilder.agora.io.
10
10
  *********************************************
11
11
  */
12
- import RtmEngine from 'agora-react-native-rtm';
12
+ import RtmEngine, {RtmAttribute} from 'agora-react-native-rtm';
13
13
  import {createContext} from 'react';
14
14
  import {rtmEventsInterface} from './RTMEvents';
15
15
 
@@ -45,6 +45,10 @@ export enum messageActionType {
45
45
  Normal = '1',
46
46
  }
47
47
 
48
+ export enum attrRequestTypes {
49
+ none = 'NONE',
50
+ }
51
+
48
52
  interface chatContext {
49
53
  messageStore: messageStoreInterface | any;
50
54
  privateMessageStore: any;
@@ -52,11 +56,16 @@ interface chatContext {
52
56
  sendMessageToUid: (msg: string, uid: number) => void;
53
57
  sendControlMessage: (msg: string) => void;
54
58
  sendControlMessageToUid: (msg: string, uid: number) => void;
59
+ addOrUpdateLocalUserAttributes: (attributes: RtmAttribute[]) => void;
60
+ broadcastUserAttributes: (
61
+ attributes: RtmAttribute[],
62
+ ctrlMsg: controlMessageEnum,
63
+ ) => void;
55
64
  engine: RtmEngine;
56
65
  localUid: string;
57
66
  userList: any;
67
+ onlineUsersCount: number;
58
68
  events: rtmEventsInterface;
59
- // peersRTM: Array<string>;
60
69
  }
61
70
 
62
71
  export enum controlMessageEnum {
@@ -67,6 +76,8 @@ export enum controlMessageEnum {
67
76
  kickUser = '5',
68
77
  cloudRecordingActive = '6',
69
78
  cloudRecordingUnactive = '7',
79
+ clientRoleChanged = 'CLIENT_ROLE_CHANGED',
80
+ // TODO move to livestream provider
70
81
  }
71
82
 
72
83
  const ChatContext = createContext(null as unknown as chatContext);
@@ -24,94 +24,56 @@ import {
24
24
  LocalVideoMute,
25
25
  SwitchCamera,
26
26
  Endcall,
27
+ PropsContext,
28
+ ClientRole,
27
29
  } from '../../agora-rn-uikit';
28
30
  import Recording from '../subComponents/Recording';
29
- import icons from '../assets/icons';
30
- import ColorContext from './ColorContext';
31
- import {SidePanelType} from '../subComponents/SidePanelEnum';
31
+ import LiveStreamControls from './livestream/views/LiveStreamControls';
32
32
 
33
33
  const Controls = (props: any) => {
34
- const {setRecordingActive, recordingActive, sidePanel, setSidePanel, isHost} =
35
- props;
36
- const {primaryColor} = useContext(ColorContext);
34
+ const {setRecordingActive, recordingActive, isHost} = props;
35
+ const {rtcProps} = useContext(PropsContext);
37
36
 
38
37
  return (
39
38
  <LocalUserContext>
40
39
  <View style={style.bottomBar}>
41
- <View style={{alignSelf: 'center'}}>
42
- <LocalAudioMute />
43
- {/* <Text
44
- style={{
45
- textAlign: 'center',
46
- marginTop: 5,
47
- color: $config.PRIMARY_COLOR,
48
- }}>
49
- Audio
50
- </Text> */}
51
- </View>
52
- <View style={{alignSelf: 'center'}}>
53
- <LocalVideoMute />
54
- {/* <Text
55
- style={{
56
- textAlign: 'center',
57
- marginTop: 5,
58
- color: $config.PRIMARY_COLOR,
59
- }}>
60
- Video
61
- </Text> */}
62
- </View>
63
- {isHost ? (
64
- $config.CLOUD_RECORDING ? (
65
- <View style={{alignSelf: 'center'}}>
66
- <Recording
67
- recordingActive={recordingActive}
68
- setRecordingActive={setRecordingActive}
40
+ {$config.EVENT_MODE && rtcProps.role == ClientRole.Audience ? (
41
+ <LiveStreamControls showControls={true} />
42
+ ) : (
43
+ <>
44
+ {/**
45
+ * In event mode when raise hand feature is active
46
+ * and audience is promoted to host, the audience can also
47
+ * demote himself
48
+ */}
49
+ {$config.EVENT_MODE && (
50
+ <LiveStreamControls
51
+ showControls={
52
+ rtcProps?.role == ClientRole.Broadcaster && !isHost
53
+ }
69
54
  />
70
- {/* <Text
71
- style={{
72
- textAlign: 'center',
73
- marginTop: 5,
74
- color: recordingActive ? '#FD0845' : $config.PRIMARY_COLOR,
75
- }}>
76
- {recordingActive ? 'Recording' : 'Record'}
77
- </Text> */}
55
+ )}
56
+ <View style={{alignSelf: 'center'}}>
57
+ <LocalAudioMute />
78
58
  </View>
79
- ) : (
80
- <></>
81
- )
82
- ) : (
83
- <></>
59
+ <View style={{alignSelf: 'center'}}>
60
+ <LocalVideoMute />
61
+ </View>
62
+ {isHost && $config.CLOUD_RECORDING && (
63
+ <View style={{alignSelf: 'baseline'}}>
64
+ <Recording
65
+ recordingActive={recordingActive}
66
+ setRecordingActive={setRecordingActive}
67
+ />
68
+ </View>
69
+ )}
70
+ <View style={{alignSelf: 'center'}}>
71
+ <SwitchCamera />
72
+ </View>
73
+ </>
84
74
  )}
85
- <View style={{alignSelf: 'center'}}>
86
- <SwitchCamera />
87
- {/* <Text
88
- style={{
89
- textAlign: 'center',
90
- marginTop: 5,
91
- color: $config.PRIMARY_COLOR,
92
- }}>
93
- Switch
94
- </Text> */}
95
- </View>
96
- {/* <View style={{ alignSelf: 'center' }}>
97
- <TouchableOpacity
98
- style={[style.localButton, { borderColor: primaryColor, borderRadius: 50 }]}
99
- onPress={() => {
100
- sidePanel === SidePanelType.Chat
101
- ? setSidePanel(SidePanelType.None)
102
- : setSidePanel(SidePanelType.Chat);
103
- }}>
104
- <Image
105
- source={{ uri: icons.chatIcon }}
106
- style={[style.buttonIcon, { tintColor: primaryColor }]}
107
- />
108
- </TouchableOpacity>
109
- </View> */}
110
75
  <View style={{alignSelf: 'center'}}>
111
76
  <Endcall />
112
- {/* <Text style={{textAlign: 'center', marginTop: 5, color: '#FD0845'}}>
113
- Hang Up
114
- </Text> */}
115
77
  </View>
116
78
  </View>
117
79
  </LocalUserContext>
@@ -134,7 +96,6 @@ const style = StyleSheet.create({
134
96
  backgroundColor: $config.SECONDARY_FONT_COLOR,
135
97
  borderRadius: 2,
136
98
  borderColor: $config.PRIMARY_COLOR,
137
- // borderWidth: 1,
138
99
  width: 40,
139
100
  height: 40,
140
101
  display: 'flex',