@100mslive/react-native-room-kit 1.0.6 → 1.0.7
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/Icons/Recording/assets/recording-pause.png +0 -0
- package/lib/commonjs/Icons/Recording/assets/recording-pause@2x.png +0 -0
- package/lib/commonjs/Icons/Recording/assets/recording-pause@3x.png +0 -0
- package/lib/commonjs/Icons/Recording/index.js +1 -1
- package/lib/commonjs/Icons/Recording/index.js.map +1 -1
- package/lib/commonjs/components/AnimatedFooter.js +5 -3
- package/lib/commonjs/components/AnimatedFooter.js.map +1 -1
- package/lib/commonjs/components/AnimatedHLSFooter.js +4 -9
- package/lib/commonjs/components/AnimatedHLSFooter.js.map +1 -1
- package/lib/commonjs/components/AnimatedHeader.js +17 -5
- package/lib/commonjs/components/AnimatedHeader.js.map +1 -1
- package/lib/commonjs/components/BottomSheet.js +11 -5
- package/lib/commonjs/components/BottomSheet.js.map +1 -1
- package/lib/commonjs/components/Chat/ChatFilterBottomSheetView.js +2 -1
- package/lib/commonjs/components/Chat/ChatFilterBottomSheetView.js.map +1 -1
- package/lib/commonjs/components/ChatAndParticipants/ChatAndParticipantsBottomSheet.js +11 -10
- package/lib/commonjs/components/ChatAndParticipants/ChatAndParticipantsBottomSheet.js.map +1 -1
- package/lib/commonjs/components/ChatAndParticipants/ChatAndParticipantsView.js +5 -3
- package/lib/commonjs/components/ChatAndParticipants/ChatAndParticipantsView.js.map +1 -1
- package/lib/commonjs/components/DisplayView.js +4 -11
- package/lib/commonjs/components/DisplayView.js.map +1 -1
- package/lib/commonjs/components/EndRoomModal.js +1 -2
- package/lib/commonjs/components/EndRoomModal.js.map +1 -1
- package/lib/commonjs/components/EndRoomModalContent.js +2 -1
- package/lib/commonjs/components/EndRoomModalContent.js.map +1 -1
- package/lib/commonjs/components/Footer.js +12 -18
- package/lib/commonjs/components/Footer.js.map +1 -1
- package/lib/commonjs/components/GridView.js +31 -1
- package/lib/commonjs/components/GridView.js.map +1 -1
- package/lib/commonjs/components/HLSFooter.js +3 -1
- package/lib/commonjs/components/HLSFooter.js.map +1 -1
- package/lib/commonjs/components/HLSView.js +1 -1
- package/lib/commonjs/components/HLSView.js.map +1 -1
- package/lib/commonjs/components/HMSKeyboardAvoidingView.android.js +2 -0
- package/lib/commonjs/components/HMSKeyboardAvoidingView.android.js.map +1 -1
- package/lib/commonjs/components/HMSKeyboardAvoidingView.js +3 -1
- package/lib/commonjs/components/HMSKeyboardAvoidingView.js.map +1 -1
- package/lib/commonjs/components/HMSLiveIndicator.js +6 -57
- package/lib/commonjs/components/HMSLiveIndicator.js.map +1 -1
- package/lib/commonjs/components/HMSLiveViewerCount.js +78 -0
- package/lib/commonjs/components/HMSLiveViewerCount.js.map +1 -0
- package/lib/commonjs/components/HMSOverlayChatView.js +11 -2
- package/lib/commonjs/components/HMSOverlayChatView.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewEditName.js +6 -1
- package/lib/commonjs/components/HMSPreviewEditName.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewHLSLiveIndicator.js +2 -1
- package/lib/commonjs/components/HMSPreviewHLSLiveIndicator.js.map +1 -1
- package/lib/commonjs/components/HMSRecordingIndicator.js +14 -4
- package/lib/commonjs/components/HMSRecordingIndicator.js.map +1 -1
- package/lib/commonjs/components/HMSRoomOptions.js +3 -6
- package/lib/commonjs/components/HMSRoomOptions.js.map +1 -1
- package/lib/commonjs/components/Header.js +11 -3
- package/lib/commonjs/components/Header.js.map +1 -1
- package/lib/commonjs/components/LeaveRoomBottomSheet.js +4 -7
- package/lib/commonjs/components/LeaveRoomBottomSheet.js.map +1 -1
- package/lib/commonjs/components/Meeting.js +2 -13
- package/lib/commonjs/components/Meeting.js.map +1 -1
- package/lib/commonjs/components/MeetingScreenContent.js +46 -48
- package/lib/commonjs/components/MeetingScreenContent.js.map +1 -1
- package/lib/commonjs/components/MiniView.js.map +1 -1
- package/lib/commonjs/components/OverlayedViews.js +6 -2
- package/lib/commonjs/components/OverlayedViews.js.map +1 -1
- package/lib/commonjs/components/PeerSettingsModalContent.js +2 -1
- package/lib/commonjs/components/PeerSettingsModalContent.js.map +1 -1
- package/lib/commonjs/components/PeerVideoTile/PeerVideoTileView.js +2 -1
- package/lib/commonjs/components/PeerVideoTile/PeerVideoTileView.js.map +1 -1
- package/lib/commonjs/components/PressableIcon.js +6 -2
- package/lib/commonjs/components/PressableIcon.js.map +1 -1
- package/lib/commonjs/components/RoomSettingsModalContent.js +25 -9
- package/lib/commonjs/components/RoomSettingsModalContent.js.map +1 -1
- package/lib/commonjs/components/RoomSettingsModalDebugModeContent.js +1 -1
- package/lib/commonjs/components/RoomSettingsModalDebugModeContent.js.map +1 -1
- package/lib/commonjs/components/WebrtcView.js +37 -2
- package/lib/commonjs/components/WebrtcView.js.map +1 -1
- package/lib/commonjs/hooks-util-selectors.js +2 -1
- package/lib/commonjs/hooks-util-selectors.js.map +1 -1
- package/lib/commonjs/hooks-util.js +59 -29
- package/lib/commonjs/hooks-util.js.map +1 -1
- package/lib/commonjs/redux/actionTypes.js +3 -1
- package/lib/commonjs/redux/actionTypes.js.map +1 -1
- package/lib/commonjs/redux/actions/index.js +8 -1
- package/lib/commonjs/redux/actions/index.js.map +1 -1
- package/lib/commonjs/redux/reducers/appState.js +9 -1
- package/lib/commonjs/redux/reducers/appState.js.map +1 -1
- package/lib/commonjs/utils/types.js +3 -3
- package/lib/commonjs/utils/types.js.map +1 -1
- package/lib/module/Icons/Recording/assets/recording-pause.png +0 -0
- package/lib/module/Icons/Recording/assets/recording-pause@2x.png +0 -0
- package/lib/module/Icons/Recording/assets/recording-pause@3x.png +0 -0
- package/lib/module/Icons/Recording/index.js +1 -1
- package/lib/module/Icons/Recording/index.js.map +1 -1
- package/lib/module/components/AnimatedFooter.js +5 -3
- package/lib/module/components/AnimatedFooter.js.map +1 -1
- package/lib/module/components/AnimatedHLSFooter.js +5 -10
- package/lib/module/components/AnimatedHLSFooter.js.map +1 -1
- package/lib/module/components/AnimatedHeader.js +18 -6
- package/lib/module/components/AnimatedHeader.js.map +1 -1
- package/lib/module/components/BottomSheet.js +12 -6
- package/lib/module/components/BottomSheet.js.map +1 -1
- package/lib/module/components/Chat/ChatFilterBottomSheetView.js +2 -1
- package/lib/module/components/Chat/ChatFilterBottomSheetView.js.map +1 -1
- package/lib/module/components/ChatAndParticipants/ChatAndParticipantsBottomSheet.js +13 -12
- package/lib/module/components/ChatAndParticipants/ChatAndParticipantsBottomSheet.js.map +1 -1
- package/lib/module/components/ChatAndParticipants/ChatAndParticipantsView.js +6 -4
- package/lib/module/components/ChatAndParticipants/ChatAndParticipantsView.js.map +1 -1
- package/lib/module/components/DisplayView.js +5 -12
- package/lib/module/components/DisplayView.js.map +1 -1
- package/lib/module/components/EndRoomModal.js +1 -2
- package/lib/module/components/EndRoomModal.js.map +1 -1
- package/lib/module/components/EndRoomModalContent.js +2 -1
- package/lib/module/components/EndRoomModalContent.js.map +1 -1
- package/lib/module/components/Footer.js +12 -18
- package/lib/module/components/Footer.js.map +1 -1
- package/lib/module/components/GridView.js +32 -2
- package/lib/module/components/GridView.js.map +1 -1
- package/lib/module/components/HLSFooter.js +3 -1
- package/lib/module/components/HLSFooter.js.map +1 -1
- package/lib/module/components/HLSView.js +2 -2
- package/lib/module/components/HLSView.js.map +1 -1
- package/lib/module/components/HMSKeyboardAvoidingView.android.js +2 -3
- package/lib/module/components/HMSKeyboardAvoidingView.android.js.map +1 -1
- package/lib/module/components/HMSKeyboardAvoidingView.js +3 -1
- package/lib/module/components/HMSKeyboardAvoidingView.js.map +1 -1
- package/lib/module/components/HMSLiveIndicator.js +9 -60
- package/lib/module/components/HMSLiveIndicator.js.map +1 -1
- package/lib/module/components/HMSLiveViewerCount.js +70 -0
- package/lib/module/components/HMSLiveViewerCount.js.map +1 -0
- package/lib/module/components/HMSOverlayChatView.js +11 -2
- package/lib/module/components/HMSOverlayChatView.js.map +1 -1
- package/lib/module/components/HMSPreviewEditName.js +6 -1
- package/lib/module/components/HMSPreviewEditName.js.map +1 -1
- package/lib/module/components/HMSPreviewHLSLiveIndicator.js +2 -1
- package/lib/module/components/HMSPreviewHLSLiveIndicator.js.map +1 -1
- package/lib/module/components/HMSRecordingIndicator.js +14 -4
- package/lib/module/components/HMSRecordingIndicator.js.map +1 -1
- package/lib/module/components/HMSRoomOptions.js +3 -6
- package/lib/module/components/HMSRoomOptions.js.map +1 -1
- package/lib/module/components/Header.js +10 -3
- package/lib/module/components/Header.js.map +1 -1
- package/lib/module/components/LeaveRoomBottomSheet.js +4 -7
- package/lib/module/components/LeaveRoomBottomSheet.js.map +1 -1
- package/lib/module/components/Meeting.js +3 -14
- package/lib/module/components/Meeting.js.map +1 -1
- package/lib/module/components/MeetingScreenContent.js +51 -53
- package/lib/module/components/MeetingScreenContent.js.map +1 -1
- package/lib/module/components/MiniView.js.map +1 -1
- package/lib/module/components/OverlayedViews.js +6 -2
- package/lib/module/components/OverlayedViews.js.map +1 -1
- package/lib/module/components/PeerSettingsModalContent.js +2 -1
- package/lib/module/components/PeerSettingsModalContent.js.map +1 -1
- package/lib/module/components/PeerVideoTile/PeerVideoTileView.js +2 -1
- package/lib/module/components/PeerVideoTile/PeerVideoTileView.js.map +1 -1
- package/lib/module/components/PressableIcon.js +6 -2
- package/lib/module/components/PressableIcon.js.map +1 -1
- package/lib/module/components/RoomSettingsModalContent.js +26 -10
- package/lib/module/components/RoomSettingsModalContent.js.map +1 -1
- package/lib/module/components/RoomSettingsModalDebugModeContent.js +2 -2
- package/lib/module/components/RoomSettingsModalDebugModeContent.js.map +1 -1
- package/lib/module/components/WebrtcView.js +37 -2
- package/lib/module/components/WebrtcView.js.map +1 -1
- package/lib/module/hooks-util-selectors.js +2 -1
- package/lib/module/hooks-util-selectors.js.map +1 -1
- package/lib/module/hooks-util.js +58 -29
- package/lib/module/hooks-util.js.map +1 -1
- package/lib/module/redux/actionTypes.js +3 -1
- package/lib/module/redux/actionTypes.js.map +1 -1
- package/lib/module/redux/actions/index.js +6 -0
- package/lib/module/redux/actions/index.js.map +1 -1
- package/lib/module/redux/reducers/appState.js +9 -1
- package/lib/module/redux/reducers/appState.js.map +1 -1
- package/lib/module/utils/types.js +2 -2
- package/lib/module/utils/types.js.map +1 -1
- package/lib/typescript/Icons/Recording/index.d.ts +1 -1
- package/lib/typescript/Icons/Recording/index.d.ts.map +1 -1
- package/lib/typescript/components/AnimatedFooter.d.ts.map +1 -1
- package/lib/typescript/components/AnimatedHLSFooter.d.ts.map +1 -1
- package/lib/typescript/components/AnimatedHeader.d.ts.map +1 -1
- package/lib/typescript/components/BottomSheet.d.ts +1 -0
- package/lib/typescript/components/BottomSheet.d.ts.map +1 -1
- package/lib/typescript/components/Chat/ChatFilterBottomSheetView.d.ts.map +1 -1
- package/lib/typescript/components/ChatAndParticipants/ChatAndParticipantsBottomSheet.d.ts.map +1 -1
- package/lib/typescript/components/ChatAndParticipants/ChatAndParticipantsView.d.ts.map +1 -1
- package/lib/typescript/components/DisplayView.d.ts.map +1 -1
- package/lib/typescript/components/EndRoomModal.d.ts.map +1 -1
- package/lib/typescript/components/EndRoomModalContent.d.ts.map +1 -1
- package/lib/typescript/components/Footer.d.ts +1 -1
- package/lib/typescript/components/Footer.d.ts.map +1 -1
- package/lib/typescript/components/GridView.d.ts.map +1 -1
- package/lib/typescript/components/HLSView.d.ts.map +1 -1
- package/lib/typescript/components/HMSKeyboardAvoidingView.android.d.ts.map +1 -1
- package/lib/typescript/components/HMSKeyboardAvoidingView.d.ts +2 -1
- package/lib/typescript/components/HMSKeyboardAvoidingView.d.ts.map +1 -1
- package/lib/typescript/components/HMSLiveIndicator.d.ts.map +1 -1
- package/lib/typescript/components/HMSLiveViewerCount.d.ts +3 -0
- package/lib/typescript/components/HMSLiveViewerCount.d.ts.map +1 -0
- package/lib/typescript/components/HMSOverlayChatView.d.ts +5 -1
- package/lib/typescript/components/HMSOverlayChatView.d.ts.map +1 -1
- package/lib/typescript/components/HMSPreviewEditName.d.ts.map +1 -1
- package/lib/typescript/components/HMSPreviewHLSLiveIndicator.d.ts.map +1 -1
- package/lib/typescript/components/HMSRecordingIndicator.d.ts.map +1 -1
- package/lib/typescript/components/HMSRoomOptions.d.ts.map +1 -1
- package/lib/typescript/components/Header.d.ts +1 -0
- package/lib/typescript/components/Header.d.ts.map +1 -1
- package/lib/typescript/components/LeaveRoomBottomSheet.d.ts.map +1 -1
- package/lib/typescript/components/Meeting.d.ts.map +1 -1
- package/lib/typescript/components/MeetingScreenContent.d.ts.map +1 -1
- package/lib/typescript/components/OverlayedViews.d.ts +4 -1
- package/lib/typescript/components/OverlayedViews.d.ts.map +1 -1
- package/lib/typescript/components/PeerSettingsModalContent.d.ts.map +1 -1
- package/lib/typescript/components/PeerVideoTile/PeerVideoTileView.d.ts.map +1 -1
- package/lib/typescript/components/PressableIcon.d.ts.map +1 -1
- package/lib/typescript/components/RoomSettingsModalContent.d.ts.map +1 -1
- package/lib/typescript/components/RoomSettingsModalDebugModeContent.d.ts.map +1 -1
- package/lib/typescript/components/WebrtcView.d.ts +2 -0
- package/lib/typescript/components/WebrtcView.d.ts.map +1 -1
- package/lib/typescript/hooks-util-selectors.d.ts.map +1 -1
- package/lib/typescript/hooks-util.d.ts +4 -0
- package/lib/typescript/hooks-util.d.ts.map +1 -1
- package/lib/typescript/redux/actionTypes.d.ts +1 -0
- package/lib/typescript/redux/actionTypes.d.ts.map +1 -1
- package/lib/typescript/redux/actions/index.d.ts +6 -0
- package/lib/typescript/redux/actions/index.d.ts.map +1 -1
- package/lib/typescript/redux/index.d.ts +1 -0
- package/lib/typescript/redux/index.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/appState.d.ts +1 -0
- package/lib/typescript/redux/reducers/appState.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/index.d.ts +1 -0
- package/lib/typescript/redux/reducers/index.d.ts.map +1 -1
- package/lib/typescript/utils/types.d.ts +1 -0
- package/lib/typescript/utils/types.d.ts.map +1 -1
- package/package.json +179 -179
- package/src/HMSRoomSetup.tsx +1 -1
- package/src/Icons/Recording/assets/recording-pause.png +0 -0
- package/src/Icons/Recording/assets/recording-pause@2x.png +0 -0
- package/src/Icons/Recording/assets/recording-pause@3x.png +0 -0
- package/src/Icons/Recording/index.tsx +3 -1
- package/src/components/AnimatedFooter.tsx +9 -3
- package/src/components/AnimatedHLSFooter.tsx +8 -17
- package/src/components/AnimatedHeader.tsx +16 -5
- package/src/components/BottomSheet.tsx +11 -5
- package/src/components/Chat/ChatFilterBottomSheetView.tsx +1 -0
- package/src/components/ChatAndParticipants/ChatAndParticipantsBottomSheet.tsx +12 -7
- package/src/components/ChatAndParticipants/ChatAndParticipantsView.tsx +5 -4
- package/src/components/DisplayView.tsx +4 -13
- package/src/components/EndRoomModal.tsx +0 -1
- package/src/components/EndRoomModalContent.tsx +2 -1
- package/src/components/Footer.tsx +18 -23
- package/src/components/GridView.tsx +31 -4
- package/src/components/HLSFooter.tsx +1 -1
- package/src/components/HLSView.tsx +2 -1
- package/src/components/HMSKeyboardAvoidingView.android.tsx +1 -5
- package/src/components/HMSKeyboardAvoidingView.tsx +6 -3
- package/src/components/HMSLiveIndicator.tsx +8 -73
- package/src/components/HMSLiveViewerCount.tsx +90 -0
- package/src/components/HMSOverlayChatView.tsx +18 -2
- package/src/components/HMSPreviewEditName.tsx +10 -1
- package/src/components/HMSPreviewHLSLiveIndicator.tsx +2 -1
- package/src/components/HMSRecordingIndicator.tsx +20 -3
- package/src/components/HMSRoomOptions.tsx +0 -3
- package/src/components/Header.tsx +14 -3
- package/src/components/LeaveRoomBottomSheet.tsx +3 -6
- package/src/components/Meeting.tsx +2 -19
- package/src/components/MeetingScreenContent.tsx +67 -64
- package/src/components/MiniView.tsx +4 -4
- package/src/components/OverlayedViews.tsx +6 -3
- package/src/components/PeerSettingsModalContent.tsx +2 -1
- package/src/components/PeerVideoTile/PeerVideoTileView.tsx +2 -1
- package/src/components/PressableIcon.tsx +22 -17
- package/src/components/RoomSettingsModalContent.tsx +22 -6
- package/src/components/RoomSettingsModalDebugModeContent.tsx +2 -1
- package/src/components/WebrtcView.tsx +59 -22
- package/src/hooks-util-selectors.tsx +2 -1
- package/src/hooks-util.ts +61 -44
- package/src/redux/actionTypes.ts +3 -0
- package/src/redux/actions/index.ts +5 -0
- package/src/redux/reducers/appState.ts +8 -0
- package/src/utils/types.ts +12 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import Modal from 'react-native-modal';
|
|
3
3
|
import type { ReactNativeModal } from 'react-native-modal';
|
|
4
|
-
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
|
4
|
+
import { KeyboardAvoidingView, Platform, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
|
5
5
|
import type {
|
|
6
6
|
StyleProp,
|
|
7
7
|
TextProps,
|
|
@@ -26,6 +26,7 @@ export type BottomSheetProps = WithRequired<
|
|
|
26
26
|
// closes modal and no action will be taken after modal has been closed
|
|
27
27
|
dismissModal(): void;
|
|
28
28
|
containerStyle?: StyleProp<ViewStyle>;
|
|
29
|
+
bottomOffsetSpace?: number;
|
|
29
30
|
fullWidth?: boolean;
|
|
30
31
|
};
|
|
31
32
|
|
|
@@ -38,6 +39,7 @@ export const BottomSheet: React.FC<BottomSheetProps> & {
|
|
|
38
39
|
style,
|
|
39
40
|
children,
|
|
40
41
|
containerStyle,
|
|
42
|
+
bottomOffsetSpace = 32,
|
|
41
43
|
...resetProps
|
|
42
44
|
}) => {
|
|
43
45
|
const { background_dim: backgroundDimColor } = useHMSRoomColorPalette();
|
|
@@ -50,6 +52,8 @@ export const BottomSheet: React.FC<BottomSheetProps> & {
|
|
|
50
52
|
|
|
51
53
|
const isLandscapeOrientation = useIsLandscapeOrientation();
|
|
52
54
|
|
|
55
|
+
const Container = resetProps.avoidKeyboard && Platform.OS === 'android' ? KeyboardAvoidingView : View;
|
|
56
|
+
|
|
53
57
|
return (
|
|
54
58
|
<Modal
|
|
55
59
|
{...resetProps}
|
|
@@ -71,7 +75,8 @@ export const BottomSheet: React.FC<BottomSheetProps> & {
|
|
|
71
75
|
}
|
|
72
76
|
statusBarTranslucent={true}
|
|
73
77
|
>
|
|
74
|
-
<
|
|
78
|
+
<Container
|
|
79
|
+
behavior='padding'
|
|
75
80
|
style={[
|
|
76
81
|
isLandscapeOrientation && !fullWidth
|
|
77
82
|
? styles.landscapeContainer
|
|
@@ -81,7 +86,10 @@ export const BottomSheet: React.FC<BottomSheetProps> & {
|
|
|
81
86
|
]}
|
|
82
87
|
>
|
|
83
88
|
{children}
|
|
84
|
-
|
|
89
|
+
{typeof bottomOffsetSpace === 'number' && bottomOffsetSpace > 0 ? (
|
|
90
|
+
<View style={{ height: bottomOffsetSpace, width: '100%' }} />
|
|
91
|
+
) : null}
|
|
92
|
+
</Container>
|
|
85
93
|
</Modal>
|
|
86
94
|
);
|
|
87
95
|
};
|
|
@@ -198,11 +206,9 @@ const styles = StyleSheet.create({
|
|
|
198
206
|
container: {
|
|
199
207
|
borderTopLeftRadius: 16,
|
|
200
208
|
borderTopRightRadius: 16,
|
|
201
|
-
paddingBottom: 32,
|
|
202
209
|
},
|
|
203
210
|
landscapeContainer: {
|
|
204
211
|
borderRadius: 16,
|
|
205
|
-
paddingBottom: 32,
|
|
206
212
|
width: '60%',
|
|
207
213
|
alignSelf: 'center',
|
|
208
214
|
marginBottom: 12,
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { StyleSheet } from 'react-native';
|
|
3
|
-
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
3
|
|
|
5
4
|
import { BottomSheet } from '../BottomSheet';
|
|
6
|
-
import { useShowChatAndParticipants } from '../../hooks-util';
|
|
5
|
+
import { useHMSRoomStyleSheet, useShowChatAndParticipants } from '../../hooks-util';
|
|
7
6
|
import { ChatAndParticipantsView } from './ChatAndParticipantsView';
|
|
8
|
-
import {
|
|
7
|
+
import { useHeaderHeight } from '../Header';
|
|
9
8
|
import { useIsLandscapeOrientation } from '../../utils/dimension';
|
|
10
9
|
|
|
11
10
|
export const ChatAndParticipantsBottomSheet = () => {
|
|
12
|
-
const
|
|
11
|
+
const headerHeight = useHeaderHeight();
|
|
13
12
|
const isLandscapeOrientation = useIsLandscapeOrientation();
|
|
14
13
|
|
|
15
14
|
const { modalVisible, hide } = useShowChatAndParticipants();
|
|
16
15
|
|
|
16
|
+
const hmsRoomStyles = useHMSRoomStyleSheet((theme) => ({
|
|
17
|
+
contentContainer: {
|
|
18
|
+
backgroundColor: theme.palette.surface_dim,
|
|
19
|
+
},
|
|
20
|
+
}));
|
|
21
|
+
|
|
17
22
|
const closeChatWindow = () => hide('modal');
|
|
18
23
|
|
|
19
24
|
return (
|
|
@@ -24,10 +29,12 @@ export const ChatAndParticipantsBottomSheet = () => {
|
|
|
24
29
|
avoidKeyboard={true}
|
|
25
30
|
containerStyle={[
|
|
26
31
|
styles.bottomSheet,
|
|
32
|
+
hmsRoomStyles.contentContainer,
|
|
27
33
|
{
|
|
28
|
-
marginTop:
|
|
34
|
+
marginTop: isLandscapeOrientation ? 0 : headerHeight,
|
|
29
35
|
},
|
|
30
36
|
]}
|
|
37
|
+
bottomOffsetSpace={0}
|
|
31
38
|
>
|
|
32
39
|
<ChatAndParticipantsView />
|
|
33
40
|
</BottomSheet>
|
|
@@ -37,7 +44,5 @@ export const ChatAndParticipantsBottomSheet = () => {
|
|
|
37
44
|
const styles = StyleSheet.create({
|
|
38
45
|
bottomSheet: {
|
|
39
46
|
flex: 1,
|
|
40
|
-
backgroundColor: undefined,
|
|
41
|
-
paddingBottom: 0,
|
|
42
47
|
},
|
|
43
48
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useSelector } from 'react-redux';
|
|
3
|
-
import { StyleSheet, View } from 'react-native';
|
|
3
|
+
import { Platform, StyleSheet, View } from 'react-native';
|
|
4
|
+
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
4
5
|
|
|
5
6
|
import {
|
|
6
7
|
useHMSRoomStyleSheet,
|
|
@@ -35,7 +36,7 @@ const _ChatAndParticipantsView: React.FC = () => {
|
|
|
35
36
|
activeChatBottomSheetTab === 'Chat' && canShowChat && !overlayChatLayout;
|
|
36
37
|
|
|
37
38
|
return (
|
|
38
|
-
<
|
|
39
|
+
<SafeAreaView style={styles.container} edges={['left', 'right']}>
|
|
39
40
|
<View
|
|
40
41
|
style={[
|
|
41
42
|
styles.contentContainer,
|
|
@@ -55,7 +56,7 @@ const _ChatAndParticipantsView: React.FC = () => {
|
|
|
55
56
|
</View>
|
|
56
57
|
|
|
57
58
|
<ChatFilterBottomSheetView />
|
|
58
|
-
</
|
|
59
|
+
</SafeAreaView>
|
|
59
60
|
);
|
|
60
61
|
};
|
|
61
62
|
|
|
@@ -68,7 +69,7 @@ const styles = StyleSheet.create({
|
|
|
68
69
|
flex: 1,
|
|
69
70
|
paddingHorizontal: 16,
|
|
70
71
|
paddingTop: 12,
|
|
71
|
-
paddingBottom: 32,
|
|
72
|
+
paddingBottom: Platform.OS === 'ios' ? 32 : 0,
|
|
72
73
|
borderTopLeftRadius: 16,
|
|
73
74
|
borderTopRightRadius: 16,
|
|
74
75
|
},
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import React, { useRef, useState } from 'react';
|
|
2
2
|
import { useSelector } from 'react-redux';
|
|
3
|
-
import { InteractionManager } from 'react-native';
|
|
3
|
+
import { InteractionManager, View } from 'react-native';
|
|
4
4
|
import { HMSTrack, HMSCameraControl } from '@100mslive/react-native-hms';
|
|
5
|
-
import Animated, {
|
|
6
|
-
interpolate,
|
|
7
|
-
useAnimatedStyle,
|
|
8
|
-
} from 'react-native-reanimated';
|
|
9
5
|
import type { SharedValue } from 'react-native-reanimated';
|
|
10
6
|
|
|
11
7
|
import { DefaultModal } from './DefaultModal';
|
|
@@ -132,19 +128,14 @@ export const DisplayView: React.FC<DisplayViewProps> = ({
|
|
|
132
128
|
setModalVisible(ModalTypes.STREAMING_QUALITY_SETTING, true);
|
|
133
129
|
};
|
|
134
130
|
|
|
135
|
-
const animatedStyles = useAnimatedStyle(() => {
|
|
136
|
-
return {
|
|
137
|
-
transform: [{ translateY: interpolate(offset.value, [0, 1], [4, 0]) }],
|
|
138
|
-
};
|
|
139
|
-
}, []);
|
|
140
|
-
|
|
141
131
|
return (
|
|
142
|
-
<
|
|
132
|
+
<View style={{ flex: 1 }}>
|
|
143
133
|
{isHLSViewer ? (
|
|
144
134
|
<HLSView />
|
|
145
135
|
) : (
|
|
146
136
|
<WebrtcView
|
|
147
137
|
ref={gridViewRef}
|
|
138
|
+
offset={offset}
|
|
148
139
|
peerTrackNodes={peerTrackNodes}
|
|
149
140
|
handlePeerTileMorePress={handlePeerTileMorePress}
|
|
150
141
|
/>
|
|
@@ -239,6 +230,6 @@ export const DisplayView: React.FC<DisplayViewProps> = ({
|
|
|
239
230
|
</DefaultModal>
|
|
240
231
|
</>
|
|
241
232
|
)}
|
|
242
|
-
</
|
|
233
|
+
</View>
|
|
243
234
|
);
|
|
244
235
|
};
|
|
@@ -16,7 +16,6 @@ export const EndRoomModal: React.FC<EndRoomModalProps> = () => {
|
|
|
16
16
|
<BottomSheet
|
|
17
17
|
dismissModal={dismissModal}
|
|
18
18
|
isVisible={modalVisibleType === ModalTypes.END_ROOM}
|
|
19
|
-
animationOutTiming={700}
|
|
20
19
|
>
|
|
21
20
|
<EndRoomModalContent dismissModal={dismissModal} />
|
|
22
21
|
</BottomSheet>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useSelector } from 'react-redux';
|
|
3
3
|
import { View, Text, StyleSheet, TouchableOpacity } from 'react-native';
|
|
4
|
+
import { HMSStreamingState } from '@100mslive/react-native-hms';
|
|
4
5
|
|
|
5
6
|
import { useHMSRoomStyleSheet, useLeaveMethods } from '../hooks-util';
|
|
6
7
|
import { AlertTriangleIcon, CloseIcon } from '../Icons';
|
|
@@ -40,7 +41,7 @@ export const EndRoomModalContent: React.FC<EndRoomModalContentProps> = ({
|
|
|
40
41
|
|
|
41
42
|
const isStreaming = useSelector(
|
|
42
43
|
(state: RootState) =>
|
|
43
|
-
state.hmsStates.room?.hlsStreamingState?.
|
|
44
|
+
state.hmsStates.room?.hlsStreamingState?.state === HMSStreamingState.STARTED ?? false
|
|
44
45
|
);
|
|
45
46
|
|
|
46
47
|
return (
|
|
@@ -24,7 +24,6 @@ import {
|
|
|
24
24
|
} from '../hooks-sdk';
|
|
25
25
|
import { useSelector } from 'react-redux';
|
|
26
26
|
import type { RootState } from '../redux';
|
|
27
|
-
import { useIsLandscapeOrientation } from '../utils/dimension';
|
|
28
27
|
|
|
29
28
|
interface FooterProps {}
|
|
30
29
|
|
|
@@ -33,7 +32,7 @@ export const _Footer: React.FC<FooterProps> = () => {
|
|
|
33
32
|
const canPublishAudio = useCanPublishAudio();
|
|
34
33
|
const canPublishVideo = useCanPublishVideo();
|
|
35
34
|
const canPublishScreen = useCanPublishScreen();
|
|
36
|
-
const
|
|
35
|
+
const editUsernameDisabled = useSelector((state: RootState) => state.app.editUsernameDisabled);
|
|
37
36
|
|
|
38
37
|
const isViewer = !(canPublishAudio || canPublishVideo || canPublishScreen);
|
|
39
38
|
|
|
@@ -54,12 +53,18 @@ export const _Footer: React.FC<FooterProps> = () => {
|
|
|
54
53
|
!!state.hmsStates.localPeer?.role?.permissions?.browserRecording
|
|
55
54
|
);
|
|
56
55
|
|
|
56
|
+
const canEditUsernameFromRoomModal = isViewer && !editUsernameDisabled;
|
|
57
|
+
|
|
58
|
+
const canShowHandRaiseInFooter = !isOnStage && isViewer; // on_stage_exp object undefined && viewer -> show in footer
|
|
59
|
+
const canShowHandRaiseInRoomModal = !isOnStage && !isViewer; // on_stage_exp object undefined && publisher -> show in room modal
|
|
60
|
+
|
|
57
61
|
const canShowOptions =
|
|
58
|
-
isViewer ||
|
|
59
|
-
canPublishScreen ||
|
|
60
62
|
canShowParticipants ||
|
|
63
|
+
canPublishScreen ||
|
|
61
64
|
canShowBRB ||
|
|
62
|
-
|
|
65
|
+
canShowHandRaiseInRoomModal ||
|
|
66
|
+
canStartRecording ||
|
|
67
|
+
canEditUsernameFromRoomModal;
|
|
63
68
|
|
|
64
69
|
const footerActionButtons = useMemo(() => {
|
|
65
70
|
const actions = [];
|
|
@@ -68,7 +73,7 @@ export const _Footer: React.FC<FooterProps> = () => {
|
|
|
68
73
|
actions.push('chat');
|
|
69
74
|
}
|
|
70
75
|
|
|
71
|
-
if (
|
|
76
|
+
if (canShowHandRaiseInFooter) {
|
|
72
77
|
actions.unshift('hand-raise');
|
|
73
78
|
}
|
|
74
79
|
|
|
@@ -88,10 +93,9 @@ export const _Footer: React.FC<FooterProps> = () => {
|
|
|
88
93
|
|
|
89
94
|
return actions;
|
|
90
95
|
}, [
|
|
91
|
-
|
|
96
|
+
canShowHandRaiseInFooter,
|
|
92
97
|
canShowOptions,
|
|
93
98
|
canShowChat,
|
|
94
|
-
isViewer,
|
|
95
99
|
canPublishAudio,
|
|
96
100
|
canPublishVideo,
|
|
97
101
|
]);
|
|
@@ -103,11 +107,11 @@ export const _Footer: React.FC<FooterProps> = () => {
|
|
|
103
107
|
return (
|
|
104
108
|
<SafeAreaView
|
|
105
109
|
style={isHLSViewer ? null : containerStyles}
|
|
106
|
-
edges={['bottom']}
|
|
110
|
+
edges={['bottom', 'left', 'right']}
|
|
107
111
|
>
|
|
108
112
|
<View
|
|
109
113
|
style={[
|
|
110
|
-
|
|
114
|
+
styles.container,
|
|
111
115
|
isHLSViewer ? styles.hlsContainer : containerStyles,
|
|
112
116
|
]}
|
|
113
117
|
>
|
|
@@ -138,15 +142,14 @@ export const _Footer: React.FC<FooterProps> = () => {
|
|
|
138
142
|
);
|
|
139
143
|
};
|
|
140
144
|
|
|
141
|
-
export const useFooterHeight = () => {
|
|
145
|
+
export const useFooterHeight = (excludeSafeArea: boolean = false) => {
|
|
142
146
|
const isHLSViewer = useIsHLSViewer();
|
|
143
|
-
const isLandscapeOrientation = useIsLandscapeOrientation();
|
|
144
147
|
const { bottom } = useSafeAreaInsets();
|
|
145
148
|
|
|
146
149
|
return (
|
|
147
|
-
bottom +
|
|
148
|
-
(isHLSViewer ? 8 :
|
|
149
|
-
(Platform.OS === 'android' ?
|
|
150
|
+
(excludeSafeArea ? 0 : bottom) +
|
|
151
|
+
(isHLSViewer ? 8 : 16) +
|
|
152
|
+
(Platform.OS === 'android' ? 16 : 0) +
|
|
150
153
|
40
|
|
151
154
|
); // bottomSafeArea + paddingTop + marginBottom + content
|
|
152
155
|
};
|
|
@@ -160,14 +163,6 @@ const styles = StyleSheet.create({
|
|
|
160
163
|
justifyContent: 'center',
|
|
161
164
|
marginBottom: Platform.OS === 'android' ? 16 : 0, // TODO: need to correct hide animation offsets because of this change
|
|
162
165
|
},
|
|
163
|
-
landscapeContainer: {
|
|
164
|
-
paddingTop: 4,
|
|
165
|
-
paddingHorizontal: 4,
|
|
166
|
-
flexDirection: 'row',
|
|
167
|
-
alignItems: 'center',
|
|
168
|
-
justifyContent: 'center',
|
|
169
|
-
marginBottom: Platform.OS === 'android' ? 4 : 0,
|
|
170
|
-
},
|
|
171
166
|
hlsContainer: {
|
|
172
167
|
paddingTop: 8,
|
|
173
168
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useRef, useState, useImperativeHandle } from 'react';
|
|
2
2
|
import type { ElementRef } from 'react';
|
|
3
|
-
import { View, FlatList, StyleSheet, useWindowDimensions } from 'react-native';
|
|
3
|
+
import { View, FlatList, StyleSheet, useWindowDimensions, Platform } from 'react-native';
|
|
4
4
|
import { useDispatch, useSelector } from 'react-redux';
|
|
5
5
|
import type {
|
|
6
6
|
LayoutChangeEvent,
|
|
@@ -18,6 +18,7 @@ import { PaginationDots } from './PaginationDots';
|
|
|
18
18
|
import { setGridViewActivePage } from '../redux/actions';
|
|
19
19
|
import { Tile } from './Tile';
|
|
20
20
|
import { useIsLandscapeOrientation } from '../utils/dimension';
|
|
21
|
+
import { useSafeAreaFrame } from 'react-native-safe-area-context';
|
|
21
22
|
|
|
22
23
|
export type GridViewProps = {
|
|
23
24
|
onPeerTileMorePress(peerTrackNode: PeerTrackNode): void;
|
|
@@ -46,12 +47,32 @@ export const GridView = React.forwardRef<GridViewRefAttrs, GridViewProps>(
|
|
|
46
47
|
const hmsViewRefs = useRef<Record<string, ElementRef<typeof HMSView>>>({});
|
|
47
48
|
const regularTilesFlatlistRef = useRef<FlatList<PeerTrackNode[]>>(null);
|
|
48
49
|
const screenshareTilesFlatlistRef = useRef<FlatList<PeerTrackNode>>(null);
|
|
49
|
-
const [insetTileBoundingBox, setInsetTileBoundingBox] = useState<{
|
|
50
|
+
const [insetTileBoundingBox, setInsetTileBoundingBox] = useState<{
|
|
51
|
+
width: number | null;
|
|
52
|
+
height: number | null;
|
|
53
|
+
}>({ width: null, height: null });
|
|
50
54
|
|
|
51
|
-
const isLandscapeOrientation = useIsLandscapeOrientation();
|
|
52
55
|
const screenshareTilesAvailable = useSelector(
|
|
53
56
|
(state: RootState) => state.app.screensharePeerTrackNodes.length > 0
|
|
54
57
|
);
|
|
58
|
+
const regularTilesAvailable = pairedPeers.length > 0;
|
|
59
|
+
|
|
60
|
+
const isLandscapeOrientation = useIsLandscapeOrientation();
|
|
61
|
+
|
|
62
|
+
// On Orientation change, scroll to first page of list
|
|
63
|
+
React.useEffect(() => {
|
|
64
|
+
if (screenshareTilesAvailable) {
|
|
65
|
+
screenshareTilesFlatlistRef.current?.scrollToOffset({ offset: 0, animated: false });
|
|
66
|
+
}
|
|
67
|
+
}, [screenshareTilesAvailable, isLandscapeOrientation]);
|
|
68
|
+
|
|
69
|
+
// On Orientation change, scroll to first page of list
|
|
70
|
+
React.useEffect(() => {
|
|
71
|
+
if (regularTilesAvailable) {
|
|
72
|
+
regularTilesFlatlistRef.current?.scrollToOffset({ offset: 0, animated: false });
|
|
73
|
+
}
|
|
74
|
+
}, [regularTilesAvailable, isLandscapeOrientation]);
|
|
75
|
+
|
|
55
76
|
const miniviewPeerTrackNodeExists = useSelector(
|
|
56
77
|
(state: RootState) => !!state.app.miniviewPeerTrackNode
|
|
57
78
|
);
|
|
@@ -105,7 +126,10 @@ export const GridView = React.forwardRef<GridViewRefAttrs, GridViewProps>(
|
|
|
105
126
|
|
|
106
127
|
const _handleLayoutChange = React.useCallback(
|
|
107
128
|
({ nativeEvent }: LayoutChangeEvent) => {
|
|
108
|
-
setInsetTileBoundingBox({
|
|
129
|
+
setInsetTileBoundingBox({
|
|
130
|
+
width: nativeEvent.layout.width,
|
|
131
|
+
height: nativeEvent.layout.height,
|
|
132
|
+
});
|
|
109
133
|
},
|
|
110
134
|
[]
|
|
111
135
|
);
|
|
@@ -180,6 +204,8 @@ const RegularTiles = React.forwardRef<
|
|
|
180
204
|
RegularTilesProps
|
|
181
205
|
>(({ pairedPeers, onPeerTileMorePress, setHmsViewRefs }, flatlistRef) => {
|
|
182
206
|
const dispatch = useDispatch();
|
|
207
|
+
const { height: safeHeight } = useSafeAreaFrame();
|
|
208
|
+
|
|
183
209
|
const screenshareTilesAvailable = useSelector(
|
|
184
210
|
(state: RootState) => state.app.screensharePeerTrackNodes.length > 0
|
|
185
211
|
);
|
|
@@ -223,6 +249,7 @@ const RegularTiles = React.forwardRef<
|
|
|
223
249
|
<FlatList
|
|
224
250
|
ref={flatlistRef}
|
|
225
251
|
horizontal={true}
|
|
252
|
+
style={Platform.OS === 'ios' ? {maxHeight: (safeHeight - 16)} : null}
|
|
226
253
|
data={pairedPeers}
|
|
227
254
|
initialNumToRender={1}
|
|
228
255
|
maxToRenderPerBatch={1}
|
|
@@ -17,7 +17,7 @@ export const HLSFooter: React.FC<HLSFooterProps> = ({ offset }) => {
|
|
|
17
17
|
|
|
18
18
|
return (
|
|
19
19
|
<AnimatedHLSFooter offset={offset} style={styles.animatedContainer}>
|
|
20
|
-
{overlayChatVisible ? <HLSChatView /> : null}
|
|
20
|
+
{overlayChatVisible ? <HLSChatView offset={offset} /> : null}
|
|
21
21
|
|
|
22
22
|
<HMSNotifications />
|
|
23
23
|
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
HMSHLSPlayer,
|
|
7
7
|
HMSHLSPlayerPlaybackState,
|
|
8
8
|
useHMSHLSPlayerPlaybackState,
|
|
9
|
+
HMSStreamingState,
|
|
9
10
|
} from '@100mslive/react-native-hms';
|
|
10
11
|
|
|
11
12
|
import type { RootState } from '../redux';
|
|
@@ -128,7 +129,7 @@ export const _HLSView: React.FC = () => {
|
|
|
128
129
|
|
|
129
130
|
return (
|
|
130
131
|
<View style={styles.hlsView}>
|
|
131
|
-
{room?.hlsStreamingState?.
|
|
132
|
+
{room?.hlsStreamingState?.state === HMSStreamingState.STARTED ? (
|
|
132
133
|
room?.hlsStreamingState?.variants?.slice(0, 1)?.map((variant, index) =>
|
|
133
134
|
variant?.hlsStreamUrl ? (
|
|
134
135
|
<View key={index} style={styles.hlsPlayerContainer}>
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
import Animated,
|
|
4
|
-
// useAnimatedKeyboard,
|
|
5
|
-
// useAnimatedStyle,
|
|
6
|
-
// useDerivedValue,
|
|
7
|
-
} from 'react-native-reanimated';
|
|
3
|
+
import Animated from 'react-native-reanimated'; // useDerivedValue, // useAnimatedStyle, // useAnimatedKeyboard,
|
|
8
4
|
|
|
9
5
|
export interface HMSKeyboardAvoidingViewProps {
|
|
10
6
|
style?: StyleProp<Animated.AnimateStyle<StyleProp<ViewStyle>>>;
|
|
@@ -5,18 +5,21 @@ import Animated, {
|
|
|
5
5
|
useAnimatedStyle,
|
|
6
6
|
useDerivedValue,
|
|
7
7
|
} from 'react-native-reanimated';
|
|
8
|
+
import type { SharedValue } from 'react-native-reanimated';
|
|
8
9
|
|
|
9
10
|
export interface HMSKeyboardAvoidingViewProps {
|
|
10
11
|
style?: StyleProp<Animated.AnimateStyle<StyleProp<ViewStyle>>>;
|
|
11
|
-
bottomOffset?: number
|
|
12
|
+
bottomOffset?: number | SharedValue<number>;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
export const HMSKeyboardAvoidingView: React.FC<
|
|
15
16
|
HMSKeyboardAvoidingViewProps
|
|
16
|
-
> = ({ children, style, bottomOffset=0 }) => {
|
|
17
|
+
> = ({ children, style, bottomOffset = 0 }) => {
|
|
17
18
|
const animatedKeyboard = useAnimatedKeyboard();
|
|
18
19
|
|
|
19
|
-
const initialPageY = useDerivedValue(() =>
|
|
20
|
+
const initialPageY = useDerivedValue(() => {
|
|
21
|
+
return typeof bottomOffset === 'number' ? bottomOffset : bottomOffset.value;
|
|
22
|
+
}, [bottomOffset]);
|
|
20
23
|
|
|
21
24
|
const keyboardAvoidStyle = useAnimatedStyle(() => {
|
|
22
25
|
const keyboardHeight = animatedKeyboard.height.value;
|
|
@@ -4,27 +4,18 @@ import {
|
|
|
4
4
|
View,
|
|
5
5
|
Text,
|
|
6
6
|
Platform,
|
|
7
|
-
TouchableOpacity,
|
|
8
7
|
} from 'react-native';
|
|
9
8
|
import { useSelector } from 'react-redux';
|
|
9
|
+
import { HMSStreamingState } from '@100mslive/react-native-hms';
|
|
10
10
|
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
useIsHLSViewer,
|
|
14
|
-
useShowChatAndParticipants,
|
|
15
|
-
} from '../hooks-util';
|
|
16
|
-
import { EyeIcon } from '../Icons';
|
|
17
|
-
import { COLORS, hexToRgbA } from '../utils/theme';
|
|
11
|
+
import { useHMSRoomStyleSheet } from '../hooks-util';
|
|
12
|
+
import { COLORS } from '../utils/theme';
|
|
18
13
|
import type { RootState } from '../redux';
|
|
19
14
|
import { TestIds } from '../utils/constants';
|
|
20
15
|
|
|
21
16
|
const _HMSLiveIndicator = () => {
|
|
22
|
-
const isHLSViewer = useIsHLSViewer();
|
|
23
|
-
const previewPeerCount = useSelector(
|
|
24
|
-
(state: RootState) => state.hmsStates.room?.peerCount
|
|
25
|
-
);
|
|
26
17
|
const live = useSelector(
|
|
27
|
-
(state: RootState) =>
|
|
18
|
+
(state: RootState) => state.hmsStates.room?.hlsStreamingState?.state === HMSStreamingState.STARTED
|
|
28
19
|
);
|
|
29
20
|
|
|
30
21
|
const hmsRoomStyles = useHMSRoomStyleSheet((theme, typograhy) => ({
|
|
@@ -35,51 +26,15 @@ const _HMSLiveIndicator = () => {
|
|
|
35
26
|
color: COLORS.WHITE,
|
|
36
27
|
fontFamily: `${typograhy.font_family}-SemiBold`,
|
|
37
28
|
},
|
|
38
|
-
viewers: {
|
|
39
|
-
backgroundColor: isHLSViewer
|
|
40
|
-
? theme.palette.background_dim &&
|
|
41
|
-
hexToRgbA(theme.palette.background_dim, 0.64)
|
|
42
|
-
: undefined,
|
|
43
|
-
borderWidth: isHLSViewer ? 0 : 1,
|
|
44
|
-
borderColor: theme.palette.border_bright,
|
|
45
|
-
},
|
|
46
|
-
count: {
|
|
47
|
-
color: theme.palette.on_surface_high,
|
|
48
|
-
fontFamily: `${typograhy.font_family}-SemiBold`,
|
|
49
|
-
},
|
|
50
29
|
}));
|
|
51
30
|
|
|
52
|
-
const { canShowParticipants, show } = useShowChatAndParticipants();
|
|
53
|
-
|
|
54
|
-
const showParticipantsSheet = () => {
|
|
55
|
-
show('participants');
|
|
56
|
-
};
|
|
57
|
-
|
|
58
31
|
if (!live) {
|
|
59
32
|
return null;
|
|
60
33
|
}
|
|
61
34
|
|
|
62
35
|
return (
|
|
63
|
-
<View style={styles.
|
|
64
|
-
{
|
|
65
|
-
<View style={[styles.live, hmsRoomStyles.live]}>
|
|
66
|
-
<Text testID={TestIds.live_text} style={[styles.liveText, hmsRoomStyles.liveText]}>LIVE</Text>
|
|
67
|
-
</View>
|
|
68
|
-
|
|
69
|
-
{/* Viewer Count */}
|
|
70
|
-
{typeof previewPeerCount === 'number' ? (
|
|
71
|
-
<TouchableOpacity
|
|
72
|
-
style={[styles.viewers, hmsRoomStyles.viewers]}
|
|
73
|
-
onPress={showParticipantsSheet}
|
|
74
|
-
disabled={!canShowParticipants}
|
|
75
|
-
>
|
|
76
|
-
<EyeIcon testID={TestIds.peer_count_icon} />
|
|
77
|
-
|
|
78
|
-
<Text testID={TestIds.peer_count} style={[styles.count, hmsRoomStyles.count]}>
|
|
79
|
-
{previewPeerCount}
|
|
80
|
-
</Text>
|
|
81
|
-
</TouchableOpacity>
|
|
82
|
-
) : null}
|
|
36
|
+
<View style={[styles.live, hmsRoomStyles.live]}>
|
|
37
|
+
<Text testID={TestIds.live_text} style={[styles.liveText, hmsRoomStyles.liveText]}>LIVE</Text>
|
|
83
38
|
</View>
|
|
84
39
|
);
|
|
85
40
|
};
|
|
@@ -87,13 +42,11 @@ const _HMSLiveIndicator = () => {
|
|
|
87
42
|
export const HMSLiveIndicator = React.memo(_HMSLiveIndicator);
|
|
88
43
|
|
|
89
44
|
const styles = StyleSheet.create({
|
|
90
|
-
container: {
|
|
91
|
-
flexDirection: 'row',
|
|
92
|
-
},
|
|
93
45
|
live: {
|
|
94
46
|
paddingHorizontal: 8,
|
|
95
|
-
paddingVertical:
|
|
47
|
+
paddingVertical: 6,
|
|
96
48
|
borderRadius: 4,
|
|
49
|
+
marginRight: 8,
|
|
97
50
|
alignItems: 'center',
|
|
98
51
|
justifyContent: 'center',
|
|
99
52
|
},
|
|
@@ -104,22 +57,4 @@ const styles = StyleSheet.create({
|
|
|
104
57
|
textAlign: 'center',
|
|
105
58
|
textAlignVertical: 'center',
|
|
106
59
|
},
|
|
107
|
-
viewers: {
|
|
108
|
-
flexDirection: 'row',
|
|
109
|
-
alignItems: 'center',
|
|
110
|
-
paddingVertical: 4,
|
|
111
|
-
paddingRight: 8,
|
|
112
|
-
paddingLeft: 6,
|
|
113
|
-
marginLeft: 8,
|
|
114
|
-
borderRadius: 4,
|
|
115
|
-
},
|
|
116
|
-
count: {
|
|
117
|
-
fontSize: 10,
|
|
118
|
-
lineHeight: Platform.OS === 'android' ? 16 : undefined,
|
|
119
|
-
letterSpacing: 1.5,
|
|
120
|
-
textAlign: 'center',
|
|
121
|
-
textAlignVertical: 'center',
|
|
122
|
-
|
|
123
|
-
marginLeft: 4,
|
|
124
|
-
},
|
|
125
60
|
});
|