agora-appbuilder-core 2.0.0 → 2.0.1
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/package.json +3 -2
- package/template/_package-lock.json +22850 -0
- package/template/agora-rn-uikit/.git/HEAD +1 -1
- package/template/agora-rn-uikit/.git/index +0 -0
- package/template/agora-rn-uikit/.git/logs/HEAD +2 -3
- 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-f379286d0537eb68377220b4929979324b8d5d1c.idx +0 -0
- package/template/agora-rn-uikit/.git/objects/pack/{pack-19a65e0782e617d79275088a06e668496d6e2d73.pack → pack-f379286d0537eb68377220b4929979324b8d5d1c.pack} +0 -0
- package/template/agora-rn-uikit/.git/packed-refs +3 -2
- package/template/agora-rn-uikit/.git/refs/heads/ab-dev-auto +1 -1
- package/template/agora-rn-uikit/package.json +1 -0
- package/template/agora-rn-uikit/src/AgoraUIKit.tsx +8 -8
- package/template/agora-rn-uikit/src/{LocalUserContext.tsx → Contexts/LocalUserContext.tsx} +1 -1
- package/template/agora-rn-uikit/src/{MaxUidContext.tsx → Contexts/MaxUidContext.tsx} +0 -0
- package/template/agora-rn-uikit/src/{MinUidContext.tsx → Contexts/MinUidContext.tsx} +0 -0
- package/template/agora-rn-uikit/src/{PropsContext.tsx → Contexts/PropsContext.tsx} +34 -16
- package/template/agora-rn-uikit/src/{RtcContext.tsx → Contexts/RtcContext.tsx} +12 -21
- package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +25 -15
- package/template/agora-rn-uikit/src/Controls/Icons.ts +53 -3
- package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +53 -0
- package/template/agora-rn-uikit/src/Controls/Local/EndCall.tsx +4 -3
- package/template/agora-rn-uikit/src/Controls/Local/FullScreen.tsx +3 -3
- package/template/agora-rn-uikit/src/Controls/Local/LocalAudioMute.tsx +58 -14
- package/template/agora-rn-uikit/src/Controls/Local/LocalVideoMute.tsx +60 -14
- package/template/agora-rn-uikit/src/Controls/Local/Recording.tsx +2 -2
- package/template/agora-rn-uikit/src/Controls/Local/Screenshare.tsx +2 -2
- package/template/agora-rn-uikit/src/Controls/Local/SwitchCamera.tsx +9 -9
- package/template/agora-rn-uikit/src/Controls/LocalControls.tsx +20 -17
- package/template/agora-rn-uikit/src/Controls/Remote/RemoteAudioMute.tsx +8 -8
- package/template/agora-rn-uikit/src/Controls/Remote/RemoteSwap.tsx +3 -3
- package/template/agora-rn-uikit/src/Controls/Remote/RemoteVideoMute.tsx +13 -8
- package/template/agora-rn-uikit/src/Controls/RemoteControls.tsx +1 -2
- package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +20 -0
- package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +20 -0
- package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +26 -0
- package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +26 -0
- package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +46 -0
- package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +47 -0
- package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +20 -0
- package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +20 -0
- package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +21 -0
- package/template/agora-rn-uikit/src/Reducer/index.ts +9 -0
- package/template/agora-rn-uikit/src/Rtc/Create.tsx +138 -0
- package/template/agora-rn-uikit/src/Rtc/Join.tsx +100 -0
- package/template/agora-rn-uikit/src/RtcConfigure.tsx +197 -0
- package/template/agora-rn-uikit/src/Style.ts +3 -3
- package/template/agora-rn-uikit/src/Utils/actionTypeGuard.tsx +9 -0
- package/template/agora-rn-uikit/src/{events.ts → Utils/events.ts} +0 -0
- package/template/agora-rn-uikit/src/{permission.ts → Utils/permission.ts} +0 -0
- package/template/agora-rn-uikit/src/{quality.tsx → Utils/quality.tsx} +0 -0
- package/template/agora-rn-uikit/src/{MaxVideoView.native.tsx → Views/MaxVideoView.native.tsx} +3 -4
- package/template/agora-rn-uikit/src/{MaxVideoView.tsx → Views/MaxVideoView.tsx} +3 -4
- package/template/agora-rn-uikit/src/Views/MinVideoView.tsx +86 -0
- package/template/agora-rn-uikit/src/index.ts +67 -0
- package/template/bridge/rtc/webNg/RtcEngine.ts +23 -6
- package/template/package-lock.json +22850 -0
- package/template/package.json +6 -5
- package/template/src/assets/icons.ts +35 -6
- package/template/src/atoms/SecondaryButton.tsx +6 -5
- package/template/src/atoms/TextInput.tsx +6 -1
- package/template/src/components/Chat.tsx +50 -21
- package/template/src/components/ChatContext.ts +22 -1
- package/template/src/components/Controls.native.tsx +2 -2
- package/template/src/components/Controls.tsx +2 -2
- package/template/src/components/DeviceConfigure.tsx +1 -1
- package/template/src/components/GridVideo.tsx +69 -31
- package/template/src/components/Navbar.tsx +136 -113
- package/template/src/components/NetworkQualityContext.tsx +134 -0
- package/template/src/components/ParticipantsView.tsx +105 -49
- package/template/src/components/PinnedVideo.tsx +112 -71
- package/template/src/components/Precall.native.tsx +20 -9
- package/template/src/components/Precall.tsx +35 -32
- package/template/src/components/RTMConfigure.tsx +331 -181
- package/template/src/components/RTMEvents.tsx +84 -0
- package/template/src/components/Settings.tsx +19 -16
- package/template/src/components/Share.tsx +131 -62
- package/template/src/hooks/useImageDelay.tsx +28 -0
- package/template/src/pages/Create.tsx +9 -3
- package/template/src/pages/VideoCall.tsx +124 -98
- package/template/src/subComponents/ChatContainer.tsx +40 -28
- package/template/src/subComponents/CopyJoinInfo.tsx +9 -12
- package/template/src/subComponents/LocalAudioMute.tsx +9 -9
- package/template/src/subComponents/LocalVideoMute.tsx +9 -9
- package/template/src/subComponents/NetworkQualityPill.tsx +161 -0
- package/template/src/subComponents/Recording.tsx +12 -16
- package/template/src/subComponents/RemoteAudioMute.tsx +23 -27
- package/template/src/subComponents/RemoteEndCall.tsx +7 -15
- package/template/src/subComponents/RemoteVideoMute.tsx +15 -28
- package/template/src/subComponents/ScreenShareNotice.tsx +61 -0
- package/template/src/subComponents/ScreenshareButton.tsx +74 -75
- package/template/src/subComponents/SwitchCamera.tsx +5 -2
- package/template/src/subComponents/TextWithTooltip.native.tsx +128 -0
- package/template/src/subComponents/TextWithTooltip.tsx +44 -0
- package/template/src/subComponents/toastConfig.tsx +2 -2
- package/template/src/utils/isSafariBrowser.tsx +22 -0
- package/template/agora-rn-uikit/.git/objects/pack/pack-19a65e0782e617d79275088a06e668496d6e2d73.idx +0 -0
- package/template/agora-rn-uikit/Components.js +0 -35
- package/template/agora-rn-uikit/Contexts.js +0 -7
- package/template/agora-rn-uikit/index.js +0 -12
- package/template/agora-rn-uikit/src/MinVideoView.tsx +0 -87
- package/template/agora-rn-uikit/src/RTCConfigure.tsx +0 -520
|
@@ -19,12 +19,13 @@ import {
|
|
|
19
19
|
Image,
|
|
20
20
|
ScrollView,
|
|
21
21
|
Dimensions,
|
|
22
|
+
useWindowDimensions
|
|
22
23
|
} from 'react-native';
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import
|
|
26
|
-
import LocalVideoMute from '
|
|
27
|
-
import LocalUserContext from '../../agora-rn-uikit
|
|
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';
|
|
28
29
|
import CopyJoinInfo from '../subComponents/CopyJoinInfo';
|
|
29
30
|
import RemoteAudioMute from '../subComponents/RemoteAudioMute';
|
|
30
31
|
import RemoteVideoMute from '../subComponents/RemoteVideoMute';
|
|
@@ -37,8 +38,11 @@ import icons from '../assets/icons';
|
|
|
37
38
|
import platform from '../subComponents/Platform';
|
|
38
39
|
import {SidePanelType} from '../subComponents/SidePanelEnum';
|
|
39
40
|
import {UserType} from './RTMConfigure';
|
|
41
|
+
import styles from './styles';
|
|
42
|
+
import TextWithToolTip from '../subComponents/TextWithTooltip'
|
|
40
43
|
|
|
41
44
|
const ParticipantView = (props: any) => {
|
|
45
|
+
const {height, width} = useWindowDimensions();
|
|
42
46
|
const {userList, localUid} = useContext(chatContext);
|
|
43
47
|
const {primaryColor} = useContext(ColorContext);
|
|
44
48
|
const [dim, setDim] = useState([
|
|
@@ -47,12 +51,14 @@ const ParticipantView = (props: any) => {
|
|
|
47
51
|
Dimensions.get('window').width > Dimensions.get('window').height,
|
|
48
52
|
]);
|
|
49
53
|
const isSmall = dim[0] < 700;
|
|
50
|
-
|
|
54
|
+
let fontSize = Platform.OS === 'web' ? 14 : 16
|
|
51
55
|
return (
|
|
52
56
|
<View
|
|
53
57
|
style={
|
|
54
58
|
Platform.OS === 'web'
|
|
55
|
-
? isSmall
|
|
59
|
+
? isSmall
|
|
60
|
+
? style.participantViewNative
|
|
61
|
+
: style.participantView
|
|
56
62
|
: style.participantViewNative
|
|
57
63
|
}>
|
|
58
64
|
<TouchableOpacity style={style.backButton}>
|
|
@@ -72,50 +78,83 @@ const ParticipantView = (props: any) => {
|
|
|
72
78
|
[...minUsers, ...maxUser].map((user) =>
|
|
73
79
|
user.uid === 'local' ? (
|
|
74
80
|
<View style={style.participantContainer} key={user.uid}>
|
|
75
|
-
<
|
|
76
|
-
|
|
77
|
-
? userList[localUid].name + ' '
|
|
78
|
-
:
|
|
79
|
-
|
|
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>
|
|
80
87
|
<View style={style.participantButtonContainer}>
|
|
81
88
|
<LocalUserContext>
|
|
82
|
-
<
|
|
83
|
-
|
|
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>
|
|
84
96
|
</LocalUserContext>
|
|
85
97
|
</View>
|
|
86
98
|
</View>
|
|
87
99
|
) : user.uid === 1 ? (
|
|
88
100
|
<View style={style.participantContainer} key={user.uid}>
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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>
|
|
94
113
|
</View>
|
|
95
114
|
) : (
|
|
96
|
-
<View style={style.participantContainer} key={user.uid}>
|
|
97
|
-
<
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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>
|
|
103
126
|
{userList[user.uid]?.type !== UserType.ScreenShare ? (
|
|
104
127
|
<View style={style.participantButtonContainer}>
|
|
105
|
-
<
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
<
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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}
|
|
149
|
+
isHost={props.isHost}
|
|
150
|
+
/>
|
|
151
|
+
</View>
|
|
116
152
|
</View>
|
|
117
153
|
) : (
|
|
118
|
-
|
|
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>
|
|
119
158
|
)}
|
|
120
159
|
</View>
|
|
121
160
|
),
|
|
@@ -125,8 +164,16 @@ const ParticipantView = (props: any) => {
|
|
|
125
164
|
)}
|
|
126
165
|
</MinUidConsumer>
|
|
127
166
|
</ScrollView>
|
|
128
|
-
<View
|
|
129
|
-
|
|
167
|
+
<View
|
|
168
|
+
style={{
|
|
169
|
+
width: '100%',
|
|
170
|
+
height: 50,
|
|
171
|
+
alignSelf: 'flex-end',
|
|
172
|
+
flexDirection: 'row',
|
|
173
|
+
alignItems: 'center',
|
|
174
|
+
justifyContent: 'center',
|
|
175
|
+
}}>
|
|
176
|
+
<CopyJoinInfo showText={true} />
|
|
130
177
|
</View>
|
|
131
178
|
</View>
|
|
132
179
|
);
|
|
@@ -162,32 +209,34 @@ const style = StyleSheet.create({
|
|
|
162
209
|
color: $config.PRIMARY_FONT_COLOR,
|
|
163
210
|
},
|
|
164
211
|
participantContainer: {
|
|
212
|
+
width: '100%',
|
|
213
|
+
display: 'flex',
|
|
165
214
|
flexDirection: 'row',
|
|
166
215
|
flex: 1,
|
|
167
216
|
marginVertical: 2,
|
|
168
217
|
backgroundColor: $config.SECONDARY_FONT_COLOR,
|
|
169
218
|
// height: 10,
|
|
170
|
-
|
|
219
|
+
paddingLeft: 10,
|
|
220
|
+
paddingRight: 10,
|
|
171
221
|
alignSelf: 'center',
|
|
172
|
-
justifyContent: 'center',
|
|
173
222
|
alignItems: 'center',
|
|
223
|
+
justifyContent: 'space-between',
|
|
174
224
|
},
|
|
175
225
|
participantText: {
|
|
176
226
|
flex: 1,
|
|
177
|
-
fontSize: Platform.OS === 'web' ? 18 : 16,
|
|
178
227
|
fontWeight: '500',
|
|
179
228
|
flexDirection: 'row',
|
|
180
229
|
color: $config.PRIMARY_FONT_COLOR,
|
|
181
230
|
lineHeight: 20,
|
|
182
|
-
|
|
183
|
-
|
|
231
|
+
paddingHorizontal: 5,
|
|
232
|
+
textAlign:'left',
|
|
233
|
+
flexShrink: 1
|
|
184
234
|
},
|
|
185
235
|
participantButtonContainer: {
|
|
186
|
-
|
|
236
|
+
flex: 0.5,
|
|
187
237
|
flexDirection: 'row',
|
|
188
|
-
paddingRight:
|
|
189
|
-
|
|
190
|
-
alignItems: 'center',
|
|
238
|
+
paddingRight: 5,
|
|
239
|
+
justifyContent:'flex-end'
|
|
191
240
|
},
|
|
192
241
|
secondaryBtn: {
|
|
193
242
|
alignSelf: 'center',
|
|
@@ -222,6 +271,13 @@ const style = StyleSheet.create({
|
|
|
222
271
|
justifyContent: 'center',
|
|
223
272
|
tintColor: $config.PRIMARY_FONT_COLOR,
|
|
224
273
|
},
|
|
274
|
+
actionBtnIcon: {
|
|
275
|
+
width: 25,
|
|
276
|
+
height: 25,
|
|
277
|
+
},
|
|
278
|
+
dummyView:{
|
|
279
|
+
flex: 0.5,opacity:0, marginHorizontal: 5
|
|
280
|
+
}
|
|
225
281
|
});
|
|
226
282
|
|
|
227
283
|
export default ParticipantView;
|
|
@@ -18,21 +18,28 @@ import {
|
|
|
18
18
|
Text,
|
|
19
19
|
Image,
|
|
20
20
|
Pressable,
|
|
21
|
+
useWindowDimensions,
|
|
21
22
|
} from 'react-native';
|
|
22
|
-
import {MinUidConsumer} from '../../agora-rn-uikit
|
|
23
|
-
import RtcContext from '../../agora-rn-uikit
|
|
24
|
-
import {MaxVideoView} from '../../agora-rn-uikit
|
|
25
|
-
import {MaxUidConsumer} from '../../agora-rn-uikit
|
|
23
|
+
import {MinUidConsumer} from '../../agora-rn-uikit';
|
|
24
|
+
import {RtcContext} from '../../agora-rn-uikit';
|
|
25
|
+
import {MaxVideoView} from '../../agora-rn-uikit';
|
|
26
|
+
import {MaxUidConsumer} from '../../agora-rn-uikit';
|
|
26
27
|
import chatContext from './ChatContext';
|
|
27
28
|
import ColorContext from './ColorContext';
|
|
28
|
-
import icons from '../assets/icons';
|
|
29
29
|
import {layoutProps} from '../../theme.json';
|
|
30
30
|
import FallbackLogo from '../subComponents/FallbackLogo';
|
|
31
|
-
|
|
31
|
+
import {ImageIcon} from '../../agora-rn-uikit';
|
|
32
|
+
import ScreenShareNotice from '../subComponents/ScreenShareNotice';
|
|
33
|
+
import {RFValue} from 'react-native-responsive-fontsize';
|
|
32
34
|
const {topPinned} = layoutProps;
|
|
35
|
+
import networkQualityContext from './NetworkQualityContext';
|
|
36
|
+
import {NetworkQualityPill} from '../subComponents/NetworkQualityPill';
|
|
37
|
+
import TextWithTooltip from '../subComponents/TextWithTooltip';
|
|
33
38
|
|
|
34
39
|
const PinnedVideo = () => {
|
|
40
|
+
const {height, width} = useWindowDimensions();
|
|
35
41
|
const {primaryColor} = useContext(ColorContext);
|
|
42
|
+
const networkQualityStat = useContext(networkQualityContext);
|
|
36
43
|
const [collapse, setCollapse] = useState(false);
|
|
37
44
|
const [dim, setDim] = useState([
|
|
38
45
|
Dimensions.get('window').width,
|
|
@@ -129,18 +136,26 @@ const PinnedVideo = () => {
|
|
|
129
136
|
data.dispatch({type: 'SwapVideo', value: [user]});
|
|
130
137
|
}}>
|
|
131
138
|
<View style={style.flex1}>
|
|
139
|
+
<NetworkQualityPill
|
|
140
|
+
networkStat={
|
|
141
|
+
networkQualityStat[user.uid]
|
|
142
|
+
? networkQualityStat[user.uid]
|
|
143
|
+
: user.audio || user.video
|
|
144
|
+
? 8
|
|
145
|
+
: 7
|
|
146
|
+
}
|
|
147
|
+
primaryColor={primaryColor}
|
|
148
|
+
rootStyle={{left: 5, top: 5}}
|
|
149
|
+
small
|
|
150
|
+
/>
|
|
132
151
|
<MaxVideoView
|
|
133
152
|
fallback={() => {
|
|
134
153
|
if (user.uid === 'local') {
|
|
135
154
|
return FallbackLogo(userList[localUid]?.name);
|
|
136
155
|
} else if (String(user.uid)[0] === '1') {
|
|
137
|
-
return FallbackLogo(
|
|
138
|
-
'PSTN User'
|
|
139
|
-
);
|
|
156
|
+
return FallbackLogo('PSTN User');
|
|
140
157
|
} else {
|
|
141
|
-
return FallbackLogo(
|
|
142
|
-
userList[user.uid]?.name,
|
|
143
|
-
);
|
|
158
|
+
return FallbackLogo(userList[user.uid]?.name);
|
|
144
159
|
}
|
|
145
160
|
}}
|
|
146
161
|
user={user}
|
|
@@ -148,31 +163,36 @@ const PinnedVideo = () => {
|
|
|
148
163
|
/>
|
|
149
164
|
<View style={style.nameHolder}>
|
|
150
165
|
<View style={[style.MicBackdrop]}>
|
|
151
|
-
<
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
166
|
+
<ImageIcon
|
|
167
|
+
name={user.audio ? 'mic' : 'micOff'}
|
|
168
|
+
color={user.audio ? primaryColor : 'red'}
|
|
169
|
+
style={style.MicIcon}
|
|
170
|
+
/>
|
|
171
|
+
</View>
|
|
172
|
+
<View style={{flex:1}}>
|
|
173
|
+
<TextWithTooltip
|
|
174
|
+
value={user.uid === 'local'
|
|
175
|
+
? userList[localUid]
|
|
176
|
+
? userList[localUid].name + ' '
|
|
177
|
+
: 'You '
|
|
178
|
+
: userList[user.uid]
|
|
179
|
+
? userList[user.uid].name + ' '
|
|
180
|
+
: user.uid === 1
|
|
181
|
+
? (userList[localUid]?.name + "'s screen ")
|
|
182
|
+
: String(user.uid)[0] === '1'
|
|
183
|
+
? 'PSTN User '
|
|
184
|
+
: 'User '}
|
|
155
185
|
style={[
|
|
156
|
-
style.
|
|
186
|
+
style.name,
|
|
157
187
|
{
|
|
158
|
-
|
|
188
|
+
fontSize: RFValue(
|
|
189
|
+
14,
|
|
190
|
+
height > width ? height : width,
|
|
191
|
+
),
|
|
159
192
|
},
|
|
160
193
|
]}
|
|
161
|
-
resizeMode={'contain'}
|
|
162
194
|
/>
|
|
163
195
|
</View>
|
|
164
|
-
<Text style={style.name}>
|
|
165
|
-
{user.uid === 'local'
|
|
166
|
-
? userList[localUid]
|
|
167
|
-
? userList[localUid].name.slice(0, 20) + ' '
|
|
168
|
-
: 'You '
|
|
169
|
-
: userList[user.uid]
|
|
170
|
-
? userList[user.uid].name.slice(0, 20) + ' '
|
|
171
|
-
: user.uid === 1
|
|
172
|
-
? (userList[localUid]?.name + "'s screen ").slice(0, 20)
|
|
173
|
-
: String(user.uid)[0] === '1' ?
|
|
174
|
-
'PSTN User ' : 'User '}
|
|
175
|
-
</Text>
|
|
176
196
|
</View>
|
|
177
197
|
</View>
|
|
178
198
|
</Pressable>
|
|
@@ -193,48 +213,66 @@ const PinnedVideo = () => {
|
|
|
193
213
|
}>
|
|
194
214
|
<MaxUidConsumer>
|
|
195
215
|
{(maxUsers) => (
|
|
196
|
-
|
|
197
|
-
<
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
216
|
+
<>
|
|
217
|
+
<View style={style.flex1}>
|
|
218
|
+
<ScreenShareNotice uid={maxUsers[0].uid} />
|
|
219
|
+
<NetworkQualityPill
|
|
220
|
+
networkStat={
|
|
221
|
+
networkQualityStat[maxUsers[0].uid]
|
|
222
|
+
? networkQualityStat[maxUsers[0].uid]
|
|
223
|
+
: maxUsers[0].audio || maxUsers[0].video
|
|
224
|
+
? 8
|
|
225
|
+
: 7
|
|
205
226
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
227
|
+
primaryColor={primaryColor}
|
|
228
|
+
rootStyle={{
|
|
229
|
+
marginLeft: 25,
|
|
230
|
+
top: 8,
|
|
231
|
+
right: 10,
|
|
232
|
+
}}
|
|
233
|
+
small
|
|
234
|
+
/>
|
|
235
|
+
<MaxVideoView
|
|
236
|
+
fallback={() => {
|
|
237
|
+
if (maxUsers[0].uid === 'local') {
|
|
238
|
+
return FallbackLogo(userList[localUid]?.name);
|
|
239
|
+
} else if (String(maxUsers[0].uid)[0] === '1') {
|
|
240
|
+
return FallbackLogo('PSTN User');
|
|
241
|
+
} else {
|
|
242
|
+
return FallbackLogo(userList[maxUsers[0].uid]?.name);
|
|
243
|
+
}
|
|
244
|
+
}}
|
|
245
|
+
user={maxUsers[0]}
|
|
246
|
+
key={maxUsers[0].uid}
|
|
247
|
+
/>
|
|
248
|
+
<View style={style.nameHolder}>
|
|
249
|
+
<View style={[style.MicBackdrop]}>
|
|
250
|
+
<ImageIcon
|
|
251
|
+
name={maxUsers[0].audio ? 'mic' : 'micOff'}
|
|
252
|
+
color={maxUsers[0].audio ? primaryColor : 'red'}
|
|
253
|
+
style={style.MicIcon}
|
|
254
|
+
/>
|
|
255
|
+
</View>
|
|
256
|
+
<View style={{flex:1}}>
|
|
257
|
+
<TextWithTooltip
|
|
258
|
+
value={maxUsers[0].uid === 'local'
|
|
259
|
+
? userList[localUid]
|
|
260
|
+
? userList[localUid].name + ' '
|
|
261
|
+
: 'You '
|
|
262
|
+
: userList[maxUsers[0].uid]
|
|
263
|
+
? userList[maxUsers[0].uid].name + ' '
|
|
264
|
+
: maxUsers[0].uid === 1
|
|
265
|
+
? (userList[localUid].name + "'s screen ")
|
|
266
|
+
: 'User '}
|
|
267
|
+
style={[
|
|
268
|
+
style.name,
|
|
269
|
+
{fontSize: RFValue(14, height > width ? height : width)},
|
|
270
|
+
]}
|
|
271
|
+
/>
|
|
272
|
+
</View>
|
|
224
273
|
</View>
|
|
225
|
-
<Text style={style.name}>
|
|
226
|
-
{maxUsers[0].uid === 'local'
|
|
227
|
-
? userList[localUid]
|
|
228
|
-
? userList[localUid].name.slice(0,20) + ' '
|
|
229
|
-
: 'You '
|
|
230
|
-
: userList[maxUsers[0].uid]
|
|
231
|
-
? userList[maxUsers[0].uid].name.slice(0,20) + ' '
|
|
232
|
-
: maxUsers[0].uid === 1
|
|
233
|
-
? (userList[localUid].name + "'s screen ").slice(0,20)
|
|
234
|
-
: 'User '}
|
|
235
|
-
</Text>
|
|
236
274
|
</View>
|
|
237
|
-
|
|
275
|
+
</>
|
|
238
276
|
)}
|
|
239
277
|
</MaxUidConsumer>
|
|
240
278
|
</View>
|
|
@@ -257,8 +295,10 @@ const style = StyleSheet.create({
|
|
|
257
295
|
borderTopLeftRadius: 15,
|
|
258
296
|
borderBottomRightRadius: 15,
|
|
259
297
|
flexDirection: 'row',
|
|
298
|
+
zIndex: 5,
|
|
299
|
+
maxWidth: '100%',
|
|
260
300
|
},
|
|
261
|
-
name: {color: $config.PRIMARY_FONT_COLOR, lineHeight: 25, fontWeight: '700'},
|
|
301
|
+
name: {color: $config.PRIMARY_FONT_COLOR, lineHeight: 25, fontWeight: '700', flexShrink: 1},
|
|
262
302
|
MicBackdrop: {
|
|
263
303
|
width: 20,
|
|
264
304
|
height: 20,
|
|
@@ -273,6 +313,7 @@ const style = StyleSheet.create({
|
|
|
273
313
|
width: '80%',
|
|
274
314
|
height: '80%',
|
|
275
315
|
alignSelf: 'center',
|
|
316
|
+
resizeMode: 'contain',
|
|
276
317
|
},
|
|
277
318
|
});
|
|
278
319
|
|
|
@@ -18,15 +18,15 @@ import {
|
|
|
18
18
|
ImageBackground,
|
|
19
19
|
Platform,
|
|
20
20
|
} from 'react-native';
|
|
21
|
-
import MaxUidContext from '../../agora-rn-uikit
|
|
22
|
-
import {MaxVideoView} from '../../agora-rn-uikit
|
|
21
|
+
import {MaxUidContext} from '../../agora-rn-uikit';
|
|
22
|
+
import {MaxVideoView} from '../../agora-rn-uikit';
|
|
23
23
|
import {
|
|
24
24
|
LocalAudioMute,
|
|
25
25
|
LocalVideoMute,
|
|
26
26
|
SwitchCamera,
|
|
27
|
-
} from '../../agora-rn-uikit
|
|
28
|
-
import LocalUserContext from '../../agora-rn-uikit
|
|
29
|
-
import RtcContext from '../../agora-rn-uikit
|
|
27
|
+
} from '../../agora-rn-uikit';
|
|
28
|
+
import {LocalUserContext} from '../../agora-rn-uikit';
|
|
29
|
+
import {RtcContext} from '../../agora-rn-uikit';
|
|
30
30
|
// import ColorContext from './ColorContext';
|
|
31
31
|
import TextInput from '../atoms/TextInput';
|
|
32
32
|
import Error from '../subComponents/Error';
|
|
@@ -87,11 +87,17 @@ const Precall = (props: any) => {
|
|
|
87
87
|
<View style={{height: 20}} />
|
|
88
88
|
<View style={style.controls}>
|
|
89
89
|
<LocalUserContext>
|
|
90
|
-
<
|
|
90
|
+
<View style={style.width50}>
|
|
91
|
+
<LocalVideoMute />
|
|
92
|
+
</View>
|
|
91
93
|
<View style={style.width50} />
|
|
92
|
-
<
|
|
94
|
+
<View style={style.width50}>
|
|
95
|
+
<LocalAudioMute />
|
|
96
|
+
</View>
|
|
93
97
|
<View style={style.width50} />
|
|
94
|
-
<
|
|
98
|
+
<View style={style.width50}>
|
|
99
|
+
<SwitchCamera />
|
|
100
|
+
</View>
|
|
95
101
|
</LocalUserContext>
|
|
96
102
|
</View>
|
|
97
103
|
<View
|
|
@@ -140,7 +146,12 @@ const style = StyleSheet.create({
|
|
|
140
146
|
minHeight: 45,
|
|
141
147
|
alignSelf: 'center',
|
|
142
148
|
},
|
|
143
|
-
controls: {
|
|
149
|
+
controls: {
|
|
150
|
+
flex: 0.2,
|
|
151
|
+
flexDirection: 'row',
|
|
152
|
+
alignSelf: 'center',
|
|
153
|
+
padding: 5,
|
|
154
|
+
},
|
|
144
155
|
width50: {width: 50},
|
|
145
156
|
buttonActive: {
|
|
146
157
|
backgroundColor: $config.PRIMARY_COLOR,
|
|
@@ -1,34 +1,36 @@
|
|
|
1
1
|
/*
|
|
2
2
|
********************************************
|
|
3
3
|
Copyright © 2021 Agora Lab, Inc., all rights reserved.
|
|
4
|
-
AppBuilder and all associated components, source code, APIs, services, and documentation
|
|
5
|
-
(the “Materials”) are owned by Agora Lab, Inc. and its licensors. The Materials may not be
|
|
6
|
-
accessed, used, modified, or distributed for any purpose without a license from Agora Lab, Inc.
|
|
7
|
-
Use without a license or in violation of any license terms and conditions (including use for
|
|
8
|
-
any purpose competitive to Agora Lab, Inc.’s business) is strictly prohibited. For more
|
|
9
|
-
information visit https://appbuilder.agora.io.
|
|
4
|
+
AppBuilder and all associated components, source code, APIs, services, and documentation
|
|
5
|
+
(the “Materials”) are owned by Agora Lab, Inc. and its licensors. The Materials may not be
|
|
6
|
+
accessed, used, modified, or distributed for any purpose without a license from Agora Lab, Inc.
|
|
7
|
+
Use without a license or in violation of any license terms and conditions (including use for
|
|
8
|
+
any purpose competitive to Agora Lab, Inc.’s business) is strictly prohibited. For more
|
|
9
|
+
information visit https://appbuilder.agora.io.
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
|
-
import React, {useState, useContext} from 'react';
|
|
12
|
+
import React, {useState, useContext, useEffect} from 'react';
|
|
13
13
|
import {View, Text, StyleSheet, Dimensions, Platform} from 'react-native';
|
|
14
14
|
import TextInput from '../atoms/TextInput';
|
|
15
15
|
import PrimaryButton from '../atoms/PrimaryButton';
|
|
16
|
-
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
|
|
17
|
+
import {
|
|
18
|
+
MaxUidConsumer,
|
|
19
|
+
MaxVideoView,
|
|
20
|
+
LocalAudioMute,
|
|
21
|
+
LocalVideoMute,
|
|
22
|
+
LocalUserContext,
|
|
23
|
+
} from '../../agora-rn-uikit';
|
|
24
|
+
|
|
20
25
|
import SelectDevice from '../subComponents/SelectDevice';
|
|
21
26
|
import Logo from '../subComponents/Logo';
|
|
22
27
|
import hasBrandLogo from '../utils/hasBrandLogo';
|
|
23
|
-
// import OpenInNativeButton from '../subComponents/OpenInNativeButton';
|
|
24
28
|
import ColorContext from './ColorContext';
|
|
25
|
-
// import {useHistory} from './Router';
|
|
26
|
-
// import {precallCard} from '../../theme.json';
|
|
27
29
|
import Error from '../subComponents/Error';
|
|
28
30
|
|
|
29
31
|
const Precall = (props: any) => {
|
|
30
32
|
const {primaryColor} = useContext(ColorContext);
|
|
31
|
-
const {setCallActive, queryComplete, username, setUsername, error} = props;
|
|
33
|
+
const {setCallActive, queryComplete, username, setUsername, error, title} = props;
|
|
32
34
|
const [dim, setDim] = useState([
|
|
33
35
|
Dimensions.get('window').width,
|
|
34
36
|
Dimensions.get('window').height,
|
|
@@ -39,6 +41,14 @@ const Precall = (props: any) => {
|
|
|
39
41
|
setDim([e.nativeEvent.layout.width, e.nativeEvent.layout.height]);
|
|
40
42
|
};
|
|
41
43
|
|
|
44
|
+
useEffect(()=>{
|
|
45
|
+
if(Platform.OS === 'web'){
|
|
46
|
+
if(title){
|
|
47
|
+
document.title = title + ' | ' + $config.APP_NAME
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
|
|
42
52
|
return (
|
|
43
53
|
// <ImageBackground
|
|
44
54
|
// onLayout={onLayout}
|
|
@@ -63,25 +73,9 @@ const Precall = (props: any) => {
|
|
|
63
73
|
<LocalUserContext>
|
|
64
74
|
<View style={{alignSelf: 'center'}}>
|
|
65
75
|
<LocalVideoMute />
|
|
66
|
-
{/* <Text
|
|
67
|
-
style={{
|
|
68
|
-
textAlign: 'center',
|
|
69
|
-
marginTop: 5,
|
|
70
|
-
color: $config.PRIMARY_COLOR,
|
|
71
|
-
}}>
|
|
72
|
-
Video
|
|
73
|
-
</Text> */}
|
|
74
76
|
</View>
|
|
75
77
|
<View style={{alignSelf: 'center'}}>
|
|
76
78
|
<LocalAudioMute />
|
|
77
|
-
{/* <Text
|
|
78
|
-
style={{
|
|
79
|
-
textAlign: 'center',
|
|
80
|
-
marginTop: 5,
|
|
81
|
-
color: $config.PRIMARY_COLOR,
|
|
82
|
-
}}>
|
|
83
|
-
Audio
|
|
84
|
-
</Text> */}
|
|
85
79
|
</View>
|
|
86
80
|
</LocalUserContext>
|
|
87
81
|
</View>
|
|
@@ -129,6 +123,10 @@ const Precall = (props: any) => {
|
|
|
129
123
|
justifyContent: 'center',
|
|
130
124
|
marginBottom: '10%',
|
|
131
125
|
}}>
|
|
126
|
+
<Text style={[style.titleHeading, {color: $config.PRIMARY_COLOR}]}>
|
|
127
|
+
{title}
|
|
128
|
+
</Text>
|
|
129
|
+
<View style={{height: 20}} />
|
|
132
130
|
<View style={[{shadowColor: primaryColor}, style.precallPickers]}>
|
|
133
131
|
{/* <View style={{flex: 1}}> */}
|
|
134
132
|
<Text
|
|
@@ -206,11 +204,16 @@ const style = StyleSheet.create({
|
|
|
206
204
|
marginBottom: '1%',
|
|
207
205
|
// marginRight: '5%',
|
|
208
206
|
},
|
|
209
|
-
|
|
207
|
+
titleHeading: {
|
|
210
208
|
fontSize: 28,
|
|
211
209
|
fontWeight: '700',
|
|
212
210
|
color: $config.SECONDARY_FONT_COLOR,
|
|
213
211
|
},
|
|
212
|
+
subHeading: {
|
|
213
|
+
fontSize: 18,
|
|
214
|
+
fontWeight: '700',
|
|
215
|
+
color: $config.SECONDARY_FONT_COLOR,
|
|
216
|
+
},
|
|
214
217
|
headline: {
|
|
215
218
|
fontSize: 20,
|
|
216
219
|
fontWeight: '400',
|