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
@@ -15,43 +15,33 @@ import {
15
15
  Text,
16
16
  StyleSheet,
17
17
  Platform,
18
- TouchableOpacity,
19
- Image,
20
18
  ScrollView,
21
19
  Dimensions,
22
- useWindowDimensions
20
+ useWindowDimensions,
23
21
  } from 'react-native';
24
- import {RFValue} from 'react-native-responsive-fontsize';
25
- import {MinUidConsumer} from '../../agora-rn-uikit';
26
- import {MaxUidConsumer} from '../../agora-rn-uikit';
27
- import {LocalAudioMute, LocalVideoMute} from '../../agora-rn-uikit';
28
- import {LocalUserContext} from '../../agora-rn-uikit';
22
+ import {PropsContext, ClientRole} from '../../agora-rn-uikit';
29
23
  import CopyJoinInfo from '../subComponents/CopyJoinInfo';
30
- import RemoteAudioMute from '../subComponents/RemoteAudioMute';
31
- import RemoteVideoMute from '../subComponents/RemoteVideoMute';
32
- import RemoteEndCall from '../subComponents/RemoteEndCall';
33
24
  import chatContext from './ChatContext';
34
- import Clipboard from '../subComponents/Clipboard';
35
- import ColorContext from './ColorContext';
36
- import {gql, useQuery} from '@apollo/client';
37
- import icons from '../assets/icons';
38
- import platform from '../subComponents/Platform';
39
- import {SidePanelType} from '../subComponents/SidePanelEnum';
40
- import {UserType} from './RTMConfigure';
41
- import styles from './styles';
42
- import TextWithToolTip from '../subComponents/TextWithTooltip'
25
+ import ParticipantSectionTitle from './participants/ParticipantSectionTitle';
26
+ import AllHostParticipants from './participants/AllHostParticipants';
27
+ import AllAudienceParticipants from './participants/AllAudienceParticipants';
28
+ import CurrentLiveStreamRequestsView from '../subComponents/livestream/CurrentLiveStreamRequestsView';
29
+ import {
30
+ ParticipantContextProvider,
31
+ ParticipantContextConsumer,
32
+ } from './participants/context/ParticipantContext';
43
33
 
44
34
  const ParticipantView = (props: any) => {
45
- const {height, width} = useWindowDimensions();
46
- const {userList, localUid} = useContext(chatContext);
47
- const {primaryColor} = useContext(ColorContext);
35
+ const {userList} = useContext(chatContext);
36
+ const {rtcProps} = useContext(PropsContext);
37
+
48
38
  const [dim, setDim] = useState([
49
39
  Dimensions.get('window').width,
50
40
  Dimensions.get('window').height,
51
41
  Dimensions.get('window').width > Dimensions.get('window').height,
52
42
  ]);
53
43
  const isSmall = dim[0] < 700;
54
- let fontSize = Platform.OS === 'web' ? 14 : 16
44
+ let fontSize = Platform.OS === 'web' ? 14 : 16;
55
45
  return (
56
46
  <View
57
47
  style={
@@ -61,108 +51,118 @@ const ParticipantView = (props: any) => {
61
51
  : style.participantView
62
52
  : style.participantViewNative
63
53
  }>
64
- <TouchableOpacity style={style.backButton}>
65
- {/* onPress={() => props.setSidePanel(SidePanelType.None)}> */}
66
- {/* <Image
67
- resizeMode={'contain'}
68
- style={style.backIcon}
69
- source={{uri: icons.backBtn}}
70
- /> */}
71
- <Text style={style.heading}>Participants</Text>
72
- </TouchableOpacity>
73
- <ScrollView style={{flex: 1}}>
74
- <MinUidConsumer>
75
- {(minUsers) => (
76
- <MaxUidConsumer>
77
- {(maxUser) =>
78
- [...minUsers, ...maxUser].map((user) =>
79
- user.uid === 'local' ? (
80
- <View style={style.participantContainer} key={user.uid}>
81
- <View style={{flex:1}}>
82
- <TextWithToolTip
83
- value={userList[localUid] ? userList[localUid].name + ' ' : 'You '}
84
- style={[style.participantText, { fontSize: RFValue(fontSize, height > width ? height : width) }]}
85
- />
86
- </View>
87
- <View style={style.participantButtonContainer}>
88
- <LocalUserContext>
89
- <View
90
- style={[style.actionBtnIcon, {marginRight: 10}]}>
91
- <LocalAudioMute btnText=" " variant="text" />
92
- </View>
93
- <View style={style.actionBtnIcon}>
94
- <LocalVideoMute btnText=" " variant="text" />
95
- </View>
96
- </LocalUserContext>
97
- </View>
98
- </View>
99
- ) : user.uid === 1 ? (
100
- <View style={style.participantContainer} key={user.uid}>
101
- <View style={{flex:1}}>
102
- <TextWithToolTip
103
- value={userList[localUid]
104
- ? userList[localUid].name + "'s screenshare "
105
- : 'Your screenshare '}
106
- style={[style.participantText, { fontSize: RFValue(fontSize, height > width ? height : width) }]}
107
- />
108
- </View>
109
- <View style={style.dummyView}>
110
- {/** its just the placeholder to adjust the UI. if no icon option to be shown */}
111
- <Text>local screen sharing</Text>
112
- </View>
113
- </View>
114
- ) : (
115
- <View style={style.participantContainer} key={user.uid} >
116
- <View style={{flex:1}}>
117
- <TextWithToolTip
118
- value={userList[user.uid]
119
- ? userList[user.uid].name + ' '
120
- : String(user.uid)[0] === '1'
121
- ? 'PSTN User '
122
- : 'User '}
123
- style={[style.participantText, { fontSize: RFValue(fontSize, height > width ? height : width) }]}
124
- />
125
- </View>
126
- {userList[user.uid]?.type !== UserType.ScreenShare ? (
127
- <View style={style.participantButtonContainer}>
128
- <View style={style.actionBtnIcon}>
129
- <RemoteEndCall
130
- uid={user.uid}
131
- isHost={props.isHost}
132
- />
133
- </View>
134
- <View
135
- style={[
136
- style.actionBtnIcon,
137
- {marginLeft: 10, marginRight: 5},
138
- ]}>
139
- <RemoteAudioMute
140
- uid={user.uid}
141
- audio={user.audio}
142
- isHost={props.isHost}
143
- />
144
- </View>
145
- <View style={[style.actionBtnIcon, {marginRight:5}]}>
146
- <RemoteVideoMute
147
- uid={user.uid}
148
- video={user.video}
54
+ <View style={[style.padding10]}>
55
+ <View style={style.lineUnderHeading}>
56
+ <Text style={style.mainHeading}>Participants</Text>
57
+ </View>
58
+ </View>
59
+ <ScrollView style={[style.bodyContainer, style.padding10]}>
60
+ {$config.EVENT_MODE ? (
61
+ // Live streaming is true
62
+ <ParticipantContextProvider>
63
+ {/* Host and New host view */}
64
+ {rtcProps?.role == ClientRole.Broadcaster &&
65
+ (props.isHost ? (
66
+ /**
67
+ * Original Host
68
+ * a) Can view streaming requests
69
+ * b) Can view all hosts with remote controls
70
+ */
71
+ <>
72
+ {/* a) Live streaming view */}
73
+ <View style={style.participantsection}>
74
+ <CurrentLiveStreamRequestsView
75
+ p_style={style}
76
+ userList={userList}
77
+ />
78
+ </View>
79
+ {/* b) Host view with remote controls*/}
80
+ <ParticipantContextConsumer>
81
+ {({hostCount}) => {
82
+ return (
83
+ <View style={style.participantsection}>
84
+ <ParticipantSectionTitle
85
+ title="Host"
86
+ count={hostCount}
87
+ />
88
+ <View style={style.participantContainer}>
89
+ <AllHostParticipants
90
+ p_style={style}
149
91
  isHost={props.isHost}
150
92
  />
151
93
  </View>
152
94
  </View>
153
- ) : (
154
- <View style={style.dummyView}>
155
- {/** its just the placeholder to adjust the UI. if no icon option to be shown */}
156
- <Text>remote screen sharing</Text>
157
- </View>
158
- )}
95
+ );
96
+ }}
97
+ </ParticipantContextConsumer>
98
+ </>
99
+ ) : (
100
+ /** New Host ( earlier was 'audience' and now is host )
101
+ * a) Can view all hosts without remote controls
102
+ */
103
+ <ParticipantContextConsumer>
104
+ {({hostList, hostCount}) => {
105
+ return (
106
+ <View style={style.participantsection}>
107
+ <ParticipantSectionTitle
108
+ title="Host"
109
+ count={hostCount}
110
+ />
111
+ <AllAudienceParticipants
112
+ p_style={style}
113
+ participantList={hostList}
114
+ isHost={props.isHost}
115
+ />
116
+ </View>
117
+ );
118
+ }}
119
+ </ParticipantContextConsumer>
120
+ ))}
121
+ {/**
122
+ * Audience views all hosts without remote controls
123
+ */}
124
+ {rtcProps?.role == ClientRole.Audience && (
125
+ <ParticipantContextConsumer>
126
+ {({hostList, hostCount}) => {
127
+ return (
128
+ <View style={style.participantsection}>
129
+ <ParticipantSectionTitle title="Host" count={hostCount} />
130
+ <AllAudienceParticipants
131
+ participantList={hostList}
132
+ p_style={style}
133
+ isHost={props.isHost}
134
+ />
159
135
  </View>
160
- ),
161
- )
162
- }
163
- </MaxUidConsumer>
164
- )}
165
- </MinUidConsumer>
136
+ );
137
+ }}
138
+ </ParticipantContextConsumer>
139
+ )}
140
+ {/* Everyone can see audience */}
141
+ <ParticipantContextConsumer>
142
+ {({audienceList, audienceCount}) => {
143
+ return (
144
+ <View style={style.participantsection}>
145
+ <ParticipantSectionTitle
146
+ title="Audience"
147
+ count={audienceCount}
148
+ />
149
+ <AllAudienceParticipants
150
+ p_style={style}
151
+ participantList={audienceList}
152
+ isHost={props.isHost}
153
+ />
154
+ </View>
155
+ );
156
+ }}
157
+ </ParticipantContextConsumer>
158
+ </ParticipantContextProvider>
159
+ ) : (
160
+ <View style={style.participantsection}>
161
+ <View style={style.participantContainer}>
162
+ <AllHostParticipants p_style={style} isHost={props.isHost} />
163
+ </View>
164
+ </View>
165
+ )}
166
166
  </ScrollView>
167
167
  <View
168
168
  style={{
@@ -180,18 +180,23 @@ const ParticipantView = (props: any) => {
180
180
  };
181
181
 
182
182
  const style = StyleSheet.create({
183
+ padding10: {
184
+ padding: 10,
185
+ },
186
+ lineUnderHeading: {
187
+ borderBottomWidth: 2,
188
+ borderBottomColor: $config.PRIMARY_COLOR,
189
+ },
183
190
  participantView: {
184
191
  width: '20%',
185
192
  minWidth: 200,
186
193
  maxWidth: 300,
187
- backgroundColor: $config.SECONDARY_FONT_COLOR,
188
194
  flex: 1,
189
- paddingTop: 20,
195
+ backgroundColor: $config.SECONDARY_FONT_COLOR,
190
196
  shadowColor: $config.PRIMARY_FONT_COLOR + '80',
191
197
  shadowOpacity: 0.5,
192
198
  shadowOffset: {width: -2, height: 0},
193
199
  shadowRadius: 3,
194
- // borderLeftWidth: 1
195
200
  },
196
201
  participantViewNative: {
197
202
  position: 'absolute',
@@ -202,82 +207,69 @@ const style = StyleSheet.create({
202
207
  top: 0,
203
208
  backgroundColor: $config.SECONDARY_FONT_COLOR,
204
209
  },
205
- heading: {
206
- fontSize: 24,
207
- fontWeight: '700',
208
- textAlign: 'center',
210
+ bodyContainer: {
211
+ flex: 1,
212
+ },
213
+ participantsection: {
214
+ marginBottom: 25,
215
+ },
216
+ mainHeading: {
217
+ fontSize: 20,
218
+ letterSpacing: 0.8,
219
+ lineHeight: 30,
220
+ color: $config.PRIMARY_FONT_COLOR,
221
+ },
222
+ infoText: {
223
+ fontSize: 12,
224
+ letterSpacing: 0.8,
225
+ fontStyle: 'italic',
209
226
  color: $config.PRIMARY_FONT_COLOR,
210
227
  },
211
228
  participantContainer: {
212
229
  width: '100%',
213
230
  display: 'flex',
214
- flexDirection: 'row',
215
- flex: 1,
216
- marginVertical: 2,
217
- backgroundColor: $config.SECONDARY_FONT_COLOR,
218
- // height: 10,
219
- paddingLeft: 10,
220
- paddingRight: 10,
221
- alignSelf: 'center',
222
- alignItems: 'center',
223
- justifyContent: 'space-between',
231
+ flexDirection: 'column',
232
+ paddingTop: 10,
233
+ paddingBottom: 20,
224
234
  },
225
- participantText: {
226
- flex: 1,
227
- fontWeight: '500',
235
+ participantRow: {
236
+ width: '100%',
237
+ display: 'flex',
228
238
  flexDirection: 'row',
229
- color: $config.PRIMARY_FONT_COLOR,
230
- lineHeight: 20,
231
- paddingHorizontal: 5,
232
- textAlign:'left',
233
- flexShrink: 1
239
+ justifyContent: 'space-between',
240
+ alignItems: 'center',
241
+ marginBottom: 5,
234
242
  },
235
- participantButtonContainer: {
236
- flex: 0.5,
243
+ participantActionContainer: {
237
244
  flexDirection: 'row',
238
245
  paddingRight: 5,
239
- justifyContent:'flex-end'
240
- },
241
- secondaryBtn: {
242
- alignSelf: 'center',
243
- width: '60%',
244
- borderColor: $config.PRIMARY_COLOR,
245
- borderWidth: 3,
246
- maxWidth: 400,
247
- minHeight: 42,
248
- minWidth: 200,
249
- marginTop: 'auto',
246
+ justifyContent: 'flex-end',
250
247
  },
251
- secondaryBtnText: {
252
- width: '100%',
253
- height: 45,
254
- lineHeight: 45,
255
- fontSize: 16,
256
- textAlign: 'center',
257
- fontWeight: '500',
258
- textAlignVertical: 'center',
259
- color: $config.PRIMARY_COLOR,
248
+ actionBtnIcon: {
249
+ width: 25,
250
+ height: 25,
260
251
  },
261
- backButton: {
262
- // marginLeft: 5,
252
+ participantText: {
253
+ lineHeight: 24,
254
+ fontSize: Platform.OS === 'web' ? 18 : 16,
263
255
  flexDirection: 'row',
264
- justifyContent: 'center',
265
- alignSelf: 'center',
256
+ letterSpacing: 0.3,
257
+ color: $config.PRIMARY_FONT_COLOR,
258
+ fontWeight: '300',
266
259
  },
267
- backIcon: {
268
- width: 20,
269
- height: 12,
270
- alignSelf: 'center',
271
- justifyContent: 'center',
272
- tintColor: $config.PRIMARY_FONT_COLOR,
260
+ participantTextSmall: {
261
+ fontSize: Platform.OS === 'web' ? 14 : 12,
273
262
  },
274
- actionBtnIcon: {
275
- width: 25,
276
- height: 25,
263
+ dummyView: {
264
+ flex: 0.5,
265
+ opacity: 0,
266
+ marginHorizontal: 5,
267
+ },
268
+ dummyView: {
269
+ flex: 0.5,
270
+ opacity: 0,
271
+ marginHorizontal: 5,
277
272
  },
278
- dummyView:{
279
- flex: 0.5,opacity:0, marginHorizontal: 5
280
- }
281
273
  });
282
274
 
283
275
  export default ParticipantView;
@@ -9,39 +9,60 @@
9
9
  information visit https://appbuilder.agora.io.
10
10
  *********************************************
11
11
  */
12
- import React, {useContext} from 'react';
13
- import {
14
- View,
15
- TouchableOpacity,
16
- Text,
17
- StyleSheet,
18
- ImageBackground,
19
- Platform,
20
- } from 'react-native';
12
+ import React, {useContext, useEffect} from 'react';
13
+ import {View, Text, StyleSheet} from 'react-native';
21
14
  import {MaxUidContext} from '../../agora-rn-uikit';
22
15
  import {MaxVideoView} from '../../agora-rn-uikit';
23
16
  import {
24
17
  LocalAudioMute,
25
18
  LocalVideoMute,
26
19
  SwitchCamera,
20
+ ClientRole,
21
+ PropsContext,
27
22
  } from '../../agora-rn-uikit';
28
23
  import {LocalUserContext} from '../../agora-rn-uikit';
29
24
  import {RtcContext} from '../../agora-rn-uikit';
30
- // import ColorContext from './ColorContext';
31
25
  import TextInput from '../atoms/TextInput';
32
26
  import Error from '../subComponents/Error';
33
27
  import PrimaryButton from '../atoms/PrimaryButton';
34
28
 
35
29
  const Precall = (props: any) => {
36
- // const {primaryColor} = useContext(ColorContext);
37
30
  const maxUsers = useContext(MaxUidContext);
38
31
  const rtc = useContext(RtcContext);
32
+ const {rtcProps} = useContext(PropsContext);
39
33
  rtc.RtcEngine.startPreview();
40
- const {setCallActive, queryComplete, username, setUsername, error} = props;
34
+
35
+ const {setCallActive, queryComplete, username, setUsername, error, title} =
36
+ props;
37
+
38
+ const [buttonText, setButtonText] = React.useState('Join Room');
39
+
40
+ useEffect(() => {
41
+ let clientRole = '';
42
+ if (rtcProps?.role == 1) {
43
+ clientRole = 'Host';
44
+ }
45
+ if (rtcProps?.role == 2) {
46
+ clientRole = 'Audience';
47
+ }
48
+ setButtonText(
49
+ $config.EVENT_MODE ? `Join Room as ${clientRole}` : `Join Room`,
50
+ );
51
+ }, [rtcProps?.role]);
52
+
53
+ const isAudienceInLiveStreaming = () =>
54
+ $config.EVENT_MODE && rtcProps?.role == ClientRole.Audience;
55
+
56
+ const meetingTitle = () => (
57
+ <>
58
+ <Text style={[style.titleHeading, {color: $config.PRIMARY_COLOR}]}>
59
+ {title}
60
+ </Text>
61
+ <View style={{height: 25}} />
62
+ </>
63
+ );
64
+
41
65
  return (
42
- // <ImageBackground
43
- // style={style.full}
44
- // resizeMode={'cover'}>
45
66
  <View style={style.full}>
46
67
  <View style={style.heading}>
47
68
  <Text style={style.headingText}>Precall </Text>
@@ -57,70 +78,59 @@ const Precall = (props: any) => {
57
78
  }}>
58
79
  {error ? <Error error={error} showBack={true} /> : <></>}
59
80
  </View>
60
- <View style={style.full}>
61
- <MaxVideoView user={maxUsers[0]} key={maxUsers[0].uid} />
62
- </View>
63
- {Platform.OS === 'ios' ? (
64
- <View style={style.textInputHolder}>
65
- <TextInput
66
- value={username}
67
- onChangeText={(text) => {
68
- setUsername(text);
69
- }}
70
- onSubmitEditing={() => {}}
71
- placeholder={queryComplete ? 'Display name*' : 'Getting name...'}
72
- />
73
- </View>
74
- ) : (
75
- <View style={style.textInputHolder}>
76
- <TextInput
77
- value={username}
78
- onChangeText={(text) => {
79
- setUsername(text);
80
- }}
81
- onSubmitEditing={() => {}}
82
- placeholder={queryComplete ? 'Display name*' : 'Getting name...'}
83
- editable={queryComplete}
84
- />
81
+ {meetingTitle()}
82
+ {!isAudienceInLiveStreaming() && (
83
+ <View style={style.full}>
84
+ <MaxVideoView user={maxUsers[0]} key={maxUsers[0].uid} />
85
85
  </View>
86
86
  )}
87
- <View style={{height: 20}} />
88
- <View style={style.controls}>
89
- <LocalUserContext>
90
- <View style={style.width50}>
91
- <LocalVideoMute />
92
- </View>
93
- <View style={style.width50} />
94
- <View style={style.width50}>
95
- <LocalAudioMute />
96
- </View>
97
- <View style={style.width50} />
98
- <View style={style.width50}>
99
- <SwitchCamera />
100
- </View>
101
- </LocalUserContext>
87
+ <View style={style.textInputHolder}>
88
+ <TextInput
89
+ value={username}
90
+ onChangeText={(text) => {
91
+ setUsername(text);
92
+ }}
93
+ onSubmitEditing={() => {}}
94
+ placeholder={queryComplete ? 'Display name*' : 'Getting name...'}
95
+ editable={queryComplete}
96
+ />
102
97
  </View>
103
- <View
104
- // onPress={() => setCallActive(true)}
105
- // disabled={!queryComplete}
106
- style={{marginBottom: 50}}>
107
- {/* <Text style={style.buttonText}> */}
108
- {/* {queryComplete ? 'Join Room' : 'Loading...'} */}
109
- {/* </Text> */}
110
- {/* </TouchableOpacity> */}
98
+ <View style={{height: 20}} />
99
+ {!isAudienceInLiveStreaming() && (
100
+ <View style={style.controls}>
101
+ <LocalUserContext>
102
+ <View style={style.width50}>
103
+ <LocalVideoMute />
104
+ </View>
105
+ <View style={style.width50} />
106
+ <View style={style.width50}>
107
+ <LocalAudioMute />
108
+ </View>
109
+ <View style={style.width50} />
110
+ <View style={style.width50}>
111
+ <SwitchCamera />
112
+ </View>
113
+ </LocalUserContext>
114
+ </View>
115
+ )}
116
+ <View style={{marginBottom: 50, alignItems: 'center'}}>
111
117
  <PrimaryButton
112
- text={'Join Room'}
118
+ text={buttonText}
113
119
  disabled={!queryComplete || username.trim() === ''}
114
120
  onPress={() => setCallActive(true)}
115
121
  />
116
122
  </View>
117
- {/* </ImageBackground> */}
118
123
  </View>
119
124
  );
120
125
  };
121
126
 
122
127
  const style = StyleSheet.create({
123
- full: {flex: 1},
128
+ full: {
129
+ flex: 1,
130
+ paddingLeft: 15,
131
+ paddingRight: 15,
132
+ justifyContent: 'center',
133
+ },
124
134
  heading: {flex: 0.1, justifyContent: 'center'},
125
135
  headingText: {
126
136
  fontSize: 24,
@@ -130,7 +140,7 @@ const style = StyleSheet.create({
130
140
  },
131
141
  textInputHolder: {
132
142
  flex: 0.1,
133
- alignSelf: 'center',
143
+ alignItems: 'center',
134
144
  paddingTop: 20,
135
145
  width: '100%',
136
146
  },
@@ -141,8 +151,6 @@ const style = StyleSheet.create({
141
151
  borderWidth: 2,
142
152
  color: $config.PRIMARY_FONT_COLOR,
143
153
  fontSize: 16,
144
- // marginBottom: 15,
145
- // maxWidth: 400,
146
154
  minHeight: 45,
147
155
  alignSelf: 'center',
148
156
  },
@@ -180,6 +188,12 @@ const style = StyleSheet.create({
180
188
  textAlignVertical: 'center',
181
189
  color: $config.SECONDARY_FONT_COLOR,
182
190
  },
191
+ titleHeading: {
192
+ fontSize: 22,
193
+ fontWeight: '700',
194
+ textAlign: 'center',
195
+ color: $config.SECONDARY_FONT_COLOR,
196
+ },
183
197
  });
184
198
 
185
199
  export default Precall;