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.
- package/Readme.md +2 -1
- package/package.json +1 -1
- package/template/_package-lock.json +8853 -8806
- package/template/agora-rn-uikit/.git/index +0 -0
- package/template/agora-rn-uikit/.git/logs/HEAD +2 -2
- package/template/agora-rn-uikit/.git/logs/refs/heads/ab-dev-auto +1 -1
- package/template/agora-rn-uikit/.git/logs/refs/heads/master +1 -1
- package/template/agora-rn-uikit/.git/logs/refs/remotes/origin/HEAD +1 -1
- package/template/agora-rn-uikit/.git/objects/pack/pack-2a0122bf5a3199f941e5a52535f43881623f752c.idx +0 -0
- package/template/agora-rn-uikit/.git/objects/pack/{pack-f379286d0537eb68377220b4929979324b8d5d1c.pack → pack-2a0122bf5a3199f941e5a52535f43881623f752c.pack} +0 -0
- package/template/agora-rn-uikit/.git/packed-refs +4 -2
- package/template/agora-rn-uikit/.git/refs/heads/ab-dev-auto +1 -1
- package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +21 -0
- package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +22 -14
- package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +17 -13
- package/template/agora-rn-uikit/src/Controls/types.ts +4 -0
- package/template/agora-rn-uikit/src/Rtc/Create.tsx +117 -19
- package/template/agora-rn-uikit/src/RtcConfigure.tsx +24 -13
- package/template/{src/utils/isSafariBrowser.tsx → agora-rn-uikit/src/Utils/isSafariBrowser.ts} +3 -0
- package/template/{src → agora-rn-uikit/src}/hooks/useImageDelay.tsx +5 -2
- package/template/agora-rn-uikit/src/index.ts +2 -0
- package/template/bridge/rtc/webNg/RtcEngine.ts +73 -70
- package/template/bridge/rtc/webNg/Types.ts +59 -5
- package/template/bridge/rtm/web/Types.ts +13 -0
- package/template/bridge/rtm/web/index.ts +78 -1
- package/template/global.d.ts +2 -0
- package/template/package-lock.json +8853 -8806
- package/template/package.json +3 -4
- package/template/react-native-toast-message/src/components/base/styles.js +4 -2
- package/template/src/assets/icons.ts +41 -28
- package/template/src/components/Chat.tsx +70 -184
- package/template/src/components/ChatContext.ts +13 -2
- package/template/src/components/Controls.native.tsx +37 -76
- package/template/src/components/Controls.tsx +50 -158
- package/template/src/components/DeviceConfigure.native.tsx +5 -1
- package/template/src/components/DeviceConfigure.tsx +38 -20
- package/template/src/components/Navbar.tsx +185 -226
- package/template/src/components/ParticipantsView.tsx +176 -184
- package/template/src/components/Precall.native.tsx +83 -69
- package/template/src/components/Precall.tsx +174 -191
- package/template/src/components/RTMConfigure.tsx +264 -78
- package/template/src/components/SettingsView.tsx +9 -19
- package/template/src/components/livestream/LiveStreamContext.tsx +411 -0
- package/template/src/components/livestream/Types.ts +69 -0
- package/template/src/components/livestream/index.ts +9 -0
- package/template/src/components/livestream/views/LiveStreamControls.tsx +27 -0
- package/template/src/components/participants/AllAudienceParticipants.tsx +53 -0
- package/template/src/components/participants/AllHostParticipants.tsx +65 -0
- package/template/src/components/participants/MeParticipant.tsx +37 -0
- package/template/src/components/participants/ParticipantName.tsx +47 -0
- package/template/src/components/participants/ParticipantSectionTitle.tsx +29 -0
- package/template/src/components/participants/RemoteParticipants.tsx +69 -0
- package/template/src/components/participants/ScreenshareParticipants.tsx +28 -0
- package/template/src/components/participants/context/ParticipantContext.tsx +97 -0
- package/template/src/components/styles.ts +13 -0
- package/template/src/pages/Create.tsx +25 -14
- package/template/src/pages/VideoCall.tsx +197 -159
- package/template/src/subComponents/ChatBubble.tsx +4 -1
- package/template/src/subComponents/ChatContainer.tsx +44 -20
- package/template/src/subComponents/ChatInput.tsx +4 -12
- package/template/src/subComponents/Checkbox.native.tsx +6 -5
- package/template/src/subComponents/Checkbox.tsx +1 -0
- package/template/src/subComponents/Recording.tsx +23 -9
- package/template/src/subComponents/RemoteVideoMute.tsx +2 -3
- package/template/src/subComponents/SelectDevice.tsx +70 -35
- package/template/src/subComponents/chat/ChatParticipants.tsx +121 -0
- package/template/src/subComponents/livestream/ApprovedLiveStreamControlsView.tsx +23 -0
- package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +70 -0
- package/template/src/subComponents/livestream/controls/LocalRaiseHand.tsx +57 -0
- package/template/src/subComponents/livestream/controls/RemoteLiveStreamApprovedRequestRecall.tsx +24 -0
- package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestApprove.tsx +38 -0
- package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestReject.tsx +37 -0
- package/template/src/subComponents/livestream/index.ts +18 -0
- package/template/src/subComponents/screenshare/ScreenshareButton.tsx +80 -0
- package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +24 -0
- package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +200 -0
- package/template/src/subComponents/screenshare/ScreenshareContext.tsx +21 -0
- package/template/src/utils/index.tsx +48 -0
- 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 {
|
|
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
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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 {
|
|
46
|
-
const {
|
|
47
|
-
|
|
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
|
-
<
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
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
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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
|
-
|
|
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
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
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: '
|
|
215
|
-
|
|
216
|
-
|
|
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
|
-
|
|
226
|
-
|
|
227
|
-
|
|
235
|
+
participantRow: {
|
|
236
|
+
width: '100%',
|
|
237
|
+
display: 'flex',
|
|
228
238
|
flexDirection: 'row',
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
textAlign:'left',
|
|
233
|
-
flexShrink: 1
|
|
239
|
+
justifyContent: 'space-between',
|
|
240
|
+
alignItems: 'center',
|
|
241
|
+
marginBottom: 5,
|
|
234
242
|
},
|
|
235
|
-
|
|
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
|
-
|
|
252
|
-
width:
|
|
253
|
-
height:
|
|
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
|
-
|
|
262
|
-
|
|
252
|
+
participantText: {
|
|
253
|
+
lineHeight: 24,
|
|
254
|
+
fontSize: Platform.OS === 'web' ? 18 : 16,
|
|
263
255
|
flexDirection: 'row',
|
|
264
|
-
|
|
265
|
-
|
|
256
|
+
letterSpacing: 0.3,
|
|
257
|
+
color: $config.PRIMARY_FONT_COLOR,
|
|
258
|
+
fontWeight: '300',
|
|
266
259
|
},
|
|
267
|
-
|
|
268
|
-
|
|
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
|
-
|
|
275
|
-
|
|
276
|
-
|
|
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
|
-
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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={
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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={
|
|
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: {
|
|
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
|
-
|
|
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;
|