agora-appbuilder-core 2.0.2 → 2.0.3-rc1

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 +8441 -8298
  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 +8441 -8298
  28. package/template/package.json +2 -3
  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 +67 -198
  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 +171 -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,32 @@ import {
15
15
  Text,
16
16
  StyleSheet,
17
17
  Platform,
18
- TouchableOpacity,
19
- Image,
20
18
  ScrollView,
21
19
  Dimensions,
22
- useWindowDimensions
23
20
  } 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';
21
+ import {PropsContext, ClientRole} from '../../agora-rn-uikit';
29
22
  import CopyJoinInfo from '../subComponents/CopyJoinInfo';
30
- import RemoteAudioMute from '../subComponents/RemoteAudioMute';
31
- import RemoteVideoMute from '../subComponents/RemoteVideoMute';
32
- import RemoteEndCall from '../subComponents/RemoteEndCall';
33
23
  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'
24
+ import ParticipantSectionTitle from './participants/ParticipantSectionTitle';
25
+ import AllHostParticipants from './participants/AllHostParticipants';
26
+ import AllAudienceParticipants from './participants/AllAudienceParticipants';
27
+ import CurrentLiveStreamRequestsView from '../subComponents/livestream/CurrentLiveStreamRequestsView';
28
+ import {
29
+ ParticipantContextProvider,
30
+ ParticipantContextConsumer,
31
+ } from './participants/context/ParticipantContext';
43
32
 
44
33
  const ParticipantView = (props: any) => {
45
- const {height, width} = useWindowDimensions();
46
- const {userList, localUid} = useContext(chatContext);
47
- const {primaryColor} = useContext(ColorContext);
34
+ const {userList} = useContext(chatContext);
35
+ const {rtcProps} = useContext(PropsContext);
36
+
48
37
  const [dim, setDim] = useState([
49
38
  Dimensions.get('window').width,
50
39
  Dimensions.get('window').height,
51
40
  Dimensions.get('window').width > Dimensions.get('window').height,
52
41
  ]);
53
42
  const isSmall = dim[0] < 700;
54
- let fontSize = Platform.OS === 'web' ? 14 : 16
43
+
55
44
  return (
56
45
  <View
57
46
  style={
@@ -61,108 +50,118 @@ const ParticipantView = (props: any) => {
61
50
  : style.participantView
62
51
  : style.participantViewNative
63
52
  }>
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}
53
+ <View style={[style.padding10]}>
54
+ <View style={style.lineUnderHeading}>
55
+ <Text style={style.mainHeading}>Participants</Text>
56
+ </View>
57
+ </View>
58
+ <ScrollView style={[style.bodyContainer, style.padding10]}>
59
+ {$config.EVENT_MODE ? (
60
+ // Live streaming is true
61
+ <ParticipantContextProvider>
62
+ {/* Host and New host view */}
63
+ {rtcProps?.role == ClientRole.Broadcaster &&
64
+ (props.isHost ? (
65
+ /**
66
+ * Original Host
67
+ * a) Can view streaming requests
68
+ * b) Can view all hosts with remote controls
69
+ */
70
+ <>
71
+ {/* a) Live streaming view */}
72
+ <View style={style.participantsection}>
73
+ <CurrentLiveStreamRequestsView
74
+ p_style={style}
75
+ userList={userList}
76
+ />
77
+ </View>
78
+ {/* b) Host view with remote controls*/}
79
+ <ParticipantContextConsumer>
80
+ {({hostCount}) => {
81
+ return (
82
+ <View style={style.participantsection}>
83
+ <ParticipantSectionTitle
84
+ title="Host"
85
+ count={hostCount}
86
+ />
87
+ <View style={style.participantContainer}>
88
+ <AllHostParticipants
89
+ p_style={style}
149
90
  isHost={props.isHost}
150
91
  />
151
92
  </View>
152
93
  </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
- )}
94
+ );
95
+ }}
96
+ </ParticipantContextConsumer>
97
+ </>
98
+ ) : (
99
+ /** New Host ( earlier was 'audience' and now is host )
100
+ * a) Can view all hosts without remote controls
101
+ */
102
+ <ParticipantContextConsumer>
103
+ {({hostList, hostCount}) => {
104
+ return (
105
+ <View style={style.participantsection}>
106
+ <ParticipantSectionTitle
107
+ title="Host"
108
+ count={hostCount}
109
+ />
110
+ <AllAudienceParticipants
111
+ p_style={style}
112
+ participantList={hostList}
113
+ isHost={props.isHost}
114
+ />
115
+ </View>
116
+ );
117
+ }}
118
+ </ParticipantContextConsumer>
119
+ ))}
120
+ {/**
121
+ * Audience views all hosts without remote controls
122
+ */}
123
+ {rtcProps?.role == ClientRole.Audience && (
124
+ <ParticipantContextConsumer>
125
+ {({hostList, hostCount}) => {
126
+ return (
127
+ <View style={style.participantsection}>
128
+ <ParticipantSectionTitle title="Host" count={hostCount} />
129
+ <AllAudienceParticipants
130
+ participantList={hostList}
131
+ p_style={style}
132
+ isHost={props.isHost}
133
+ />
159
134
  </View>
160
- ),
161
- )
162
- }
163
- </MaxUidConsumer>
164
- )}
165
- </MinUidConsumer>
135
+ );
136
+ }}
137
+ </ParticipantContextConsumer>
138
+ )}
139
+ {/* Everyone can see audience */}
140
+ <ParticipantContextConsumer>
141
+ {({audienceList, audienceCount}) => {
142
+ return (
143
+ <View style={style.participantsection}>
144
+ <ParticipantSectionTitle
145
+ title="Audience"
146
+ count={audienceCount}
147
+ />
148
+ <AllAudienceParticipants
149
+ p_style={style}
150
+ participantList={audienceList}
151
+ isHost={props.isHost}
152
+ />
153
+ </View>
154
+ );
155
+ }}
156
+ </ParticipantContextConsumer>
157
+ </ParticipantContextProvider>
158
+ ) : (
159
+ <View style={style.participantsection}>
160
+ <View style={style.participantContainer}>
161
+ <AllHostParticipants p_style={style} isHost={props.isHost} />
162
+ </View>
163
+ </View>
164
+ )}
166
165
  </ScrollView>
167
166
  <View
168
167
  style={{
@@ -180,18 +179,23 @@ const ParticipantView = (props: any) => {
180
179
  };
181
180
 
182
181
  const style = StyleSheet.create({
182
+ padding10: {
183
+ padding: 10,
184
+ },
185
+ lineUnderHeading: {
186
+ borderBottomWidth: 2,
187
+ borderBottomColor: $config.PRIMARY_COLOR,
188
+ },
183
189
  participantView: {
184
190
  width: '20%',
185
191
  minWidth: 200,
186
192
  maxWidth: 300,
187
- backgroundColor: $config.SECONDARY_FONT_COLOR,
188
193
  flex: 1,
189
- paddingTop: 20,
194
+ backgroundColor: $config.SECONDARY_FONT_COLOR,
190
195
  shadowColor: $config.PRIMARY_FONT_COLOR + '80',
191
196
  shadowOpacity: 0.5,
192
197
  shadowOffset: {width: -2, height: 0},
193
198
  shadowRadius: 3,
194
- // borderLeftWidth: 1
195
199
  },
196
200
  participantViewNative: {
197
201
  position: 'absolute',
@@ -202,82 +206,65 @@ const style = StyleSheet.create({
202
206
  top: 0,
203
207
  backgroundColor: $config.SECONDARY_FONT_COLOR,
204
208
  },
205
- heading: {
206
- fontSize: 24,
207
- fontWeight: '700',
208
- textAlign: 'center',
209
+ bodyContainer: {
210
+ flex: 1,
211
+ },
212
+ participantsection: {
213
+ marginBottom: 25,
214
+ },
215
+ mainHeading: {
216
+ fontSize: 20,
217
+ letterSpacing: 0.8,
218
+ lineHeight: 30,
219
+ color: $config.PRIMARY_FONT_COLOR,
220
+ },
221
+ infoText: {
222
+ fontSize: 12,
223
+ letterSpacing: 0.8,
224
+ fontStyle: 'italic',
209
225
  color: $config.PRIMARY_FONT_COLOR,
210
226
  },
211
227
  participantContainer: {
212
228
  width: '100%',
213
229
  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',
230
+ flexDirection: 'column',
231
+ paddingTop: 10,
232
+ paddingBottom: 20,
224
233
  },
225
- participantText: {
226
- flex: 1,
227
- fontWeight: '500',
234
+ participantRow: {
235
+ width: '100%',
236
+ display: 'flex',
228
237
  flexDirection: 'row',
229
- color: $config.PRIMARY_FONT_COLOR,
230
- lineHeight: 20,
231
- paddingHorizontal: 5,
232
- textAlign:'left',
233
- flexShrink: 1
238
+ justifyContent: 'space-between',
239
+ alignItems: 'center',
240
+ marginBottom: 5,
234
241
  },
235
- participantButtonContainer: {
236
- flex: 0.5,
242
+ participantActionContainer: {
237
243
  flexDirection: 'row',
238
- paddingRight: 5,
239
- justifyContent:'flex-end'
240
- },
241
- secondaryBtn: {
244
+ paddingRight: 10,
242
245
  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
+ alignItems: 'center',
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,
277
267
  },
278
- dummyView:{
279
- flex: 0.5,opacity:0, marginHorizontal: 5
280
- }
281
268
  });
282
269
 
283
270
  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;