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.
- package/Readme.md +2 -1
- package/package.json +1 -1
- package/template/_package-lock.json +8441 -8298
- 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 +8441 -8298
- package/template/package.json +2 -3
- 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 +67 -198
- 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 +171 -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,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 {
|
|
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
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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 {
|
|
46
|
-
const {
|
|
47
|
-
|
|
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
|
-
|
|
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
|
-
<
|
|
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}
|
|
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
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
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
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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
|
-
|
|
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
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
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: '
|
|
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',
|
|
230
|
+
flexDirection: 'column',
|
|
231
|
+
paddingTop: 10,
|
|
232
|
+
paddingBottom: 20,
|
|
224
233
|
},
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
234
|
+
participantRow: {
|
|
235
|
+
width: '100%',
|
|
236
|
+
display: 'flex',
|
|
228
237
|
flexDirection: 'row',
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
textAlign:'left',
|
|
233
|
-
flexShrink: 1
|
|
238
|
+
justifyContent: 'space-between',
|
|
239
|
+
alignItems: 'center',
|
|
240
|
+
marginBottom: 5,
|
|
234
241
|
},
|
|
235
|
-
|
|
236
|
-
flex: 0.5,
|
|
242
|
+
participantActionContainer: {
|
|
237
243
|
flexDirection: 'row',
|
|
238
|
-
paddingRight:
|
|
239
|
-
justifyContent:'flex-end'
|
|
240
|
-
},
|
|
241
|
-
secondaryBtn: {
|
|
244
|
+
paddingRight: 10,
|
|
242
245
|
alignSelf: 'center',
|
|
243
|
-
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
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;
|