agora-appbuilder-core 1.0.8 → 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.
Files changed (134) hide show
  1. package/package.json +5 -2
  2. package/template/_package-lock.json +22850 -0
  3. package/template/agora-rn-uikit/.git/HEAD +1 -0
  4. package/template/agora-rn-uikit/.git/config +16 -0
  5. package/template/agora-rn-uikit/.git/description +1 -0
  6. package/template/agora-rn-uikit/.git/hooks/applypatch-msg.sample +15 -0
  7. package/template/agora-rn-uikit/.git/hooks/commit-msg.sample +24 -0
  8. package/template/agora-rn-uikit/.git/hooks/fsmonitor-watchman.sample +173 -0
  9. package/template/agora-rn-uikit/.git/hooks/post-update.sample +8 -0
  10. package/template/agora-rn-uikit/.git/hooks/pre-applypatch.sample +14 -0
  11. package/template/agora-rn-uikit/.git/hooks/pre-commit.sample +49 -0
  12. package/template/agora-rn-uikit/.git/hooks/pre-merge-commit.sample +13 -0
  13. package/template/agora-rn-uikit/.git/hooks/pre-push.sample +53 -0
  14. package/template/agora-rn-uikit/.git/hooks/pre-rebase.sample +169 -0
  15. package/template/agora-rn-uikit/.git/hooks/pre-receive.sample +24 -0
  16. package/template/agora-rn-uikit/.git/hooks/prepare-commit-msg.sample +42 -0
  17. package/template/agora-rn-uikit/.git/hooks/push-to-checkout.sample +78 -0
  18. package/template/agora-rn-uikit/.git/hooks/update.sample +128 -0
  19. package/template/agora-rn-uikit/.git/index +0 -0
  20. package/template/agora-rn-uikit/.git/info/exclude +6 -0
  21. package/template/agora-rn-uikit/.git/logs/HEAD +2 -0
  22. package/template/agora-rn-uikit/.git/logs/refs/heads/ab-dev-auto +1 -0
  23. package/template/agora-rn-uikit/.git/logs/refs/heads/master +1 -0
  24. package/template/agora-rn-uikit/.git/logs/refs/remotes/origin/HEAD +1 -0
  25. package/template/agora-rn-uikit/.git/objects/pack/pack-f379286d0537eb68377220b4929979324b8d5d1c.idx +0 -0
  26. package/template/agora-rn-uikit/.git/objects/pack/pack-f379286d0537eb68377220b4929979324b8d5d1c.pack +0 -0
  27. package/template/agora-rn-uikit/.git/packed-refs +12 -0
  28. package/template/agora-rn-uikit/.git/refs/heads/ab-dev-auto +1 -0
  29. package/template/agora-rn-uikit/.git/refs/heads/master +1 -0
  30. package/template/agora-rn-uikit/.git/refs/remotes/origin/HEAD +1 -0
  31. package/template/agora-rn-uikit/.gitignore +63 -0
  32. package/template/agora-rn-uikit/package-lock.json +7612 -0
  33. package/template/agora-rn-uikit/package.json +1 -0
  34. package/template/agora-rn-uikit/src/AgoraUIKit.tsx +8 -8
  35. package/template/agora-rn-uikit/src/{LocalUserContext.tsx → Contexts/LocalUserContext.tsx} +1 -1
  36. package/template/agora-rn-uikit/src/{MaxUidContext.tsx → Contexts/MaxUidContext.tsx} +0 -0
  37. package/template/agora-rn-uikit/src/{MinUidContext.tsx → Contexts/MinUidContext.tsx} +0 -0
  38. package/template/agora-rn-uikit/src/{PropsContext.tsx → Contexts/PropsContext.tsx} +34 -16
  39. package/template/agora-rn-uikit/src/{RtcContext.tsx → Contexts/RtcContext.tsx} +12 -21
  40. package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +25 -15
  41. package/template/agora-rn-uikit/src/Controls/Icons.ts +53 -3
  42. package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +53 -0
  43. package/template/agora-rn-uikit/src/Controls/Local/EndCall.tsx +4 -3
  44. package/template/agora-rn-uikit/src/Controls/Local/FullScreen.tsx +3 -3
  45. package/template/agora-rn-uikit/src/Controls/Local/LocalAudioMute.tsx +58 -14
  46. package/template/agora-rn-uikit/src/Controls/Local/LocalVideoMute.tsx +60 -14
  47. package/template/agora-rn-uikit/src/Controls/Local/Recording.tsx +2 -2
  48. package/template/agora-rn-uikit/src/Controls/Local/Screenshare.tsx +2 -2
  49. package/template/agora-rn-uikit/src/Controls/Local/SwitchCamera.tsx +9 -9
  50. package/template/agora-rn-uikit/src/Controls/LocalControls.tsx +20 -17
  51. package/template/agora-rn-uikit/src/Controls/Remote/RemoteAudioMute.tsx +8 -8
  52. package/template/agora-rn-uikit/src/Controls/Remote/RemoteSwap.tsx +3 -3
  53. package/template/agora-rn-uikit/src/Controls/Remote/RemoteVideoMute.tsx +13 -8
  54. package/template/agora-rn-uikit/src/Controls/RemoteControls.tsx +1 -2
  55. package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +20 -0
  56. package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +20 -0
  57. package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +26 -0
  58. package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +26 -0
  59. package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +46 -0
  60. package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +47 -0
  61. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +20 -0
  62. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +20 -0
  63. package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +21 -0
  64. package/template/agora-rn-uikit/src/Reducer/index.ts +9 -0
  65. package/template/agora-rn-uikit/src/Rtc/Create.tsx +138 -0
  66. package/template/agora-rn-uikit/src/Rtc/Join.tsx +100 -0
  67. package/template/agora-rn-uikit/src/RtcConfigure.tsx +197 -0
  68. package/template/agora-rn-uikit/src/Style.ts +3 -3
  69. package/template/agora-rn-uikit/src/Utils/actionTypeGuard.tsx +9 -0
  70. package/template/agora-rn-uikit/src/{events.ts → Utils/events.ts} +0 -0
  71. package/template/agora-rn-uikit/src/{permission.ts → Utils/permission.ts} +0 -0
  72. package/template/agora-rn-uikit/src/{quality.tsx → Utils/quality.tsx} +0 -0
  73. package/template/agora-rn-uikit/src/{MaxVideoView.native.tsx → Views/MaxVideoView.native.tsx} +3 -4
  74. package/template/agora-rn-uikit/src/{MaxVideoView.tsx → Views/MaxVideoView.tsx} +3 -4
  75. package/template/agora-rn-uikit/src/Views/MinVideoView.tsx +86 -0
  76. package/template/agora-rn-uikit/src/index.ts +67 -0
  77. package/template/bridge/rtc/webNg/RtcEngine.ts +23 -6
  78. package/template/package-lock.json +22850 -0
  79. package/template/package.json +6 -4
  80. package/template/react-native-toast-message/.gitignore +5 -0
  81. package/template/react-native-toast-message/.npmignore +5 -0
  82. package/template/react-native-toast-message/package-lock.json +10553 -0
  83. package/template/src/.DS_Store +0 -0
  84. package/template/src/assets/icons.ts +35 -6
  85. package/template/src/atoms/SecondaryButton.tsx +6 -5
  86. package/template/src/atoms/TextInput.tsx +6 -1
  87. package/template/src/components/Chat.tsx +50 -21
  88. package/template/src/components/ChatContext.ts +22 -1
  89. package/template/src/components/Controls.native.tsx +2 -2
  90. package/template/src/components/Controls.tsx +2 -2
  91. package/template/src/components/DeviceConfigure.tsx +1 -1
  92. package/template/src/components/GridVideo.tsx +69 -31
  93. package/template/src/components/Navbar.tsx +136 -113
  94. package/template/src/components/NetworkQualityContext.tsx +134 -0
  95. package/template/src/components/ParticipantsView.tsx +105 -49
  96. package/template/src/components/PinnedVideo.tsx +112 -71
  97. package/template/src/components/Precall.native.tsx +42 -23
  98. package/template/src/components/Precall.tsx +56 -51
  99. package/template/src/components/RTMConfigure.tsx +331 -181
  100. package/template/src/components/RTMEvents.tsx +84 -0
  101. package/template/src/components/Settings.tsx +19 -16
  102. package/template/src/components/Share.tsx +131 -62
  103. package/template/src/components/StorageContext.tsx +2 -0
  104. package/template/src/hooks/useImageDelay.tsx +28 -0
  105. package/template/src/pages/Authenticate.tsx +5 -4
  106. package/template/src/pages/Create.tsx +26 -16
  107. package/template/src/pages/Join.tsx +13 -30
  108. package/template/src/pages/VideoCall.tsx +181 -137
  109. package/template/src/subComponents/.DS_Store +0 -0
  110. package/template/src/subComponents/ChatContainer.tsx +40 -28
  111. package/template/src/subComponents/CopyJoinInfo.tsx +9 -12
  112. package/template/src/subComponents/LocalAudioMute.tsx +9 -9
  113. package/template/src/subComponents/LocalVideoMute.tsx +9 -9
  114. package/template/src/subComponents/LogoutButton.tsx +1 -1
  115. package/template/src/subComponents/NetworkQualityPill.tsx +161 -0
  116. package/template/src/subComponents/Recording.tsx +12 -16
  117. package/template/src/subComponents/RemoteAudioMute.tsx +23 -27
  118. package/template/src/subComponents/RemoteEndCall.tsx +7 -15
  119. package/template/src/subComponents/RemoteVideoMute.tsx +15 -28
  120. package/template/src/subComponents/ScreenShareNotice.tsx +61 -0
  121. package/template/src/subComponents/ScreenshareButton.tsx +76 -75
  122. package/template/src/subComponents/SelectOAuth.tsx +25 -12
  123. package/template/src/subComponents/SwitchCamera.tsx +5 -2
  124. package/template/src/subComponents/TextWithTooltip.native.tsx +128 -0
  125. package/template/src/subComponents/TextWithTooltip.tsx +44 -0
  126. package/template/src/subComponents/toastConfig.tsx +2 -2
  127. package/template/src/utils/hasBrandLogo.tsx +3 -0
  128. package/template/src/utils/isSafariBrowser.tsx +22 -0
  129. package/template/webpack.commons.js +1 -0
  130. package/template/agora-rn-uikit/Components.js +0 -35
  131. package/template/agora-rn-uikit/Contexts.js +0 -7
  132. package/template/agora-rn-uikit/index.js +0 -12
  133. package/template/agora-rn-uikit/src/MinVideoView.tsx +0 -87
  134. package/template/agora-rn-uikit/src/RTCConfigure.tsx +0 -516
@@ -0,0 +1,134 @@
1
+ /*
2
+ ********************************************
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.
10
+ *********************************************
11
+ */
12
+ import React, {createContext, useContext, useState} from 'react';
13
+ import {RtcContext} from '../../agora-rn-uikit';
14
+ import useMount from './useMount';
15
+ import icons from '../assets/icons';
16
+
17
+ /**
18
+ * Network Icons container object with color and string mapping to network quality stat [ 0 - 8]
19
+ * 0 - Unpublished
20
+ * 1 - Excellent
21
+ * 2 - Good
22
+ * 3 - Bad
23
+ * 4 - Bad
24
+ * 5 - Very Bad
25
+ * 6 - Very Bad
26
+ * 7 - Unsupported
27
+ * 8 - Loading
28
+ */
29
+ export const networkIconsObject: {
30
+ [key: number]: {
31
+ icon: string;
32
+ tint: string;
33
+ text: string;
34
+ };
35
+ } = {
36
+ 0: {
37
+ icon: icons.networkIcons['Unsupported'],
38
+ tint: 'primary',
39
+ text: 'Unknown',
40
+ },
41
+ 1: {
42
+ icon: icons.networkIcons['Excellent'],
43
+ tint: '#2BD900',
44
+ text: 'Excellent',
45
+ },
46
+ 2: {
47
+ icon: icons.networkIcons['Good'],
48
+ tint: '#FFEE00',
49
+ text: 'Good',
50
+ },
51
+ 3: {
52
+ icon: icons.networkIcons['Bad'],
53
+ tint: '#F8AA00',
54
+ text: 'Bad',
55
+ },
56
+ 4: {
57
+ icon: icons.networkIcons['Bad'],
58
+ tint: '#F8AA00',
59
+ text: 'Bad',
60
+ },
61
+ 5: {
62
+ icon: icons.networkIcons['VeryBad'],
63
+ tint: 'red',
64
+ text: 'Very Bad',
65
+ },
66
+ 6: {
67
+ icon: icons.networkIcons['VeryBad'],
68
+ tint: 'red',
69
+ text: 'Very Bad',
70
+ },
71
+ 7: {
72
+ icon: icons.networkIcons['Unsupported'],
73
+ tint: 'primary',
74
+ text: 'Unpublished',
75
+ },
76
+ 8: {
77
+ icon: icons.networkIcons['Loading'],
78
+ tint: 'primary',
79
+ text: 'Loading',
80
+ },
81
+ };
82
+
83
+ const initNewtorkQualityStats: {[key in string | number]: number} = {
84
+ local: 0,
85
+ };
86
+
87
+ const NetworkQualityContext = createContext(initNewtorkQualityStats);
88
+
89
+ export default NetworkQualityContext;
90
+
91
+ export const NetworkQualityConsumer = NetworkQualityContext.Consumer;
92
+
93
+ export const NetworkQualityProvider: React.FC = (props) => {
94
+ const [networkQualityStats, setNetworkQualityStats] = useState(
95
+ initNewtorkQualityStats,
96
+ );
97
+ const {RtcEngine} = useContext(RtcContext);
98
+
99
+ useMount(() => {
100
+ function handleNetworkQuality(
101
+ uid: number | string,
102
+ downlinkQuality: number,
103
+ // Currently unused , potential use might be to take weighted average
104
+ // of this alongside the downlink quality.
105
+ uplinkQuality: number,
106
+ ) {
107
+ setNetworkQualityStats((prevNetworkQualityStats) => {
108
+ const updatedNetworkQualityStats = {...prevNetworkQualityStats};
109
+ if (uid === 0) {
110
+ const displayedNetworkQuality =
111
+ // check if either are unsupported (0)
112
+ // if not then display whichever is poorer
113
+ downlinkQuality * uplinkQuality !== 0
114
+ ? downlinkQuality < uplinkQuality
115
+ ? uplinkQuality
116
+ : downlinkQuality
117
+ : 0;
118
+ updatedNetworkQualityStats['local'] = displayedNetworkQuality;
119
+ } else {
120
+ updatedNetworkQualityStats[uid] = downlinkQuality;
121
+ }
122
+ return updatedNetworkQualityStats;
123
+ });
124
+ }
125
+
126
+ RtcEngine.addListener('NetworkQuality', handleNetworkQuality);
127
+ });
128
+
129
+ return (
130
+ <NetworkQualityContext.Provider value={networkQualityStats}>
131
+ {props.children}
132
+ </NetworkQualityContext.Provider>
133
+ );
134
+ };
@@ -19,12 +19,13 @@ import {
19
19
  Image,
20
20
  ScrollView,
21
21
  Dimensions,
22
+ useWindowDimensions
22
23
  } from 'react-native';
23
- import {MinUidConsumer} from '../../agora-rn-uikit/src/MinUidContext';
24
- import {MaxUidConsumer} from '../../agora-rn-uikit/src/MaxUidContext';
25
- import LocalAudioMute from '../subComponents/LocalAudioMute';
26
- import LocalVideoMute from '../subComponents/LocalVideoMute';
27
- import LocalUserContext from '../../agora-rn-uikit/src/LocalUserContext';
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 ? style.participantViewNative : style.participantView
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
- <Text style={style.participantText}>
76
- {userList[localUid]
77
- ? userList[localUid].name + ' '
78
- : 'You '}
79
- </Text>
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
- <LocalAudioMute />
83
- <LocalVideoMute />
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
- <Text style={style.participantText}>
90
- {userList[localUid]
91
- ? userList[localUid].name + "'s screenshare "
92
- : 'Your screenshare '}
93
- </Text>
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
- <Text style={style.participantText}>
98
- {userList[user.uid]
99
- ? userList[user.uid].name + ' '
100
- : String(user.uid)[0] === '1'
101
- ? 'PSTN User ' : 'User '}
102
- </Text>
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
- <RemoteEndCall uid={user.uid} isHost={props.isHost} />
106
- <RemoteAudioMute
107
- uid={user.uid}
108
- audio={user.audio}
109
- isHost={props.isHost}
110
- />
111
- <RemoteVideoMute
112
- uid={user.uid}
113
- video={user.video}
114
- isHost={props.isHost}
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 style={{width: '100%', height: 50, alignSelf: 'flex-end', flexDirection: 'row', alignItems: 'center', justifyContent: 'center'}}>
129
- <CopyJoinInfo showText={true}/>
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
- width: '90%',
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
- paddingLeft: 10,
183
- alignSelf: 'center',
231
+ paddingHorizontal: 5,
232
+ textAlign:'left',
233
+ flexShrink: 1
184
234
  },
185
235
  participantButtonContainer: {
186
- // flex: 0.3,
236
+ flex: 0.5,
187
237
  flexDirection: 'row',
188
- paddingRight: 10,
189
- alignSelf: 'center',
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/src/MinUidContext';
23
- import RtcContext from '../../agora-rn-uikit/src/RtcContext';
24
- import {MaxVideoView} from '../../agora-rn-uikit/Components';
25
- import {MaxUidConsumer} from '../../agora-rn-uikit/src/MaxUidContext';
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
- <Image
152
- source={{
153
- uri: user.audio ? icons.mic : icons.micOff,
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.MicIcon,
186
+ style.name,
157
187
  {
158
- tintColor: user.audio ? primaryColor : 'red',
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
- <View style={style.flex1}>
197
- <MaxVideoView
198
- fallback={() => {
199
- if (maxUsers[0].uid === 'local') {
200
- return FallbackLogo(userList[localUid]?.name);
201
- } else if (String(maxUsers[0].uid)[0] === '1') {
202
- return FallbackLogo('PSTN User');
203
- } else {
204
- return FallbackLogo(userList[maxUsers[0].uid]?.name);
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
- user={maxUsers[0]}
208
- key={maxUsers[0].uid}
209
- />
210
- <View style={style.nameHolder}>
211
- <View style={[style.MicBackdrop]}>
212
- <Image
213
- source={{
214
- uri: maxUsers[0].audio ? icons.mic : icons.micOff,
215
- }}
216
- style={[
217
- style.MicIcon,
218
- {
219
- tintColor: maxUsers[0].audio ? primaryColor : 'red',
220
- },
221
- ]}
222
- resizeMode={'contain'}
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
- </View>
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