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