@100mslive/react-native-room-kit 0.0.3 → 0.0.4
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/lib/commonjs/HMSInstanceSetup.js +1 -14
- package/lib/commonjs/HMSInstanceSetup.js.map +1 -1
- package/lib/commonjs/HMSPrebuilt.js +13 -4
- package/lib/commonjs/HMSPrebuilt.js.map +1 -1
- package/lib/commonjs/HMSRoomSetup.js +38 -14
- package/lib/commonjs/HMSRoomSetup.js.map +1 -1
- package/lib/commonjs/Icons/Check/assets/check.png +0 -0
- package/lib/commonjs/Icons/Check/assets/check@2x.png +0 -0
- package/lib/commonjs/Icons/Check/assets/check@3x.png +0 -0
- package/lib/commonjs/Icons/Check/index.js +30 -0
- package/lib/commonjs/Icons/Check/index.js.map +1 -0
- package/lib/commonjs/Icons/Radio/assets/radio.png +0 -0
- package/lib/commonjs/Icons/Radio/assets/radio@2x.png +0 -0
- package/lib/commonjs/Icons/Radio/assets/radio@3x.png +0 -0
- package/lib/commonjs/Icons/Radio/index.js +30 -0
- package/lib/commonjs/Icons/Radio/index.js.map +1 -0
- package/lib/commonjs/Icons/index.js +22 -0
- package/lib/commonjs/Icons/index.js.map +1 -1
- package/lib/commonjs/components/BackButton.js +2 -2
- package/lib/commonjs/components/BackButton.js.map +1 -1
- package/lib/commonjs/components/DisplayView.js +0 -6
- package/lib/commonjs/components/DisplayView.js.map +1 -1
- package/lib/commonjs/components/HMSHLSStreamLoading.js +56 -0
- package/lib/commonjs/components/HMSHLSStreamLoading.js.map +1 -0
- package/lib/commonjs/components/HMSLocalVideoView.js +41 -0
- package/lib/commonjs/components/HMSLocalVideoView.js.map +1 -0
- package/lib/commonjs/components/{HMSSpeakerSettings.js → HMSManageAudioOutput.js} +41 -13
- package/lib/commonjs/components/HMSManageAudioOutput.js.map +1 -0
- package/lib/commonjs/components/HMSManageLeave.js +7 -60
- package/lib/commonjs/components/HMSManageLeave.js.map +1 -1
- package/lib/commonjs/components/HMSMeetingEnded.js +36 -0
- package/lib/commonjs/components/HMSMeetingEnded.js.map +1 -0
- package/lib/commonjs/components/HMSPreviewEditName.js +6 -3
- package/lib/commonjs/components/HMSPreviewEditName.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewHLSLiveIndicator.js +64 -0
- package/lib/commonjs/components/HMSPreviewHLSLiveIndicator.js.map +1 -0
- package/lib/commonjs/components/HMSPreviewJoinButton.js +21 -9
- package/lib/commonjs/components/HMSPreviewJoinButton.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewNetworkQuality.js +43 -0
- package/lib/commonjs/components/HMSPreviewNetworkQuality.js.map +1 -0
- package/lib/commonjs/components/HMSPreviewPeersList.js +2 -25
- package/lib/commonjs/components/HMSPreviewPeersList.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewSubtitle.js +25 -2
- package/lib/commonjs/components/HMSPreviewSubtitle.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewTile.js +2 -18
- package/lib/commonjs/components/HMSPreviewTile.js.map +1 -1
- package/lib/commonjs/components/HMSRoomOptions.js +2 -3
- package/lib/commonjs/components/HMSRoomOptions.js.map +1 -1
- package/lib/commonjs/components/HMSShowNetworkQuality.js +0 -2
- package/lib/commonjs/components/HMSShowNetworkQuality.js.map +1 -1
- package/lib/commonjs/components/Meeting.js +7 -0
- package/lib/commonjs/components/Meeting.js.map +1 -1
- package/lib/commonjs/components/MenuModal/Menu.js +1 -2
- package/lib/commonjs/components/MenuModal/Menu.js.map +1 -1
- package/lib/commonjs/components/Modals.js +39 -299
- package/lib/commonjs/components/Modals.js.map +1 -1
- package/lib/commonjs/components/Participants/ParticipantsList.js +1 -20
- package/lib/commonjs/components/Participants/ParticipantsList.js.map +1 -1
- package/lib/commonjs/components/PeerSettingsModalContent.js +2 -13
- package/lib/commonjs/components/PeerSettingsModalContent.js.map +1 -1
- package/lib/commonjs/components/Preview.js +79 -71
- package/lib/commonjs/components/Preview.js.map +1 -1
- package/lib/commonjs/components/RoomSettingsModalContent.js +2 -101
- package/lib/commonjs/components/RoomSettingsModalContent.js.map +1 -1
- package/lib/commonjs/components/index.js +0 -11
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/hooks/useHmsInstance.js +0 -1
- package/lib/commonjs/hooks/useHmsInstance.js.map +1 -1
- package/lib/commonjs/hooks-util-selectors.js +8 -1
- package/lib/commonjs/hooks-util-selectors.js.map +1 -1
- package/lib/commonjs/hooks-util.js +129 -28
- package/lib/commonjs/hooks-util.js.map +1 -1
- package/lib/commonjs/redux/actionTypes.js +5 -1
- package/lib/commonjs/redux/actionTypes.js.map +1 -1
- package/lib/commonjs/redux/actions/index.js +15 -1
- package/lib/commonjs/redux/actions/index.js.map +1 -1
- package/lib/commonjs/redux/reducers/appState.js +14 -1
- package/lib/commonjs/redux/reducers/appState.js.map +1 -1
- package/lib/commonjs/utils/theme.js +1 -0
- package/lib/commonjs/utils/theme.js.map +1 -1
- package/lib/commonjs/utils/types.js +0 -1
- package/lib/commonjs/utils/types.js.map +1 -1
- package/lib/commonjs/utils.js +2 -2
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/module/HMSInstanceSetup.js +1 -14
- package/lib/module/HMSInstanceSetup.js.map +1 -1
- package/lib/module/HMSPrebuilt.js +13 -3
- package/lib/module/HMSPrebuilt.js.map +1 -1
- package/lib/module/HMSRoomSetup.js +43 -19
- package/lib/module/HMSRoomSetup.js.map +1 -1
- package/lib/module/Icons/Check/assets/check.png +0 -0
- package/lib/module/Icons/Check/assets/check@2x.png +0 -0
- package/lib/module/Icons/Check/assets/check@3x.png +0 -0
- package/lib/module/Icons/Check/index.js +22 -0
- package/lib/module/Icons/Check/index.js.map +1 -0
- package/lib/module/Icons/Radio/assets/radio.png +0 -0
- package/lib/module/Icons/Radio/assets/radio@2x.png +0 -0
- package/lib/module/Icons/Radio/assets/radio@3x.png +0 -0
- package/lib/module/Icons/Radio/index.js +22 -0
- package/lib/module/Icons/Radio/index.js.map +1 -0
- package/lib/module/Icons/index.js +2 -0
- package/lib/module/Icons/index.js.map +1 -1
- package/lib/module/components/BackButton.js +3 -3
- package/lib/module/components/BackButton.js.map +1 -1
- package/lib/module/components/DisplayView.js +1 -7
- package/lib/module/components/DisplayView.js.map +1 -1
- package/lib/module/components/HMSHLSStreamLoading.js +47 -0
- package/lib/module/components/HMSHLSStreamLoading.js.map +1 -0
- package/lib/module/components/HMSLocalVideoView.js +32 -0
- package/lib/module/components/HMSLocalVideoView.js.map +1 -0
- package/lib/module/components/{HMSSpeakerSettings.js → HMSManageAudioOutput.js} +40 -12
- package/lib/module/components/HMSManageAudioOutput.js.map +1 -0
- package/lib/module/components/HMSManageLeave.js +9 -62
- package/lib/module/components/HMSManageLeave.js.map +1 -1
- package/lib/module/components/HMSMeetingEnded.js +27 -0
- package/lib/module/components/HMSMeetingEnded.js.map +1 -0
- package/lib/module/components/HMSPreviewEditName.js +7 -4
- package/lib/module/components/HMSPreviewEditName.js.map +1 -1
- package/lib/module/components/HMSPreviewHLSLiveIndicator.js +55 -0
- package/lib/module/components/HMSPreviewHLSLiveIndicator.js.map +1 -0
- package/lib/module/components/HMSPreviewJoinButton.js +21 -9
- package/lib/module/components/HMSPreviewJoinButton.js.map +1 -1
- package/lib/module/components/HMSPreviewNetworkQuality.js +34 -0
- package/lib/module/components/HMSPreviewNetworkQuality.js.map +1 -0
- package/lib/module/components/HMSPreviewPeersList.js +2 -25
- package/lib/module/components/HMSPreviewPeersList.js.map +1 -1
- package/lib/module/components/HMSPreviewSubtitle.js +25 -2
- package/lib/module/components/HMSPreviewSubtitle.js.map +1 -1
- package/lib/module/components/HMSPreviewTile.js +2 -18
- package/lib/module/components/HMSPreviewTile.js.map +1 -1
- package/lib/module/components/HMSRoomOptions.js +2 -3
- package/lib/module/components/HMSRoomOptions.js.map +1 -1
- package/lib/module/components/HMSShowNetworkQuality.js +0 -2
- package/lib/module/components/HMSShowNetworkQuality.js.map +1 -1
- package/lib/module/components/Meeting.js +7 -0
- package/lib/module/components/Meeting.js.map +1 -1
- package/lib/module/components/MenuModal/Menu.js +1 -2
- package/lib/module/components/MenuModal/Menu.js.map +1 -1
- package/lib/module/components/Modals.js +40 -298
- package/lib/module/components/Modals.js.map +1 -1
- package/lib/module/components/Participants/ParticipantsList.js +1 -20
- package/lib/module/components/Participants/ParticipantsList.js.map +1 -1
- package/lib/module/components/PeerSettingsModalContent.js +2 -13
- package/lib/module/components/PeerSettingsModalContent.js.map +1 -1
- package/lib/module/components/Preview.js +79 -71
- package/lib/module/components/Preview.js.map +1 -1
- package/lib/module/components/RoomSettingsModalContent.js +3 -100
- package/lib/module/components/RoomSettingsModalContent.js.map +1 -1
- package/lib/module/components/index.js +0 -1
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/hooks/useHmsInstance.js +0 -1
- package/lib/module/hooks/useHmsInstance.js.map +1 -1
- package/lib/module/hooks-util-selectors.js +6 -0
- package/lib/module/hooks-util-selectors.js.map +1 -1
- package/lib/module/hooks-util.js +131 -32
- package/lib/module/hooks-util.js.map +1 -1
- package/lib/module/redux/actionTypes.js +5 -1
- package/lib/module/redux/actionTypes.js.map +1 -1
- package/lib/module/redux/actions/index.js +12 -0
- package/lib/module/redux/actions/index.js.map +1 -1
- package/lib/module/redux/reducers/appState.js +14 -1
- package/lib/module/redux/reducers/appState.js.map +1 -1
- package/lib/module/utils/theme.js +1 -0
- package/lib/module/utils/theme.js.map +1 -1
- package/lib/module/utils/types.js +0 -1
- package/lib/module/utils/types.js.map +1 -1
- package/lib/module/utils.js +2 -2
- package/lib/module/utils.js.map +1 -1
- package/lib/typescript/HMSInstanceSetup.d.ts.map +1 -1
- package/lib/typescript/HMSPrebuilt.d.ts +2 -3
- package/lib/typescript/HMSPrebuilt.d.ts.map +1 -1
- package/lib/typescript/HMSRoomSetup.d.ts.map +1 -1
- package/lib/typescript/Icons/Check/index.d.ts +7 -0
- package/lib/typescript/Icons/Check/index.d.ts.map +1 -0
- package/lib/typescript/Icons/Radio/index.d.ts +7 -0
- package/lib/typescript/Icons/Radio/index.d.ts.map +1 -0
- package/lib/typescript/Icons/index.d.ts +2 -0
- package/lib/typescript/Icons/index.d.ts.map +1 -1
- package/lib/typescript/components/CustomInput.d.ts +1 -1
- package/lib/typescript/components/DisplayView.d.ts.map +1 -1
- package/lib/typescript/components/HMSHLSStreamLoading.d.ts +3 -0
- package/lib/typescript/components/HMSHLSStreamLoading.d.ts.map +1 -0
- package/lib/typescript/components/HMSLocalVideoView.d.ts +3 -0
- package/lib/typescript/components/HMSLocalVideoView.d.ts.map +1 -0
- package/lib/typescript/components/HMSManageAudioOutput.d.ts +3 -0
- package/lib/typescript/components/HMSManageAudioOutput.d.ts.map +1 -0
- package/lib/typescript/components/HMSManageLeave.d.ts.map +1 -1
- package/lib/typescript/components/HMSMeetingEnded.d.ts +3 -0
- package/lib/typescript/components/HMSMeetingEnded.d.ts.map +1 -0
- package/lib/typescript/components/HMSPreviewHLSLiveIndicator.d.ts +3 -0
- package/lib/typescript/components/HMSPreviewHLSLiveIndicator.d.ts.map +1 -0
- package/lib/typescript/components/HMSPreviewJoinButton.d.ts.map +1 -1
- package/lib/typescript/components/HMSPreviewNetworkQuality.d.ts +3 -0
- package/lib/typescript/components/HMSPreviewNetworkQuality.d.ts.map +1 -0
- package/lib/typescript/components/HMSPreviewPeersList.d.ts.map +1 -1
- package/lib/typescript/components/HMSPreviewSubtitle.d.ts.map +1 -1
- package/lib/typescript/components/HMSPreviewTile.d.ts.map +1 -1
- package/lib/typescript/components/HMSRoomOptions.d.ts.map +1 -1
- package/lib/typescript/components/HMSShowNetworkQuality.d.ts.map +1 -1
- package/lib/typescript/components/Meeting.d.ts.map +1 -1
- package/lib/typescript/components/MenuModal/Menu.d.ts.map +1 -1
- package/lib/typescript/components/Modals.d.ts +1 -9
- package/lib/typescript/components/Modals.d.ts.map +1 -1
- package/lib/typescript/components/Participants/ParticipantsList.d.ts.map +1 -1
- package/lib/typescript/components/PeerSettingsModalContent.d.ts.map +1 -1
- package/lib/typescript/components/Preview.d.ts.map +1 -1
- package/lib/typescript/components/RoomSettingsModalContent.d.ts.map +1 -1
- package/lib/typescript/components/index.d.ts +0 -1
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/hooks-util-selectors.d.ts +2 -0
- package/lib/typescript/hooks-util-selectors.d.ts.map +1 -1
- package/lib/typescript/hooks-util.d.ts +9 -2
- package/lib/typescript/hooks-util.d.ts.map +1 -1
- package/lib/typescript/redux/actionTypes.d.ts +2 -0
- package/lib/typescript/redux/actionTypes.d.ts.map +1 -1
- package/lib/typescript/redux/actions/index.d.ts +16 -3
- package/lib/typescript/redux/actions/index.d.ts.map +1 -1
- package/lib/typescript/redux/index.d.ts +3 -1
- package/lib/typescript/redux/index.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/appState.d.ts +3 -0
- package/lib/typescript/redux/reducers/appState.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/index.d.ts +3 -1
- package/lib/typescript/redux/reducers/index.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/userState.d.ts +2 -2
- package/lib/typescript/redux/reducers/userState.d.ts.map +1 -1
- package/lib/typescript/utils/theme.d.ts +1 -0
- package/lib/typescript/utils/theme.d.ts.map +1 -1
- package/lib/typescript/utils/types.d.ts +3 -4
- package/lib/typescript/utils/types.d.ts.map +1 -1
- package/package.json +9 -16
- package/src/HMSInstanceSetup.tsx +4 -31
- package/src/HMSPrebuilt.tsx +24 -6
- package/src/HMSRoomSetup.tsx +55 -17
- package/src/Icons/Check/assets/check.png +0 -0
- package/src/Icons/Check/assets/check@2x.png +0 -0
- package/src/Icons/Check/assets/check@3x.png +0 -0
- package/src/Icons/Check/index.tsx +27 -0
- package/src/Icons/Radio/assets/radio.png +0 -0
- package/src/Icons/Radio/assets/radio@2x.png +0 -0
- package/src/Icons/Radio/assets/radio@3x.png +0 -0
- package/src/Icons/Radio/index.tsx +27 -0
- package/src/Icons/index.ts +2 -0
- package/src/components/BackButton.tsx +3 -3
- package/src/components/DisplayView.tsx +0 -10
- package/src/components/HMSHLSStreamLoading.tsx +57 -0
- package/src/components/HMSLocalVideoView.tsx +42 -0
- package/src/components/{HMSSpeakerSettings.tsx → HMSManageAudioOutput.tsx} +69 -17
- package/src/components/HMSManageLeave.tsx +6 -77
- package/src/components/HMSMeetingEnded.tsx +29 -0
- package/src/components/HMSPreviewEditName.tsx +5 -4
- package/src/components/HMSPreviewHLSLiveIndicator.tsx +58 -0
- package/src/components/HMSPreviewJoinButton.tsx +30 -7
- package/src/components/HMSPreviewNetworkQuality.tsx +40 -0
- package/src/components/HMSPreviewPeersList.tsx +7 -46
- package/src/components/HMSPreviewSubtitle.tsx +26 -2
- package/src/components/HMSPreviewTile.tsx +2 -24
- package/src/components/HMSRoomOptions.tsx +2 -8
- package/src/components/HMSShowNetworkQuality.tsx +0 -1
- package/src/components/Meeting.tsx +11 -0
- package/src/components/MenuModal/Menu.tsx +1 -1
- package/src/components/Modals.tsx +4 -299
- package/src/components/Participants/ParticipantsList.tsx +0 -24
- package/src/components/PeerSettingsModalContent.tsx +9 -23
- package/src/components/Preview.tsx +129 -101
- package/src/components/RoomSettingsModalContent.tsx +1 -138
- package/src/components/index.ts +0 -1
- package/src/hooks/useHmsInstance.ts +0 -1
- package/src/hooks-util-selectors.tsx +10 -0
- package/src/hooks-util.ts +155 -42
- package/src/redux/actionTypes.ts +6 -0
- package/src/redux/actions/index.ts +13 -2
- package/src/redux/reducers/appState.ts +9 -0
- package/src/redux/reducers/userState.ts +2 -2
- package/src/utils/theme.ts +1 -0
- package/src/utils/types.ts +3 -4
- package/src/utils.ts +2 -2
- package/lib/commonjs/components/HMSSpeakerSettings.js.map +0 -1
- package/lib/commonjs/components/ZoomableView.js +0 -84
- package/lib/commonjs/components/ZoomableView.js.map +0 -1
- package/lib/module/components/HMSSpeakerSettings.js.map +0 -1
- package/lib/module/components/ZoomableView.js +0 -76
- package/lib/module/components/ZoomableView.js.map +0 -1
- package/lib/typescript/components/HMSSpeakerSettings.d.ts +0 -3
- package/lib/typescript/components/HMSSpeakerSettings.d.ts.map +0 -1
- package/lib/typescript/components/ZoomableView.d.ts +0 -6
- package/lib/typescript/components/ZoomableView.d.ts.map +0 -1
- package/src/components/ZoomableView.tsx +0 -91
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
import {
|
|
19
19
|
AnswerPhoneIcon,
|
|
20
20
|
BluetoothIcon,
|
|
21
|
+
CheckIcon,
|
|
21
22
|
HeadphonesIcon,
|
|
22
23
|
SpeakerIcon,
|
|
23
24
|
WaveIcon,
|
|
@@ -28,7 +29,7 @@ import { CloseIcon } from '../Icons';
|
|
|
28
29
|
import { useHMSInstance } from '../hooks-util';
|
|
29
30
|
import type { RootState } from '../redux';
|
|
30
31
|
|
|
31
|
-
export const
|
|
32
|
+
export const HMSManageAudioOutput: React.FC = () => {
|
|
32
33
|
const hmsInstance = useHMSInstance();
|
|
33
34
|
const [settingsModalVisible, setSettingsModalVisible] = React.useState(false);
|
|
34
35
|
|
|
@@ -147,7 +148,7 @@ export const HMSSpeakerSettings: React.FC = () => {
|
|
|
147
148
|
>
|
|
148
149
|
<View style={styles.container}>
|
|
149
150
|
<View style={styles.header}>
|
|
150
|
-
<Text style={styles.headerText}>
|
|
151
|
+
<Text style={styles.headerText}>Audio Output</Text>
|
|
151
152
|
|
|
152
153
|
<TouchableOpacity
|
|
153
154
|
onPress={dismissModal}
|
|
@@ -163,19 +164,37 @@ export const HMSSpeakerSettings: React.FC = () => {
|
|
|
163
164
|
</View>
|
|
164
165
|
) : (
|
|
165
166
|
<ScrollView showsVerticalScrollIndicator={true}>
|
|
166
|
-
{availableAudioOutputDevices
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
{availableAudioOutputDevices
|
|
168
|
+
.sort(
|
|
169
|
+
(a, b) => audioDeviceSortOrder[a] - audioDeviceSortOrder[b]
|
|
170
|
+
)
|
|
171
|
+
.map((device) => (
|
|
172
|
+
<React.Fragment key={device}>
|
|
173
|
+
<View style={styles.divider} />
|
|
169
174
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
175
|
+
<TouchableOpacity
|
|
176
|
+
style={styles.audioDeviceItem}
|
|
177
|
+
onPress={() => handleSelectAudioDevice(device)}
|
|
178
|
+
>
|
|
179
|
+
<View style={styles.itemTextWrapper}>
|
|
180
|
+
{getIcon(
|
|
181
|
+
device === HMSAudioDevice.AUTOMATIC &&
|
|
182
|
+
currentAudioOutputDevice
|
|
183
|
+
? currentAudioOutputDevice
|
|
184
|
+
: device
|
|
185
|
+
)}
|
|
186
|
+
|
|
187
|
+
<Text style={styles.itemText}>
|
|
188
|
+
{getDescription(device, currentAudioOutputDevice)}
|
|
189
|
+
</Text>
|
|
190
|
+
</View>
|
|
191
|
+
|
|
192
|
+
{device === currentAudioOutputDevice ? (
|
|
193
|
+
<CheckIcon />
|
|
194
|
+
) : null}
|
|
195
|
+
</TouchableOpacity>
|
|
196
|
+
</React.Fragment>
|
|
197
|
+
))}
|
|
179
198
|
</ScrollView>
|
|
180
199
|
)}
|
|
181
200
|
</View>
|
|
@@ -190,7 +209,7 @@ const styles = StyleSheet.create({
|
|
|
190
209
|
justifyContent: 'flex-end',
|
|
191
210
|
},
|
|
192
211
|
container: {
|
|
193
|
-
backgroundColor: COLORS.
|
|
212
|
+
backgroundColor: COLORS.BACKGROUND.DEFAULT,
|
|
194
213
|
borderTopLeftRadius: 16,
|
|
195
214
|
borderTopRightRadius: 16,
|
|
196
215
|
paddingTop: 24,
|
|
@@ -217,8 +236,12 @@ const styles = StyleSheet.create({
|
|
|
217
236
|
right: 16,
|
|
218
237
|
top: 16,
|
|
219
238
|
},
|
|
239
|
+
itemTextWrapper: {
|
|
240
|
+
flexDirection: 'row',
|
|
241
|
+
alignItems: 'center',
|
|
242
|
+
justifyContent: 'center',
|
|
243
|
+
},
|
|
220
244
|
itemText: {
|
|
221
|
-
flex: 1,
|
|
222
245
|
marginHorizontal: 16,
|
|
223
246
|
color: COLORS.SURFACE.ON_SURFACE.HIGH,
|
|
224
247
|
fontSize: 14,
|
|
@@ -235,7 +258,8 @@ const styles = StyleSheet.create({
|
|
|
235
258
|
audioDeviceItem: {
|
|
236
259
|
flexDirection: 'row',
|
|
237
260
|
alignItems: 'center',
|
|
238
|
-
|
|
261
|
+
justifyContent: 'space-between',
|
|
262
|
+
paddingVertical: 20,
|
|
239
263
|
},
|
|
240
264
|
divider: {
|
|
241
265
|
height: 1,
|
|
@@ -257,3 +281,31 @@ const getIcon = (ofDevice: HMSAudioDevice) => {
|
|
|
257
281
|
return <HeadphonesIcon />;
|
|
258
282
|
}
|
|
259
283
|
};
|
|
284
|
+
|
|
285
|
+
const getDescription = (
|
|
286
|
+
ofDevice: HMSAudioDevice,
|
|
287
|
+
currentDevice: HMSAudioDevice | null
|
|
288
|
+
): string => {
|
|
289
|
+
switch (ofDevice) {
|
|
290
|
+
case HMSAudioDevice.AUTOMATIC:
|
|
291
|
+
return currentDevice && currentDevice !== HMSAudioDevice.AUTOMATIC
|
|
292
|
+
? `Default (${getDescription(currentDevice, currentDevice)})`
|
|
293
|
+
: 'Automatic';
|
|
294
|
+
case HMSAudioDevice.BLUETOOTH:
|
|
295
|
+
return 'Bluetooth Device';
|
|
296
|
+
case HMSAudioDevice.EARPIECE:
|
|
297
|
+
return 'Phone';
|
|
298
|
+
case HMSAudioDevice.SPEAKER_PHONE:
|
|
299
|
+
return 'Speaker';
|
|
300
|
+
case HMSAudioDevice.WIRED_HEADSET:
|
|
301
|
+
return 'Earphone';
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
const audioDeviceSortOrder = {
|
|
306
|
+
[HMSAudioDevice.AUTOMATIC]: 0,
|
|
307
|
+
[HMSAudioDevice.SPEAKER_PHONE]: 1,
|
|
308
|
+
[HMSAudioDevice.WIRED_HEADSET]: 2,
|
|
309
|
+
[HMSAudioDevice.EARPIECE]: 3,
|
|
310
|
+
[HMSAudioDevice.BLUETOOTH]: 4,
|
|
311
|
+
} as const;
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { useNavigation } from '@react-navigation/native';
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
|
4
3
|
import Modal from 'react-native-modal';
|
|
5
4
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
|
-
import
|
|
7
|
-
import { useDispatch, useSelector } from 'react-redux';
|
|
5
|
+
import { useSelector } from 'react-redux';
|
|
8
6
|
|
|
9
7
|
import { AlertIcon, LeaveIcon } from '../Icons';
|
|
10
|
-
import {
|
|
8
|
+
import { useLeaveMethods } from '../hooks-util';
|
|
11
9
|
import type { RootState } from '../redux';
|
|
12
|
-
import { clearStore } from '../redux/actions';
|
|
13
10
|
import { COLORS } from '../utils/theme';
|
|
14
11
|
import { ModalTypes } from '../utils/types';
|
|
15
12
|
import { DefaultModal } from './DefaultModal';
|
|
@@ -36,10 +33,6 @@ type LeaveButtonProps =
|
|
|
36
33
|
};
|
|
37
34
|
|
|
38
35
|
const LeaveButton: React.FC<LeaveButtonProps> = (props) => {
|
|
39
|
-
// TODO: What if useNavigation context is undefined?
|
|
40
|
-
const navigation = useNavigation();
|
|
41
|
-
const hmsInstance = useHMSInstance();
|
|
42
|
-
const dispatch = useDispatch();
|
|
43
36
|
const leavePopCloseAction = React.useRef(ModalTypes.DEFAULT);
|
|
44
37
|
|
|
45
38
|
const [leavePopVisible, setLeavePopVisible] = React.useState(false);
|
|
@@ -97,71 +90,7 @@ const LeaveButton: React.FC<LeaveButtonProps> = (props) => {
|
|
|
97
90
|
|
|
98
91
|
const dismissModal = () => setLeaveModalType(ModalTypes.DEFAULT);
|
|
99
92
|
|
|
100
|
-
const
|
|
101
|
-
hmsInstance
|
|
102
|
-
.destroy()
|
|
103
|
-
.then((s) => {
|
|
104
|
-
console.log('Destroy Success: ', s);
|
|
105
|
-
// TODOS:
|
|
106
|
-
// - If show `Meeting_Ended` is true, show Meeting screen by setting state to MEETING_ENDED
|
|
107
|
-
// - Reset Redux States
|
|
108
|
-
// - HMSInstance will not be available now
|
|
109
|
-
// - When your presses "Re Join" Action button, restart process from root component
|
|
110
|
-
// - When your presses "Done" Action button
|
|
111
|
-
// - If we have callback fn, call it
|
|
112
|
-
// - Otherwise try our best to navigate away from current screen
|
|
113
|
-
//
|
|
114
|
-
// - No screen to show
|
|
115
|
-
// - No need to reset redux state?
|
|
116
|
-
// - HMSInstance will be available till this point
|
|
117
|
-
// - If we have callback fn, call it
|
|
118
|
-
// - Otherwise try our best to navigate away from current screen
|
|
119
|
-
// - When we are navigated away from screen, HMSInstance will be not available
|
|
120
|
-
|
|
121
|
-
// dispatch(clearMessageData());
|
|
122
|
-
// dispatch(clearPeerData());
|
|
123
|
-
// dispatch(clearHmsReference());
|
|
124
|
-
|
|
125
|
-
// if (navigation.canGoBack()) {
|
|
126
|
-
// navigation.goBack();
|
|
127
|
-
// } else {
|
|
128
|
-
// TODO: remove this later
|
|
129
|
-
navigation.navigate('QRCodeScreen' as never);
|
|
130
|
-
dispatch(clearStore());
|
|
131
|
-
// }
|
|
132
|
-
})
|
|
133
|
-
.catch((e) => {
|
|
134
|
-
console.log(`Destroy HMS instance Error: ${e}`);
|
|
135
|
-
Toast.showWithGravity(
|
|
136
|
-
`Destroy HMS instance Error: ${e}`,
|
|
137
|
-
Toast.LONG,
|
|
138
|
-
Toast.TOP
|
|
139
|
-
);
|
|
140
|
-
});
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
const onLeavePress = () => {
|
|
144
|
-
hmsInstance
|
|
145
|
-
.leave()
|
|
146
|
-
.then((d) => {
|
|
147
|
-
console.log('Leave Success: ', d);
|
|
148
|
-
destroy();
|
|
149
|
-
})
|
|
150
|
-
.catch((e) => {
|
|
151
|
-
console.log(`Leave Room Error: ${e}`);
|
|
152
|
-
Toast.showWithGravity(`Leave Room Error: ${e}`, Toast.LONG, Toast.TOP);
|
|
153
|
-
});
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
const onEndRoomPress = () => {
|
|
157
|
-
hmsInstance
|
|
158
|
-
.endRoom('Host ended the room')
|
|
159
|
-
.then((d) => {
|
|
160
|
-
console.log('EndRoom Success: ', d);
|
|
161
|
-
destroy();
|
|
162
|
-
})
|
|
163
|
-
.catch((e) => console.log('EndRoom Error: ', e));
|
|
164
|
-
};
|
|
93
|
+
const { leave, endRoom } = useLeaveMethods();
|
|
165
94
|
|
|
166
95
|
const leaveIconDelegate =
|
|
167
96
|
'leaveIconDelegate' in props && props.leaveIconDelegate ? (
|
|
@@ -197,7 +126,7 @@ const LeaveButton: React.FC<LeaveButtonProps> = (props) => {
|
|
|
197
126
|
modalVisible={leaveModalType === ModalTypes.LEAVE_ROOM}
|
|
198
127
|
setModalVisible={dismissModal}
|
|
199
128
|
>
|
|
200
|
-
<LeaveRoomModal onSuccess={
|
|
129
|
+
<LeaveRoomModal onSuccess={leave} cancelModal={dismissModal} />
|
|
201
130
|
</DefaultModal>
|
|
202
131
|
|
|
203
132
|
<DefaultModal
|
|
@@ -205,7 +134,7 @@ const LeaveButton: React.FC<LeaveButtonProps> = (props) => {
|
|
|
205
134
|
modalVisible={leaveModalType === ModalTypes.END_ROOM}
|
|
206
135
|
setModalVisible={dismissModal}
|
|
207
136
|
>
|
|
208
|
-
<EndRoomModal onSuccess={
|
|
137
|
+
<EndRoomModal onSuccess={endRoom} cancelModal={dismissModal} />
|
|
209
138
|
</DefaultModal>
|
|
210
139
|
</View>
|
|
211
140
|
);
|
|
@@ -272,7 +201,7 @@ const LeavePopup: React.FC<LeavePopupProps> = ({
|
|
|
272
201
|
onPress={onLeavePress}
|
|
273
202
|
>
|
|
274
203
|
<LeaveIcon style={leavePopupStyles.leaveButtonIcon} />
|
|
275
|
-
<Text style={leavePopupStyles.leaveButtonText}>Leave</Text>
|
|
204
|
+
<Text style={leavePopupStyles.leaveButtonText}>Leave Studio</Text>
|
|
276
205
|
</TouchableOpacity>
|
|
277
206
|
|
|
278
207
|
{canEndRoom ? (
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Text, StyleSheet } from 'react-native';
|
|
3
|
+
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
4
|
+
|
|
5
|
+
import { COLORS } from '../utils/theme';
|
|
6
|
+
|
|
7
|
+
export const HMSMeetingEnded = () => {
|
|
8
|
+
return (
|
|
9
|
+
<SafeAreaView style={styles.container}>
|
|
10
|
+
<Text style={styles.title}>Meeting Ended</Text>
|
|
11
|
+
</SafeAreaView>
|
|
12
|
+
);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const styles = StyleSheet.create({
|
|
16
|
+
container: {
|
|
17
|
+
flex: 1,
|
|
18
|
+
backgroundColor: COLORS.BACKGROUND.DIM,
|
|
19
|
+
alignItems: 'center',
|
|
20
|
+
justifyContent: 'center',
|
|
21
|
+
},
|
|
22
|
+
title: {
|
|
23
|
+
color: COLORS.SURFACE.ON_SURFACE.HIGH,
|
|
24
|
+
fontSize: 24,
|
|
25
|
+
fontFamily: 'Inter',
|
|
26
|
+
fontWeight: '600',
|
|
27
|
+
lineHeight: 32,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { StyleSheet, TextInput } from 'react-native';
|
|
2
|
+
import { Platform, StyleSheet, TextInput } from 'react-native';
|
|
3
3
|
import { useDispatch, useSelector } from 'react-redux';
|
|
4
4
|
|
|
5
5
|
import { COLORS } from '../utils/theme';
|
|
@@ -11,13 +11,13 @@ export interface HMSPreviewEditNameProps {}
|
|
|
11
11
|
|
|
12
12
|
export const HMSPreviewEditName: React.FC<HMSPreviewEditNameProps> = () => {
|
|
13
13
|
const dispatch = useDispatch();
|
|
14
|
-
const {
|
|
14
|
+
const { updateConfig } = useHMSConfig();
|
|
15
15
|
const userName = useSelector((state: RootState) => state.user.userName);
|
|
16
16
|
const [inputFocused, setInputFocused] = React.useState(false);
|
|
17
17
|
|
|
18
18
|
const handleNameChange = (name: string) => {
|
|
19
19
|
dispatch(changeUsername(name));
|
|
20
|
-
|
|
20
|
+
updateConfig({ username: name });
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
const handleInputFocus = () => setInputFocused(true);
|
|
@@ -43,13 +43,14 @@ export const HMSPreviewEditName: React.FC<HMSPreviewEditNameProps> = () => {
|
|
|
43
43
|
const styles = StyleSheet.create({
|
|
44
44
|
input: {
|
|
45
45
|
flex: 1,
|
|
46
|
+
height: 50,
|
|
46
47
|
textAlignVertical: 'center',
|
|
47
48
|
backgroundColor: COLORS.SURFACE.DEFAULT,
|
|
48
49
|
paddingHorizontal: 16,
|
|
49
|
-
paddingVertical: 12,
|
|
50
50
|
borderRadius: 8,
|
|
51
51
|
color: COLORS.SURFACE.ON_SURFACE.HIGH,
|
|
52
52
|
fontSize: 16,
|
|
53
|
+
lineHeight: Platform.OS === 'android' ? 24 : undefined,
|
|
53
54
|
fontFamily: 'Inter',
|
|
54
55
|
fontWeight: '400',
|
|
55
56
|
letterSpacing: 0.5,
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { View, Text, StyleSheet } from 'react-native';
|
|
3
|
+
import { useSelector } from 'react-redux';
|
|
4
|
+
|
|
5
|
+
import { COLORS } from '../utils/theme';
|
|
6
|
+
import type { RootState } from '../redux';
|
|
7
|
+
|
|
8
|
+
export const HMSPreviewHLSLiveIndicator = () => {
|
|
9
|
+
const isHLSStreaming = useSelector(
|
|
10
|
+
(state: RootState) => state.hmsStates.room?.hlsStreamingState?.running
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
if (!isHLSStreaming) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<View style={styles.container}>
|
|
19
|
+
<View style={styles.circleContainer}>
|
|
20
|
+
<View style={styles.circle} />
|
|
21
|
+
</View>
|
|
22
|
+
<Text style={styles.text}>LIVE</Text>
|
|
23
|
+
</View>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const styles = StyleSheet.create({
|
|
28
|
+
container: {
|
|
29
|
+
flexDirection: 'row',
|
|
30
|
+
alignItems: 'center',
|
|
31
|
+
borderRadius: 20,
|
|
32
|
+
backgroundColor: COLORS.ALERT.ERROR.DEFAULT,
|
|
33
|
+
paddingLeft: 8,
|
|
34
|
+
paddingRight: 12,
|
|
35
|
+
marginRight: 8,
|
|
36
|
+
},
|
|
37
|
+
circleContainer: {
|
|
38
|
+
width: 20,
|
|
39
|
+
height: 20,
|
|
40
|
+
alignItems: 'center',
|
|
41
|
+
justifyContent: 'center',
|
|
42
|
+
},
|
|
43
|
+
circle: {
|
|
44
|
+
width: 12,
|
|
45
|
+
height: 12,
|
|
46
|
+
borderRadius: 6,
|
|
47
|
+
backgroundColor: COLORS.WHITE,
|
|
48
|
+
},
|
|
49
|
+
text: {
|
|
50
|
+
marginLeft: 4,
|
|
51
|
+
color: COLORS.SURFACE.ON_SURFACE.HIGH,
|
|
52
|
+
fontSize: 14,
|
|
53
|
+
fontFamily: 'Inter',
|
|
54
|
+
fontWeight: '600',
|
|
55
|
+
lineHeight: 20,
|
|
56
|
+
letterSpacing: 0.25,
|
|
57
|
+
},
|
|
58
|
+
});
|
|
@@ -9,6 +9,8 @@ import { useSelector } from 'react-redux';
|
|
|
9
9
|
|
|
10
10
|
import { COLORS } from '../utils/theme';
|
|
11
11
|
import type { RootState } from '../redux';
|
|
12
|
+
import { RadioIcon } from '../Icons';
|
|
13
|
+
import { useShouldGoLive } from '../hooks-util';
|
|
12
14
|
|
|
13
15
|
export interface HMSPreviewJoinButtonProps {
|
|
14
16
|
onJoin(): void;
|
|
@@ -23,15 +25,14 @@ export const HMSPreviewJoinButton: React.FC<HMSPreviewJoinButtonProps> = ({
|
|
|
23
25
|
(state: RootState) => state.user.userName.length <= 0
|
|
24
26
|
);
|
|
25
27
|
|
|
28
|
+
const shouldGoLive = useShouldGoLive();
|
|
29
|
+
|
|
26
30
|
const disabledJoin = userNameInvalid || loading;
|
|
27
31
|
|
|
28
32
|
return (
|
|
29
33
|
<TouchableHighlight
|
|
30
34
|
underlayColor={COLORS.PRIMARY.DARK}
|
|
31
|
-
style={[
|
|
32
|
-
styles.button,
|
|
33
|
-
disabledJoin ? { backgroundColor: COLORS.PRIMARY.DISABLED } : null,
|
|
34
|
-
]}
|
|
35
|
+
style={[styles.button, disabledJoin ? styles.disabledButton : null]}
|
|
35
36
|
onPress={onJoin}
|
|
36
37
|
disabled={disabledJoin}
|
|
37
38
|
>
|
|
@@ -44,14 +45,23 @@ export const HMSPreviewJoinButton: React.FC<HMSPreviewJoinButtonProps> = ({
|
|
|
44
45
|
/>
|
|
45
46
|
) : null}
|
|
46
47
|
|
|
48
|
+
{shouldGoLive ? (
|
|
49
|
+
<RadioIcon
|
|
50
|
+
style={[
|
|
51
|
+
loading ? styles.hiddenView : null,
|
|
52
|
+
disabledJoin ? styles.disabledIcon : null,
|
|
53
|
+
]}
|
|
54
|
+
/>
|
|
55
|
+
) : null}
|
|
56
|
+
|
|
47
57
|
<Text
|
|
48
58
|
style={[
|
|
49
59
|
styles.text,
|
|
50
|
-
|
|
51
|
-
disabledJoin ?
|
|
60
|
+
loading ? styles.hiddenView : null,
|
|
61
|
+
disabledJoin ? styles.disabledText : null,
|
|
52
62
|
]}
|
|
53
63
|
>
|
|
54
|
-
Join Now
|
|
64
|
+
{shouldGoLive ? 'Go Live' : 'Join Now'}
|
|
55
65
|
</Text>
|
|
56
66
|
</>
|
|
57
67
|
</TouchableHighlight>
|
|
@@ -60,6 +70,7 @@ export const HMSPreviewJoinButton: React.FC<HMSPreviewJoinButtonProps> = ({
|
|
|
60
70
|
|
|
61
71
|
const styles = StyleSheet.create({
|
|
62
72
|
button: {
|
|
73
|
+
flexDirection: 'row',
|
|
63
74
|
paddingHorizontal: 16,
|
|
64
75
|
paddingVertical: 8,
|
|
65
76
|
borderRadius: 8,
|
|
@@ -78,4 +89,16 @@ const styles = StyleSheet.create({
|
|
|
78
89
|
marginHorizontal: 8,
|
|
79
90
|
},
|
|
80
91
|
loader: { position: 'absolute' },
|
|
92
|
+
disabledButton: {
|
|
93
|
+
backgroundColor: COLORS.PRIMARY.DISABLED,
|
|
94
|
+
},
|
|
95
|
+
disabledIcon: {
|
|
96
|
+
tintColor: COLORS.PRIMARY.ON_PRIMARY.LOW,
|
|
97
|
+
},
|
|
98
|
+
disabledText: {
|
|
99
|
+
color: COLORS.PRIMARY.ON_PRIMARY.LOW,
|
|
100
|
+
},
|
|
101
|
+
hiddenView: {
|
|
102
|
+
opacity: 0,
|
|
103
|
+
},
|
|
81
104
|
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { View, StyleSheet } from 'react-native';
|
|
3
|
+
import { useSelector } from 'react-redux';
|
|
4
|
+
|
|
5
|
+
import { NetworkQualityIcon } from '../Icons';
|
|
6
|
+
import { COLORS } from '..//utils/theme';
|
|
7
|
+
import type { RootState } from '../redux';
|
|
8
|
+
import { useHMSInstance } from '../hooks-util';
|
|
9
|
+
|
|
10
|
+
export const HMSPreviewNetworkQuality = () => {
|
|
11
|
+
const hmsInstance = useHMSInstance();
|
|
12
|
+
const localPeerNetworkQuality = useSelector(
|
|
13
|
+
(state: RootState) =>
|
|
14
|
+
state.hmsStates.localPeer?.networkQuality?.downlinkQuality
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
React.useEffect(() => {
|
|
18
|
+
hmsInstance.enableNetworkQualityUpdates();
|
|
19
|
+
|
|
20
|
+
return () => hmsInstance.disableNetworkQualityUpdates();
|
|
21
|
+
}, []);
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<View style={styles.container}>
|
|
25
|
+
<NetworkQualityIcon quality={localPeerNetworkQuality} />
|
|
26
|
+
</View>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const styles = StyleSheet.create({
|
|
31
|
+
container: {
|
|
32
|
+
marginLeft: 8,
|
|
33
|
+
marginBottom: 8,
|
|
34
|
+
borderRadius: 8,
|
|
35
|
+
paddingVertical: 4,
|
|
36
|
+
paddingHorizontal: 8,
|
|
37
|
+
backgroundColor: COLORS.BACKGROUND.DIM_80,
|
|
38
|
+
alignSelf: 'flex-start',
|
|
39
|
+
},
|
|
40
|
+
});
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { StyleSheet, Text, View } from 'react-native';
|
|
3
3
|
import { useSelector } from 'react-redux';
|
|
4
|
-
import type { HMSPeer } from '@100mslive/react-native-hms';
|
|
5
4
|
|
|
6
5
|
import { COLORS } from '../utils/theme';
|
|
7
|
-
import { ParticipantsIcon } from '../Icons';
|
|
8
6
|
import type { RootState } from '../redux';
|
|
9
7
|
|
|
10
8
|
export interface HMSPreviewPeersListProps {}
|
|
@@ -16,49 +14,21 @@ export const HMSPreviewPeersList: React.FC<HMSPreviewPeersListProps> = () => {
|
|
|
16
14
|
|
|
17
15
|
return (
|
|
18
16
|
<View style={styles.container}>
|
|
19
|
-
{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<Text style={[styles.text, styles.textSpacer]}>
|
|
27
|
-
{previewPeersList[0]!.name} has joined
|
|
28
|
-
</Text>
|
|
29
|
-
) : (
|
|
30
|
-
<View style={styles.multiTextContainer}>
|
|
31
|
-
<Text
|
|
32
|
-
style={[styles.text, styles.flexView]}
|
|
33
|
-
ellipsizeMode="tail"
|
|
34
|
-
numberOfLines={1}
|
|
35
|
-
>
|
|
36
|
-
{previewPeersList
|
|
37
|
-
.slice(0, 2)
|
|
38
|
-
.map((peer: HMSPeer) => peer.name)
|
|
39
|
-
.join(', ')}
|
|
40
|
-
</Text>
|
|
41
|
-
|
|
42
|
-
{previewPeersList.length - 2 > 0 ? (
|
|
43
|
-
<Text style={styles.text}>
|
|
44
|
-
{' '}
|
|
45
|
-
+{previewPeersList.length - 2}{' '}
|
|
46
|
-
{previewPeersList.length - 2 > 1 ? 'others' : 'other'}
|
|
47
|
-
</Text>
|
|
48
|
-
) : null}
|
|
49
|
-
</View>
|
|
50
|
-
)}
|
|
17
|
+
<Text style={[styles.text, styles.textSpacer]}>
|
|
18
|
+
{previewPeersList.length === 0
|
|
19
|
+
? 'You are the first to join'
|
|
20
|
+
: `${previewPeersList.length} ${
|
|
21
|
+
previewPeersList.length > 1 ? 'others' : 'other'
|
|
22
|
+
} in session`}
|
|
23
|
+
</Text>
|
|
51
24
|
</View>
|
|
52
25
|
);
|
|
53
26
|
};
|
|
54
27
|
|
|
55
28
|
const styles = StyleSheet.create({
|
|
56
29
|
container: {
|
|
57
|
-
flexDirection: 'row',
|
|
58
30
|
alignItems: 'center',
|
|
59
31
|
backgroundColor: COLORS.SURFACE.DEFAULT,
|
|
60
|
-
marginTop: 16,
|
|
61
|
-
alignSelf: 'center',
|
|
62
32
|
paddingVertical: 8,
|
|
63
33
|
paddingHorizontal: 12,
|
|
64
34
|
borderRadius: 20,
|
|
@@ -75,13 +45,4 @@ const styles = StyleSheet.create({
|
|
|
75
45
|
textSpacer: {
|
|
76
46
|
marginHorizontal: 8,
|
|
77
47
|
},
|
|
78
|
-
flexView: {
|
|
79
|
-
flex: 1,
|
|
80
|
-
flexShrink: 1,
|
|
81
|
-
},
|
|
82
|
-
multiTextContainer: {
|
|
83
|
-
flexDirection: 'row',
|
|
84
|
-
marginHorizontal: 8,
|
|
85
|
-
maxWidth: '70%',
|
|
86
|
-
},
|
|
87
48
|
});
|
|
@@ -2,15 +2,39 @@ import * as React from 'react';
|
|
|
2
2
|
import { StyleSheet, Text } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import { COLORS } from '../utils/theme';
|
|
5
|
+
import { useCanPublishAudio, useCanPublishVideo } from '../hooks-sdk';
|
|
5
6
|
|
|
6
7
|
export interface HMSPreviewSubtitleProps {
|
|
7
8
|
subtitle?: string;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
export const HMSPreviewSubtitle: React.FC<HMSPreviewSubtitleProps> = ({
|
|
11
|
-
subtitle
|
|
12
|
+
subtitle,
|
|
12
13
|
}) => {
|
|
13
|
-
|
|
14
|
+
const canPublishAudio = useCanPublishAudio();
|
|
15
|
+
const canPublishVideo = useCanPublishVideo();
|
|
16
|
+
|
|
17
|
+
if (subtitle) {
|
|
18
|
+
return <Text style={styles.title}>{subtitle}</Text>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (canPublishAudio && canPublishVideo) {
|
|
22
|
+
return (
|
|
23
|
+
<Text style={styles.title}>
|
|
24
|
+
Setup your audio and video before joining
|
|
25
|
+
</Text>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (canPublishAudio) {
|
|
30
|
+
return <Text style={styles.title}>Setup your audio before joining</Text>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (canPublishVideo) {
|
|
34
|
+
return <Text style={styles.title}>Setup your video before joining</Text>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return <Text style={styles.title}>Enter your name before joining</Text>;
|
|
14
38
|
};
|
|
15
39
|
|
|
16
40
|
const styles = StyleSheet.create({
|
|
@@ -1,23 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useSelector } from 'react-redux';
|
|
3
|
-
import { HMSVideoViewMode } from '@100mslive/react-native-hms';
|
|
4
3
|
import { StyleSheet, Text, View } from 'react-native';
|
|
5
4
|
|
|
6
5
|
import { PersonIcon } from '../Icons';
|
|
7
|
-
import { useHMSInstance } from '../hooks-util';
|
|
8
6
|
import type { RootState } from '../redux';
|
|
9
7
|
import { getInitials } from '../utils/functions';
|
|
10
8
|
import { COLORS } from '../utils/theme';
|
|
9
|
+
import { HMSLocalVideoView } from './HMSLocalVideoView';
|
|
11
10
|
|
|
12
11
|
export const HMSPreviewTile: React.FC = () => {
|
|
13
|
-
const hmsInstance = useHMSInstance();
|
|
14
|
-
const HmsView = hmsInstance.HmsView;
|
|
15
|
-
const mirrorCamera = useSelector(
|
|
16
|
-
(state: RootState) => state.app.joinConfig.mirrorCamera
|
|
17
|
-
);
|
|
18
|
-
const autoSimulcast = useSelector(
|
|
19
|
-
(state: RootState) => state.app.joinConfig.autoSimulcast
|
|
20
|
-
);
|
|
21
12
|
const isLocalVideoMuted = useSelector(
|
|
22
13
|
(state: RootState) => state.hmsStates.isLocalVideoMuted
|
|
23
14
|
);
|
|
@@ -26,12 +17,6 @@ export const HMSPreviewTile: React.FC = () => {
|
|
|
26
17
|
);
|
|
27
18
|
const userName = useSelector((state: RootState) => state.user.userName);
|
|
28
19
|
|
|
29
|
-
React.useEffect(() => {
|
|
30
|
-
hmsInstance.enableNetworkQualityUpdates();
|
|
31
|
-
|
|
32
|
-
return () => hmsInstance.disableNetworkQualityUpdates();
|
|
33
|
-
}, []);
|
|
34
|
-
|
|
35
20
|
return (
|
|
36
21
|
<View style={styles.modalContainer}>
|
|
37
22
|
{isLocalVideoMuted || !localVideoTrackId ? (
|
|
@@ -45,14 +30,7 @@ export const HMSPreviewTile: React.FC = () => {
|
|
|
45
30
|
</View>
|
|
46
31
|
</View>
|
|
47
32
|
) : (
|
|
48
|
-
<
|
|
49
|
-
trackId={localVideoTrackId}
|
|
50
|
-
key={localVideoTrackId}
|
|
51
|
-
mirror={mirrorCamera}
|
|
52
|
-
autoSimulcast={autoSimulcast}
|
|
53
|
-
scaleType={HMSVideoViewMode.ASPECT_FILL}
|
|
54
|
-
style={styles.hmsView}
|
|
55
|
-
/>
|
|
33
|
+
<HMSLocalVideoView />
|
|
56
34
|
)}
|
|
57
35
|
</View>
|
|
58
36
|
);
|