@100mslive/react-native-room-kit 1.0.1 → 1.0.2-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/HMSPrebuilt.js +16 -14
- package/lib/commonjs/HMSPrebuilt.js.map +1 -1
- package/lib/commonjs/HMSRoomSetup.js +85 -44
- package/lib/commonjs/HMSRoomSetup.js.map +1 -1
- package/lib/commonjs/Icons/Hand/assets/hand-off.png +0 -0
- package/lib/commonjs/Icons/Hand/assets/hand-off@2x.png +0 -0
- package/lib/commonjs/Icons/Hand/assets/hand-off@3x.png +0 -0
- package/lib/commonjs/Icons/Hand/index.js +2 -1
- package/lib/commonjs/Icons/Hand/index.js.map +1 -1
- package/lib/commonjs/Icons/Recording/assets/recording-off.png +0 -0
- package/lib/commonjs/Icons/Recording/assets/recording-off@2x.png +0 -0
- package/lib/commonjs/Icons/Recording/assets/recording-off@3x.png +0 -0
- package/lib/commonjs/Icons/Recording/index.js +2 -1
- package/lib/commonjs/Icons/Recording/index.js.map +1 -1
- package/lib/commonjs/components/DisplayView.js +3 -1
- package/lib/commonjs/components/DisplayView.js.map +1 -1
- package/lib/commonjs/components/EndRoomModal.js +29 -0
- package/lib/commonjs/components/EndRoomModal.js.map +1 -0
- package/lib/commonjs/components/EndRoomModalContent.js +9 -2
- package/lib/commonjs/components/EndRoomModalContent.js.map +1 -1
- package/lib/commonjs/components/Footer.js +9 -1
- package/lib/commonjs/components/Footer.js.map +1 -1
- package/lib/commonjs/components/HMSKeyboardAvoidingView.js +3 -18
- package/lib/commonjs/components/HMSKeyboardAvoidingView.js.map +1 -1
- package/lib/commonjs/components/HMSLocalScreenshareNotification.js +2 -2
- package/lib/commonjs/components/HMSLocalScreenshareNotification.js.map +1 -1
- package/lib/commonjs/components/HMSManageLeave.js +3 -178
- package/lib/commonjs/components/HMSManageLeave.js.map +1 -1
- package/lib/commonjs/components/HMSNotification.js +4 -3
- package/lib/commonjs/components/HMSNotification.js.map +1 -1
- package/lib/commonjs/components/HMSNotifications.js +32 -6
- package/lib/commonjs/components/HMSNotifications.js.map +1 -1
- package/lib/commonjs/components/HMSOverlayChatView.js +7 -1
- package/lib/commonjs/components/HMSOverlayChatView.js.map +1 -1
- package/lib/commonjs/components/HMSReconnectingNotification.js +33 -0
- package/lib/commonjs/components/HMSReconnectingNotification.js.map +1 -0
- package/lib/commonjs/components/HMSRecordingIndicator.js +1 -1
- package/lib/commonjs/components/HMSRecordingIndicator.js.map +1 -1
- package/lib/commonjs/components/HMSTerminalErrorNotification.js +66 -0
- package/lib/commonjs/components/HMSTerminalErrorNotification.js.map +1 -0
- package/lib/commonjs/components/LeaveRoomBottomSheet.js +175 -0
- package/lib/commonjs/components/LeaveRoomBottomSheet.js.map +1 -0
- package/lib/commonjs/components/Meeting.js +4 -0
- package/lib/commonjs/components/Meeting.js.map +1 -1
- package/lib/commonjs/components/MeetingScreenContent.js +3 -2
- package/lib/commonjs/components/MeetingScreenContent.js.map +1 -1
- package/lib/commonjs/components/PIPView.js +80 -15
- package/lib/commonjs/components/PIPView.js.map +1 -1
- package/lib/commonjs/components/Participants/ParticipantsItemOptions.js +23 -1
- package/lib/commonjs/components/Participants/ParticipantsItemOptions.js.map +1 -1
- package/lib/commonjs/components/PeerVideoTile/AvatarView.js +4 -4
- package/lib/commonjs/components/PeerVideoTile/PeerAudioIndicator.js +3 -1
- package/lib/commonjs/components/PeerVideoTile/PeerAudioIndicator.js.map +1 -1
- package/lib/commonjs/components/PeerVideoTile/PeerVideoTileView.js +1 -1
- package/lib/commonjs/components/PeerVideoTile/PeerVideoTileView.js.map +1 -1
- package/lib/commonjs/components/PreviewForRoleChangeModal.js +2 -2
- package/lib/commonjs/components/PreviewForRoleChangeModal.js.map +1 -1
- package/lib/commonjs/components/RoomSettingsModalContent.js +4 -7
- package/lib/commonjs/components/RoomSettingsModalContent.js.map +1 -1
- package/lib/commonjs/components/StopRecordingModalContent.js +4 -1
- package/lib/commonjs/components/StopRecordingModalContent.js.map +1 -1
- package/lib/commonjs/hooks-util.js +193 -28
- package/lib/commonjs/hooks-util.js.map +1 -1
- package/lib/commonjs/index.js +11 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/redux/actionTypes.js +6 -1
- package/lib/commonjs/redux/actionTypes.js.map +1 -1
- package/lib/commonjs/redux/actions/index.js +22 -1
- package/lib/commonjs/redux/actions/index.js.map +1 -1
- package/lib/commonjs/redux/reducers/appState.js +17 -1
- package/lib/commonjs/redux/reducers/appState.js.map +1 -1
- package/lib/commonjs/redux/reducers/hmsStates.js +15 -4
- package/lib/commonjs/redux/reducers/hmsStates.js.map +1 -1
- package/lib/commonjs/redux/reducers/userState.js +5 -1
- package/lib/commonjs/redux/reducers/userState.js.map +1 -1
- package/lib/commonjs/types.js +10 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/types.js +11 -1
- package/lib/commonjs/utils/types.js.map +1 -1
- package/lib/commonjs/utils.js +1 -7
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/module/HMSPrebuilt.js +16 -14
- package/lib/module/HMSPrebuilt.js.map +1 -1
- package/lib/module/HMSRoomSetup.js +81 -40
- package/lib/module/HMSRoomSetup.js.map +1 -1
- package/lib/module/Icons/Hand/assets/hand-off.png +0 -0
- package/lib/module/Icons/Hand/assets/hand-off@2x.png +0 -0
- package/lib/module/Icons/Hand/assets/hand-off@3x.png +0 -0
- package/lib/module/Icons/Hand/index.js +2 -1
- package/lib/module/Icons/Hand/index.js.map +1 -1
- package/lib/module/Icons/Recording/assets/recording-off.png +0 -0
- package/lib/module/Icons/Recording/assets/recording-off@2x.png +0 -0
- package/lib/module/Icons/Recording/assets/recording-off@3x.png +0 -0
- package/lib/module/Icons/Recording/index.js +2 -1
- package/lib/module/Icons/Recording/index.js.map +1 -1
- package/lib/module/components/DisplayView.js +3 -1
- package/lib/module/components/DisplayView.js.map +1 -1
- package/lib/module/components/EndRoomModal.js +20 -0
- package/lib/module/components/EndRoomModal.js.map +1 -0
- package/lib/module/components/EndRoomModalContent.js +9 -2
- package/lib/module/components/EndRoomModalContent.js.map +1 -1
- package/lib/module/components/Footer.js +9 -1
- package/lib/module/components/Footer.js.map +1 -1
- package/lib/module/components/HMSKeyboardAvoidingView.js +4 -19
- package/lib/module/components/HMSKeyboardAvoidingView.js.map +1 -1
- package/lib/module/components/HMSLocalScreenshareNotification.js +1 -1
- package/lib/module/components/HMSManageLeave.js +5 -181
- package/lib/module/components/HMSManageLeave.js.map +1 -1
- package/lib/module/components/HMSNotification.js +4 -3
- package/lib/module/components/HMSNotification.js.map +1 -1
- package/lib/module/components/HMSNotifications.js +28 -2
- package/lib/module/components/HMSNotifications.js.map +1 -1
- package/lib/module/components/HMSOverlayChatView.js +7 -1
- package/lib/module/components/HMSOverlayChatView.js.map +1 -1
- package/lib/module/components/HMSReconnectingNotification.js +24 -0
- package/lib/module/components/HMSReconnectingNotification.js.map +1 -0
- package/lib/module/components/HMSRecordingIndicator.js +1 -1
- package/lib/module/components/HMSRecordingIndicator.js.map +1 -1
- package/lib/module/components/HMSTerminalErrorNotification.js +57 -0
- package/lib/module/components/HMSTerminalErrorNotification.js.map +1 -0
- package/lib/module/components/LeaveRoomBottomSheet.js +167 -0
- package/lib/module/components/LeaveRoomBottomSheet.js.map +1 -0
- package/lib/module/components/Meeting.js +5 -1
- package/lib/module/components/Meeting.js.map +1 -1
- package/lib/module/components/MeetingScreenContent.js +3 -2
- package/lib/module/components/MeetingScreenContent.js.map +1 -1
- package/lib/module/components/PIPView.js +81 -16
- package/lib/module/components/PIPView.js.map +1 -1
- package/lib/module/components/Participants/ParticipantsItemOptions.js +24 -2
- package/lib/module/components/Participants/ParticipantsItemOptions.js.map +1 -1
- package/lib/module/components/PeerVideoTile/AvatarView.js +4 -4
- package/lib/module/components/PeerVideoTile/PeerAudioIndicator.js +3 -1
- package/lib/module/components/PeerVideoTile/PeerAudioIndicator.js.map +1 -1
- package/lib/module/components/PeerVideoTile/PeerVideoTileView.js +1 -1
- package/lib/module/components/PeerVideoTile/PeerVideoTileView.js.map +1 -1
- package/lib/module/components/PreviewForRoleChangeModal.js +1 -1
- package/lib/module/components/RoomSettingsModalContent.js +6 -9
- package/lib/module/components/RoomSettingsModalContent.js.map +1 -1
- package/lib/module/components/StopRecordingModalContent.js +4 -1
- package/lib/module/components/StopRecordingModalContent.js.map +1 -1
- package/lib/module/hooks-util.js +184 -25
- package/lib/module/hooks-util.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/redux/actionTypes.js +6 -1
- package/lib/module/redux/actionTypes.js.map +1 -1
- package/lib/module/redux/actions/index.js +18 -0
- package/lib/module/redux/actions/index.js.map +1 -1
- package/lib/module/redux/reducers/appState.js +17 -1
- package/lib/module/redux/reducers/appState.js.map +1 -1
- package/lib/module/redux/reducers/hmsStates.js +15 -4
- package/lib/module/redux/reducers/hmsStates.js.map +1 -1
- package/lib/module/redux/reducers/userState.js +5 -1
- package/lib/module/redux/reducers/userState.js.map +1 -1
- package/lib/module/types.js +9 -0
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/types.js +11 -0
- package/lib/module/utils/types.js.map +1 -1
- package/lib/module/utils.js +0 -6
- package/lib/module/utils.js.map +1 -1
- package/lib/typescript/HMSPrebuilt.d.ts +2 -16
- package/lib/typescript/HMSPrebuilt.d.ts.map +1 -1
- package/lib/typescript/HMSRoomSetup.d.ts.map +1 -1
- package/lib/typescript/Icons/Hand/index.d.ts +1 -0
- package/lib/typescript/Icons/Hand/index.d.ts.map +1 -1
- package/lib/typescript/Icons/Recording/index.d.ts +1 -0
- package/lib/typescript/Icons/Recording/index.d.ts.map +1 -1
- package/lib/typescript/components/DisplayView.d.ts.map +1 -1
- package/lib/typescript/components/EndRoomModal.d.ts +6 -0
- package/lib/typescript/components/EndRoomModal.d.ts.map +1 -0
- package/lib/typescript/components/EndRoomModalContent.d.ts.map +1 -1
- package/lib/typescript/components/Footer.d.ts +1 -0
- package/lib/typescript/components/Footer.d.ts.map +1 -1
- package/lib/typescript/components/HMSKeyboardAvoidingView.d.ts +1 -0
- package/lib/typescript/components/HMSKeyboardAvoidingView.d.ts.map +1 -1
- package/lib/typescript/components/HMSManageLeave.d.ts.map +1 -1
- package/lib/typescript/components/HMSNotification.d.ts +1 -0
- package/lib/typescript/components/HMSNotification.d.ts.map +1 -1
- package/lib/typescript/components/HMSNotifications.d.ts +1 -0
- package/lib/typescript/components/HMSNotifications.d.ts.map +1 -1
- package/lib/typescript/components/HMSOverlayChatView.d.ts.map +1 -1
- package/lib/typescript/components/HMSReconnectingNotification.d.ts +5 -0
- package/lib/typescript/components/HMSReconnectingNotification.d.ts.map +1 -0
- package/lib/typescript/components/HMSTerminalErrorNotification.d.ts +10 -0
- package/lib/typescript/components/HMSTerminalErrorNotification.d.ts.map +1 -0
- package/lib/typescript/components/LeaveRoomBottomSheet.d.ts +6 -0
- package/lib/typescript/components/LeaveRoomBottomSheet.d.ts.map +1 -0
- package/lib/typescript/components/Meeting.d.ts.map +1 -1
- package/lib/typescript/components/PIPView.d.ts.map +1 -1
- package/lib/typescript/components/Participants/ParticipantsItemOptions.d.ts.map +1 -1
- package/lib/typescript/components/PeerVideoTile/PeerAudioIndicator.d.ts.map +1 -1
- package/lib/typescript/components/PeerVideoTile/PeerVideoTileView.d.ts.map +1 -1
- package/lib/typescript/components/RoomSettingsModalContent.d.ts.map +1 -1
- package/lib/typescript/components/StopRecordingModalContent.d.ts.map +1 -1
- package/lib/typescript/hooks-util.d.ts +20 -7
- package/lib/typescript/hooks-util.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +2 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/redux/actionTypes.d.ts +3 -0
- package/lib/typescript/redux/actionTypes.d.ts.map +1 -1
- package/lib/typescript/redux/actions/index.d.ts +23 -14
- package/lib/typescript/redux/actions/index.d.ts.map +1 -1
- package/lib/typescript/redux/index.d.ts +5 -7
- package/lib/typescript/redux/index.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/appState.d.ts +4 -5
- package/lib/typescript/redux/reducers/appState.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/hmsStates.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/index.d.ts +5 -7
- 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/types.d.ts +79 -0
- package/lib/typescript/types.d.ts.map +1 -1
- package/lib/typescript/utils/types.d.ts +24 -0
- package/lib/typescript/utils/types.d.ts.map +1 -1
- package/lib/typescript/utils.d.ts +0 -5
- package/lib/typescript/utils.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/HMSPrebuilt.tsx +32 -23
- package/src/HMSRoomSetup.tsx +105 -53
- package/src/Icons/Hand/assets/hand-off.png +0 -0
- package/src/Icons/Hand/assets/hand-off@2x.png +0 -0
- package/src/Icons/Hand/assets/hand-off@3x.png +0 -0
- package/src/Icons/Hand/index.tsx +13 -3
- package/src/Icons/Recording/assets/recording-off.png +0 -0
- package/src/Icons/Recording/assets/recording-off@2x.png +0 -0
- package/src/Icons/Recording/assets/recording-off@3x.png +0 -0
- package/src/Icons/Recording/index.tsx +9 -2
- package/src/components/DisplayView.tsx +6 -0
- package/src/components/EndRoomModal.tsx +24 -0
- package/src/components/EndRoomModalContent.tsx +9 -2
- package/src/components/Footer.tsx +18 -2
- package/src/components/HMSKeyboardAvoidingView.tsx +5 -23
- package/src/components/HMSLocalScreenshareNotification.tsx +1 -1
- package/src/components/HMSManageLeave.tsx +4 -228
- package/src/components/HMSNotification.tsx +4 -2
- package/src/components/HMSNotifications.tsx +41 -7
- package/src/components/HMSOverlayChatView.tsx +6 -1
- package/src/components/HMSReconnectingNotification.tsx +27 -0
- package/src/components/HMSRecordingIndicator.tsx +1 -1
- package/src/components/HMSTerminalErrorNotification.tsx +70 -0
- package/src/components/LeaveRoomBottomSheet.tsx +199 -0
- package/src/components/Meeting.tsx +7 -0
- package/src/components/MeetingScreenContent.tsx +2 -2
- package/src/components/PIPView.tsx +113 -25
- package/src/components/Participants/ParticipantsItemOptions.tsx +26 -4
- package/src/components/PeerVideoTile/AvatarView.tsx +4 -4
- package/src/components/PeerVideoTile/PeerAudioIndicator.tsx +6 -1
- package/src/components/PeerVideoTile/PeerVideoTileView.tsx +4 -2
- package/src/components/PreviewForRoleChangeModal.tsx +1 -1
- package/src/components/RoomSettingsModalContent.tsx +5 -9
- package/src/components/StopRecordingModalContent.tsx +3 -1
- package/src/hooks-util.ts +243 -25
- package/src/index.ts +2 -0
- package/src/redux/actionTypes.ts +7 -0
- package/src/redux/actions/index.ts +19 -7
- package/src/redux/reducers/appState.ts +18 -1
- package/src/redux/reducers/hmsStates.ts +19 -7
- package/src/redux/reducers/userState.ts +7 -3
- package/src/types.ts +71 -0
- package/src/utils/types.ts +27 -0
- package/src/utils.ts +0 -6
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
|
3
|
+
import { useSelector } from 'react-redux';
|
|
4
|
+
|
|
5
|
+
import { LeaveIcon } from '../Icons';
|
|
6
|
+
import { useHMSRoomStyleSheet, useLeaveMethods, useModalType } from '../hooks-util';
|
|
7
|
+
import type { RootState } from '../redux';
|
|
8
|
+
import { BottomSheet } from './BottomSheet';
|
|
9
|
+
import { StopIcon } from '../Icons';
|
|
10
|
+
import { ModalTypes, OnLeaveReason } from '../utils/types';
|
|
11
|
+
|
|
12
|
+
// const HEADER_CONTENT_HEIGHT = 24 + 8 + 8 + 2; // ICON_SIZE + TOP_PADDING + BOTTOM_PADDING + TOP&BOTTOM_BORDER_WIDTH
|
|
13
|
+
// const HEADER_HEIGHT = 8 + HEADER_CONTENT_HEIGHT + 8; // TOP_HEADER_PADDING + HEADER_CONTENT_HEIGHT + BOTTOM_HEADER_PADDING
|
|
14
|
+
|
|
15
|
+
interface LeaveRoomBottomSheetProps {}
|
|
16
|
+
|
|
17
|
+
export const LeaveRoomBottomSheet: React.FC<LeaveRoomBottomSheetProps> = () => {
|
|
18
|
+
const canEndRoom = useSelector(
|
|
19
|
+
(state: RootState) => state.hmsStates.localPeer?.role?.permissions?.endRoom
|
|
20
|
+
);
|
|
21
|
+
const canStream = useSelector(
|
|
22
|
+
(state: RootState) =>
|
|
23
|
+
state.hmsStates.localPeer?.role?.permissions?.hlsStreaming
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
const isStreaming = useSelector(
|
|
27
|
+
(state: RootState) =>
|
|
28
|
+
state.hmsStates.room?.hlsStreamingState?.running ?? false
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
const hmsRoomStyles = useHMSRoomStyleSheet((theme, typography) => ({
|
|
32
|
+
text: {
|
|
33
|
+
color: theme.palette.on_surface_high,
|
|
34
|
+
fontFamily: `${typography.font_family}-SemiBold`,
|
|
35
|
+
},
|
|
36
|
+
subtext: {
|
|
37
|
+
color: theme.palette.on_surface_low,
|
|
38
|
+
fontFamily: `${typography.font_family}-Regular`,
|
|
39
|
+
},
|
|
40
|
+
endButton: {
|
|
41
|
+
backgroundColor: theme.palette.alert_error_dim,
|
|
42
|
+
},
|
|
43
|
+
endText: {
|
|
44
|
+
color: theme.palette.alert_error_brighter,
|
|
45
|
+
fontFamily: `${typography.font_family}-SemiBold`,
|
|
46
|
+
},
|
|
47
|
+
endSubtext: {
|
|
48
|
+
color: theme.palette.alert_error_bright,
|
|
49
|
+
fontFamily: `${typography.font_family}-Regular`,
|
|
50
|
+
},
|
|
51
|
+
endIcon: {
|
|
52
|
+
tintColor: theme.palette.alert_error_brighter,
|
|
53
|
+
},
|
|
54
|
+
}));
|
|
55
|
+
|
|
56
|
+
const leavePopCloseAction = React.useRef(ModalTypes.DEFAULT);
|
|
57
|
+
|
|
58
|
+
const { modalVisibleType, handleModalVisibleType } = useModalType();
|
|
59
|
+
|
|
60
|
+
const { leave } = useLeaveMethods();
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Closes the Leave Popup Menu
|
|
64
|
+
* No action is taken when the popup is hidden
|
|
65
|
+
*/
|
|
66
|
+
const onPopupDismiss = () => {
|
|
67
|
+
leavePopCloseAction.current = ModalTypes.DEFAULT;
|
|
68
|
+
handleModalVisibleType(ModalTypes.DEFAULT);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Closes the Leave Popup Menu
|
|
73
|
+
* Leave Modal will open after the popup is hidden
|
|
74
|
+
*/
|
|
75
|
+
const onLeavePress = async () => {
|
|
76
|
+
leavePopCloseAction.current = ModalTypes.DEFAULT;
|
|
77
|
+
handleModalVisibleType(ModalTypes.DEFAULT);
|
|
78
|
+
await leave(OnLeaveReason.LEAVE);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Closes the Leave Popup Menu
|
|
83
|
+
* End Session Modal will open after the popup is hidden
|
|
84
|
+
*/
|
|
85
|
+
const onEndSessionPress = async () => {
|
|
86
|
+
leavePopCloseAction.current = ModalTypes.END_ROOM;
|
|
87
|
+
handleModalVisibleType(ModalTypes.DEFAULT);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const onEndStreamPress = async () => {
|
|
91
|
+
leavePopCloseAction.current = ModalTypes.END_ROOM;
|
|
92
|
+
handleModalVisibleType(ModalTypes.DEFAULT);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Handles action to take when the leave popup is hidden
|
|
97
|
+
*/
|
|
98
|
+
const handlePopupHide = () => {
|
|
99
|
+
if (leavePopCloseAction.current !== ModalTypes.DEFAULT) {
|
|
100
|
+
handleModalVisibleType(leavePopCloseAction.current);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
return (
|
|
105
|
+
<BottomSheet
|
|
106
|
+
isVisible={modalVisibleType === ModalTypes.LEAVE_ROOM}
|
|
107
|
+
containerStyle={styles.container}
|
|
108
|
+
dismissModal={onPopupDismiss}
|
|
109
|
+
onModalHide={handlePopupHide}
|
|
110
|
+
animationOutTiming={700}
|
|
111
|
+
>
|
|
112
|
+
<View>
|
|
113
|
+
<TouchableOpacity
|
|
114
|
+
style={styles.button}
|
|
115
|
+
onPress={onLeavePress}
|
|
116
|
+
>
|
|
117
|
+
<LeaveIcon style={styles.icon} />
|
|
118
|
+
|
|
119
|
+
<View style={styles.textContainer}>
|
|
120
|
+
<Text style={[styles.text, hmsRoomStyles.text]}>
|
|
121
|
+
Leave
|
|
122
|
+
</Text>
|
|
123
|
+
<Text style={[styles.subtext, hmsRoomStyles.subtext]}>
|
|
124
|
+
Others will continue after you leave. You can join the session
|
|
125
|
+
again.
|
|
126
|
+
</Text>
|
|
127
|
+
</View>
|
|
128
|
+
</TouchableOpacity>
|
|
129
|
+
|
|
130
|
+
{canStream && isStreaming ? (
|
|
131
|
+
<TouchableOpacity
|
|
132
|
+
style={[styles.button, hmsRoomStyles.endButton]}
|
|
133
|
+
onPress={onEndStreamPress}
|
|
134
|
+
>
|
|
135
|
+
<StopIcon style={[styles.icon, hmsRoomStyles.endIcon]} />
|
|
136
|
+
|
|
137
|
+
<View style={styles.textContainer}>
|
|
138
|
+
<Text style={[styles.text, hmsRoomStyles.endText]}>
|
|
139
|
+
End Stream
|
|
140
|
+
</Text>
|
|
141
|
+
<Text
|
|
142
|
+
style={[styles.subtext, hmsRoomStyles.endSubtext]}
|
|
143
|
+
>
|
|
144
|
+
The stream will end for everyone after they’ve watched it.
|
|
145
|
+
</Text>
|
|
146
|
+
</View>
|
|
147
|
+
</TouchableOpacity>
|
|
148
|
+
) : canEndRoom ? (
|
|
149
|
+
<TouchableOpacity
|
|
150
|
+
style={[styles.button, hmsRoomStyles.endButton]}
|
|
151
|
+
onPress={onEndSessionPress}
|
|
152
|
+
>
|
|
153
|
+
<StopIcon style={[styles.icon, hmsRoomStyles.endIcon]} />
|
|
154
|
+
|
|
155
|
+
<View style={styles.textContainer}>
|
|
156
|
+
<Text style={[styles.text, hmsRoomStyles.endText]}>
|
|
157
|
+
End Session
|
|
158
|
+
</Text>
|
|
159
|
+
<Text
|
|
160
|
+
style={[styles.subtext, hmsRoomStyles.endSubtext]}
|
|
161
|
+
>
|
|
162
|
+
The session will end for everyone in the room immediately.
|
|
163
|
+
</Text>
|
|
164
|
+
</View>
|
|
165
|
+
</TouchableOpacity>
|
|
166
|
+
) : null}
|
|
167
|
+
</View>
|
|
168
|
+
</BottomSheet>
|
|
169
|
+
);
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
const styles = StyleSheet.create({
|
|
173
|
+
container: {
|
|
174
|
+
paddingBottom: 0,
|
|
175
|
+
},
|
|
176
|
+
button: {
|
|
177
|
+
flexDirection: 'row',
|
|
178
|
+
padding: 24,
|
|
179
|
+
},
|
|
180
|
+
icon: {
|
|
181
|
+
width: 24,
|
|
182
|
+
height: 24,
|
|
183
|
+
marginRight: 16,
|
|
184
|
+
},
|
|
185
|
+
textContainer: {
|
|
186
|
+
flex: 1,
|
|
187
|
+
},
|
|
188
|
+
text: {
|
|
189
|
+
fontSize: 20,
|
|
190
|
+
lineHeight: 24,
|
|
191
|
+
letterSpacing: 0.15,
|
|
192
|
+
},
|
|
193
|
+
subtext: {
|
|
194
|
+
fontSize: 14,
|
|
195
|
+
lineHeight: 20,
|
|
196
|
+
letterSpacing: 0.25,
|
|
197
|
+
marginTop: 4,
|
|
198
|
+
},
|
|
199
|
+
});
|
|
@@ -7,6 +7,8 @@ import type { PeerTrackNode } from '../utils/types';
|
|
|
7
7
|
import { useRTCStatsListeners } from '../utils/hooks';
|
|
8
8
|
import {
|
|
9
9
|
clearPendingModalTasks,
|
|
10
|
+
useAutoPip,
|
|
11
|
+
useBackButtonPress,
|
|
10
12
|
useFetchHMSRoles,
|
|
11
13
|
useHMSMessages,
|
|
12
14
|
useHMSNetworkQualityUpdate,
|
|
@@ -54,6 +56,11 @@ export const Meeting: React.FC<MeetingProps> = ({ peerTrackNodes }) => {
|
|
|
54
56
|
// Subscribe to Peers Network quality updates
|
|
55
57
|
useHMSNetworkQualityUpdate();
|
|
56
58
|
|
|
59
|
+
useAutoPip(peerTrackNodes.length === 1);
|
|
60
|
+
|
|
61
|
+
// Handle Back button press and show leave room modal
|
|
62
|
+
useBackButtonPress();
|
|
63
|
+
|
|
57
64
|
// Clearing any pending modal opening tasks
|
|
58
65
|
React.useEffect(() => {
|
|
59
66
|
return () => {
|
|
@@ -20,7 +20,7 @@ import { HMSStatusBar } from './StatusBar';
|
|
|
20
20
|
import { AnimatedFooter } from './AnimatedFooter';
|
|
21
21
|
import { HLSFooter } from './HLSFooter';
|
|
22
22
|
import { AnimatedHeader } from './AnimatedHeader';
|
|
23
|
-
import { ReconnectionView } from './ReconnectionView';
|
|
23
|
+
// import { ReconnectionView } from './ReconnectionView';
|
|
24
24
|
|
|
25
25
|
interface MeetingScreenContentProps {
|
|
26
26
|
peerTrackNodes: Array<PeerTrackNode>;
|
|
@@ -98,7 +98,7 @@ export const MeetingScreenContent: React.FC<MeetingScreenContentProps> = ({
|
|
|
98
98
|
|
|
99
99
|
<DisplayView offset={offset} peerTrackNodes={peerTrackNodes} />
|
|
100
100
|
|
|
101
|
-
<ReconnectionView />
|
|
101
|
+
{/* <ReconnectionView /> */}
|
|
102
102
|
</View>
|
|
103
103
|
|
|
104
104
|
{isPipModeActive ? null : isHLSViewer ? (
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { useSelector } from 'react-redux';
|
|
2
|
+
import { shallowEqual, useSelector } from 'react-redux';
|
|
3
|
+
import { View } from 'react-native';
|
|
3
4
|
|
|
4
5
|
import type { PeerTrackNode } from '../utils/types';
|
|
5
6
|
import { PeerVideoTileView } from './PeerVideoTile/PeerVideoTileView';
|
|
6
7
|
import type { RootState } from '../redux';
|
|
8
|
+
import { COLORS } from '../utils/theme';
|
|
7
9
|
|
|
8
10
|
type PIPViewProps = {
|
|
9
11
|
peerTrackNodes: PeerTrackNode[];
|
|
@@ -11,41 +13,127 @@ type PIPViewProps = {
|
|
|
11
13
|
};
|
|
12
14
|
|
|
13
15
|
const PIPView: React.FC<PIPViewProps> = ({ peerTrackNodes, customView }) => {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const dominantSpeaker = state.hmsStates.activeSpeakers[0];
|
|
18
|
-
|
|
19
|
-
return dominantSpeaker?.peer.peerID ?? null;
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
if (dominantSpeakerId) {
|
|
23
|
-
memoDominantSpeakerIdRef.current = dominantSpeakerId;
|
|
24
|
-
}
|
|
16
|
+
const firstSSNode = useSelector(
|
|
17
|
+
(state: RootState) => state.app.screensharePeerTrackNodes[0]
|
|
18
|
+
);
|
|
25
19
|
|
|
26
20
|
if (customView) {
|
|
27
21
|
return customView;
|
|
28
22
|
}
|
|
29
23
|
|
|
30
|
-
|
|
24
|
+
if (firstSSNode) {
|
|
25
|
+
return (
|
|
26
|
+
<PeerVideoTileView key={firstSSNode.id} peerTrackNode={firstSSNode} />
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return <PIPPeerTiles peerTrackNodes={peerTrackNodes} />;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export default PIPView;
|
|
34
|
+
|
|
35
|
+
type PIPPeerTilesProps = {
|
|
36
|
+
peerTrackNodes: PeerTrackNode[];
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const PIPPeerTiles: React.FC<PIPPeerTilesProps> = ({ peerTrackNodes }) => {
|
|
40
|
+
const memoDominantSpeakerIdsRef = React.useRef<string[]>([]);
|
|
41
|
+
|
|
42
|
+
const dominantSpeakerIds = useSelector((state: RootState) => {
|
|
43
|
+
return state.hmsStates.activeSpeakers
|
|
44
|
+
.slice(0, 3)
|
|
45
|
+
.map((speaker) => speaker.peer.peerID);
|
|
46
|
+
}, shallowEqual);
|
|
47
|
+
|
|
48
|
+
if (
|
|
49
|
+
dominantSpeakerIds.length > 0 &&
|
|
50
|
+
anyNewDominantSpeaker(memoDominantSpeakerIdsRef.current, dominantSpeakerIds)
|
|
51
|
+
) {
|
|
52
|
+
memoDominantSpeakerIdsRef.current = dominantSpeakerIds;
|
|
53
|
+
}
|
|
31
54
|
|
|
32
|
-
const
|
|
33
|
-
(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
55
|
+
const preferredPeerTrackNodes = React.useMemo(() => {
|
|
56
|
+
return getDominantSpeakers(
|
|
57
|
+
memoDominantSpeakerIdsRef.current,
|
|
58
|
+
peerTrackNodes
|
|
59
|
+
);
|
|
60
|
+
}, [memoDominantSpeakerIdsRef.current, peerTrackNodes]);
|
|
38
61
|
|
|
39
|
-
if (
|
|
62
|
+
if (preferredPeerTrackNodes.length === 0) {
|
|
40
63
|
return null;
|
|
41
64
|
}
|
|
42
65
|
|
|
43
66
|
return (
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
67
|
+
<View
|
|
68
|
+
style={{
|
|
69
|
+
flex: 1,
|
|
70
|
+
flexDirection: 'row',
|
|
71
|
+
backgroundColor: COLORS.BLACK,
|
|
72
|
+
}}
|
|
73
|
+
>
|
|
74
|
+
{preferredPeerTrackNodes.map((node, index, arr) => {
|
|
75
|
+
const isFirst = index === 0;
|
|
76
|
+
const dividerWidth = arr.length > 2 ? 4 : 5;
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<React.Fragment key={node.id}>
|
|
80
|
+
{isFirst ? null : (
|
|
81
|
+
<View style={{ height: '100%', width: dividerWidth }} />
|
|
82
|
+
)}
|
|
83
|
+
|
|
84
|
+
<View style={{ flex: 1 }}>
|
|
85
|
+
<PeerVideoTileView peerTrackNode={node} />
|
|
86
|
+
</View>
|
|
87
|
+
</React.Fragment>
|
|
88
|
+
);
|
|
89
|
+
})}
|
|
90
|
+
</View>
|
|
48
91
|
);
|
|
49
92
|
};
|
|
50
93
|
|
|
51
|
-
|
|
94
|
+
function anyNewDominantSpeaker(
|
|
95
|
+
oldSpeakers: string[],
|
|
96
|
+
newSpeakers: string[]
|
|
97
|
+
): boolean {
|
|
98
|
+
if (newSpeakers.length !== oldSpeakers.length) {
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const uniques = new Set([...oldSpeakers, ...newSpeakers]);
|
|
103
|
+
|
|
104
|
+
return uniques.size > oldSpeakers.length;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function getDominantSpeakers(
|
|
108
|
+
dominantSpeakerIds: string[],
|
|
109
|
+
peerTrackNodes: PeerTrackNode[]
|
|
110
|
+
): PeerTrackNode[] {
|
|
111
|
+
if (peerTrackNodes.length <= 3) {
|
|
112
|
+
return peerTrackNodes;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const list = peerTrackNodes.slice(0, 3);
|
|
116
|
+
|
|
117
|
+
let dominantSpeakerIdsCopy = dominantSpeakerIds.slice();
|
|
118
|
+
|
|
119
|
+
for (let i = 3; i < peerTrackNodes.length; i++) {
|
|
120
|
+
const peerTrackNode = peerTrackNodes[i];
|
|
121
|
+
|
|
122
|
+
if (dominantSpeakerIdsCopy.length <= 0 || !peerTrackNode) {
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (dominantSpeakerIdsCopy.includes(peerTrackNode.peer.peerID)) {
|
|
127
|
+
dominantSpeakerIdsCopy = dominantSpeakerIdsCopy.filter(
|
|
128
|
+
(speakerId) => speakerId !== peerTrackNode.peer.peerID
|
|
129
|
+
);
|
|
130
|
+
list.unshift(peerTrackNode);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (list.length > 3) {
|
|
135
|
+
list.length = 3;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return list;
|
|
139
|
+
}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
useHMSLayoutConfig,
|
|
9
9
|
useHMSRoomStyleSheet,
|
|
10
10
|
} from '../../hooks-util';
|
|
11
|
-
import { CameraIcon, MicIcon, PersonIcon } from '../../Icons';
|
|
11
|
+
import { CameraIcon, HandIcon, MicIcon, PersonIcon } from '../../Icons';
|
|
12
12
|
import { ParticipantsItemOption } from './ParticipantsItemOption';
|
|
13
13
|
import type { RootState } from '../../redux';
|
|
14
14
|
import { selectCanPublishTrackForRole } from '../../hooks-sdk-selectors';
|
|
@@ -88,6 +88,18 @@ const _ParticipantsItemOptions: React.FC<ParticipantsItemOptionsProps> = ({
|
|
|
88
88
|
onItemPress();
|
|
89
89
|
};
|
|
90
90
|
|
|
91
|
+
const handleLowerHandPress = () => {
|
|
92
|
+
if (peer.isHandRaised) {
|
|
93
|
+
hmsInstance
|
|
94
|
+
.lowerRemotePeerHand(peer)
|
|
95
|
+
.then((d) => console.log('Lower Remote Peer hand Success: ', d))
|
|
96
|
+
.catch((e) => console.log('Lower Remote Peer hand Error: ', e));
|
|
97
|
+
} else {
|
|
98
|
+
console.warn(`peer.isHandRaised = ${peer.isHandRaised} | peer's hand is not raised`);
|
|
99
|
+
}
|
|
100
|
+
onItemPress();
|
|
101
|
+
};
|
|
102
|
+
|
|
91
103
|
const handleAudioTogglePress = () => {
|
|
92
104
|
if (peer.audioTrack) {
|
|
93
105
|
hmsInstance
|
|
@@ -157,10 +169,10 @@ const _ParticipantsItemOptions: React.FC<ParticipantsItemOptionsProps> = ({
|
|
|
157
169
|
peer.videoTrack?.isMute();
|
|
158
170
|
|
|
159
171
|
const showBringOnStageOptions =
|
|
160
|
-
insideHandRaiseGroup &&
|
|
161
172
|
offStageRoles &&
|
|
162
|
-
offStageRoles.includes(peer.role?.name || '')
|
|
163
|
-
|
|
173
|
+
offStageRoles.includes(peer.role?.name || '');
|
|
174
|
+
|
|
175
|
+
const showLowerHandOption = peer.isHandRaised;
|
|
164
176
|
|
|
165
177
|
return (
|
|
166
178
|
<>
|
|
@@ -175,6 +187,16 @@ const _ParticipantsItemOptions: React.FC<ParticipantsItemOptionsProps> = ({
|
|
|
175
187
|
isActive: false,
|
|
176
188
|
hide: !showBringOnStageOptions,
|
|
177
189
|
},
|
|
190
|
+
{
|
|
191
|
+
id: 'lower-hand',
|
|
192
|
+
icon: (
|
|
193
|
+
<HandIcon type="off" style={{ width: 20, height: 20 }} />
|
|
194
|
+
),
|
|
195
|
+
label: 'Lower Hand',
|
|
196
|
+
pressHandler: handleLowerHandPress,
|
|
197
|
+
isActive: false,
|
|
198
|
+
hide: !showLowerHandOption,
|
|
199
|
+
},
|
|
178
200
|
{
|
|
179
201
|
id: 'mute-audio',
|
|
180
202
|
icon: <MicIcon muted={true} style={{ width: 20, height: 20 }} />,
|
|
@@ -93,9 +93,9 @@ const styles = StyleSheet.create({
|
|
|
93
93
|
alignItems: 'center',
|
|
94
94
|
},
|
|
95
95
|
insetAvatar: {
|
|
96
|
-
width:
|
|
96
|
+
width: 44,
|
|
97
97
|
aspectRatio: 1,
|
|
98
|
-
borderRadius:
|
|
98
|
+
borderRadius: 22,
|
|
99
99
|
justifyContent: 'center',
|
|
100
100
|
alignItems: 'center',
|
|
101
101
|
},
|
|
@@ -109,8 +109,8 @@ const styles = StyleSheet.create({
|
|
|
109
109
|
letterSpacing: 0.25,
|
|
110
110
|
},
|
|
111
111
|
insetText: {
|
|
112
|
-
fontSize:
|
|
113
|
-
lineHeight:
|
|
112
|
+
fontSize: 18,
|
|
113
|
+
lineHeight: 24,
|
|
114
114
|
},
|
|
115
115
|
});
|
|
116
116
|
|
|
@@ -7,6 +7,7 @@ import LottieView from 'lottie-react-native';
|
|
|
7
7
|
import { MicIcon } from '../../Icons';
|
|
8
8
|
import { useHMSRoomStyleSheet } from '../../hooks-util';
|
|
9
9
|
import type { RootState } from '../../redux';
|
|
10
|
+
import { PipModes } from '../../utils/types';
|
|
10
11
|
|
|
11
12
|
export interface PeerAudioIndicatorProps {
|
|
12
13
|
peer: HMSPeer;
|
|
@@ -24,6 +25,10 @@ export const PeerAudioIndicator: React.FC<PeerAudioIndicatorProps> = ({
|
|
|
24
25
|
) >= 0
|
|
25
26
|
);
|
|
26
27
|
|
|
28
|
+
const isPipModeActive = useSelector(
|
|
29
|
+
(state: RootState) => state.app.pipModeStatus === PipModes.ACTIVE
|
|
30
|
+
);
|
|
31
|
+
|
|
27
32
|
const hmsRoomStyles = useHMSRoomStyleSheet((theme) => ({
|
|
28
33
|
iconWrapper: {
|
|
29
34
|
backgroundColor: theme.palette.secondary_dim,
|
|
@@ -41,7 +46,7 @@ export const PeerAudioIndicator: React.FC<PeerAudioIndicatorProps> = ({
|
|
|
41
46
|
);
|
|
42
47
|
}
|
|
43
48
|
|
|
44
|
-
if (activeSpeaker) {
|
|
49
|
+
if (activeSpeaker && !isPipModeActive) {
|
|
45
50
|
return (
|
|
46
51
|
<View style={[styles.speakerIconWrapper, hmsRoomStyles.iconWrapper]}>
|
|
47
52
|
<LottieView
|
|
@@ -177,13 +177,15 @@ export const _PeerVideoTileView = React.forwardRef<
|
|
|
177
177
|
|
|
178
178
|
{/* Handling Peer Audio Mute indicator */}
|
|
179
179
|
{screenShareTile && showingVideoTrack ? (
|
|
180
|
-
|
|
180
|
+
isPipModeActive ? null : (
|
|
181
|
+
<HMSFullScreenButton peerTrackNode={peerTrackNode} />
|
|
182
|
+
)
|
|
181
183
|
) : peerCanPublishAudio ? (
|
|
182
184
|
<PeerAudioIndicator isMuted={peer.audioTrack?.isMute()} peer={peer} />
|
|
183
185
|
) : null}
|
|
184
186
|
|
|
185
187
|
{/* Handling showing Peer name */}
|
|
186
|
-
{
|
|
188
|
+
{insetMode || isPipModeActive ? null : (
|
|
187
189
|
<PeerNameAndNetwork
|
|
188
190
|
name={peer.name}
|
|
189
191
|
isLocal={peer.isLocal}
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
import { setRoleChangeRequest } from '../redux/actions';
|
|
18
18
|
import { useHMSActions } from '../hooks-sdk';
|
|
19
19
|
import { parseMetadata } from '../utils/functions';
|
|
20
|
-
import { NotificationTypes } from '../
|
|
20
|
+
import { NotificationTypes } from '../types';
|
|
21
21
|
import { Header } from './Header';
|
|
22
22
|
import { selectCanPublishTrackForRole } from '../hooks-sdk-selectors';
|
|
23
23
|
import { HMSPrimaryButton } from './HMSPrimaryButton';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { View, StyleSheet, Text, TouchableOpacity } from 'react-native';
|
|
3
3
|
import type { HMSAudioMixingMode } from '@100mslive/react-native-hms';
|
|
4
|
-
import {
|
|
4
|
+
import { useSelector } from 'react-redux';
|
|
5
5
|
|
|
6
6
|
import type { RootState } from '../redux';
|
|
7
7
|
import { ModalTypes } from '../utils/types';
|
|
@@ -17,14 +17,13 @@ import {
|
|
|
17
17
|
import { BottomSheet, useBottomSheetActions } from './BottomSheet';
|
|
18
18
|
import {
|
|
19
19
|
isPublishingAllowed,
|
|
20
|
-
useHMSInstance,
|
|
21
20
|
useHMSLayoutConfig,
|
|
22
21
|
useHMSRoomStyleSheet,
|
|
23
22
|
useShowChatAndParticipants,
|
|
23
|
+
useStartRecording,
|
|
24
24
|
} from '../hooks-util';
|
|
25
25
|
import { useCanPublishScreen, useHMSActions } from '../hooks-sdk';
|
|
26
26
|
import { RoomSettingsModalDebugModeContent } from './RoomSettingsModalDebugModeContent';
|
|
27
|
-
import { setStartingOrStoppingRecording } from '../redux/actions';
|
|
28
27
|
import { ParticipantsCount } from './ParticipantsCount';
|
|
29
28
|
import { selectAllowedTracksToPublish } from '../hooks-sdk-selectors';
|
|
30
29
|
|
|
@@ -45,8 +44,6 @@ export const RoomSettingsModalContent: React.FC<
|
|
|
45
44
|
> = (props) => {
|
|
46
45
|
const { closeRoomSettingsModal, setModalVisible } = props;
|
|
47
46
|
|
|
48
|
-
const dispatch = useDispatch();
|
|
49
|
-
const hmsInstance = useHMSInstance();
|
|
50
47
|
const debugMode = useSelector((state: RootState) => state.user.debugMode);
|
|
51
48
|
|
|
52
49
|
const hmsActions = useHMSActions();
|
|
@@ -134,6 +131,8 @@ export const RoomSettingsModalContent: React.FC<
|
|
|
134
131
|
(state: RootState) => !!state.hmsStates.room?.browserRecordingState?.running
|
|
135
132
|
);
|
|
136
133
|
|
|
134
|
+
const { startRecording } = useStartRecording();
|
|
135
|
+
|
|
137
136
|
const handleRecordingTogglePress = () => {
|
|
138
137
|
if (isRecordingOn) {
|
|
139
138
|
registerOnModalHideAction(() => {
|
|
@@ -141,10 +140,7 @@ export const RoomSettingsModalContent: React.FC<
|
|
|
141
140
|
});
|
|
142
141
|
closeRoomSettingsModal();
|
|
143
142
|
} else {
|
|
144
|
-
|
|
145
|
-
hmsInstance
|
|
146
|
-
.startRTMPOrRecording({ record: true })
|
|
147
|
-
.catch(() => dispatch(setStartingOrStoppingRecording(false)));
|
|
143
|
+
startRecording();
|
|
148
144
|
closeRoomSettingsModal();
|
|
149
145
|
}
|
|
150
146
|
};
|
|
@@ -18,7 +18,9 @@ export const StopRecordingModalContent: React.FC<
|
|
|
18
18
|
const dispatch = useDispatch();
|
|
19
19
|
const hmsInstance = useHMSInstance();
|
|
20
20
|
const startingOrStoppingRecording = useSelector(
|
|
21
|
-
(state: RootState) =>
|
|
21
|
+
(state: RootState) =>
|
|
22
|
+
state.app.startingOrStoppingRecording ||
|
|
23
|
+
(state.hmsStates.room?.browserRecordingState.initialising ?? false)
|
|
22
24
|
);
|
|
23
25
|
|
|
24
26
|
const hmsRoomStyles = useHMSRoomStyleSheet((theme, typography) => ({
|