@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
|
@@ -4,7 +4,11 @@ import { StyleSheet, View } from 'react-native';
|
|
|
4
4
|
import { HMSLocalScreenshareNotification } from './HMSLocalScreenshareNotification';
|
|
5
5
|
import { HMSHandRaiseNotification } from './HMSHandRaiseNotification';
|
|
6
6
|
import { HMSRoleChangeDeclinedNotification } from './HMSRoleChangeDeclinedNotification';
|
|
7
|
-
import { NotificationTypes } from '../
|
|
7
|
+
import { NotificationTypes } from '../types';
|
|
8
|
+
import { HMSTerminalErrorNotification } from './HMSTerminalErrorNotification';
|
|
9
|
+
import { HMSNotification } from './HMSNotification';
|
|
10
|
+
import { AlertTriangleIcon } from '../Icons';
|
|
11
|
+
import { HMSReconnectingNotification } from './HMSReconnectingNotification';
|
|
8
12
|
const LOCAL_SCREENSHARE_PAYLOAD = {
|
|
9
13
|
id: NotificationTypes.LOCAL_SCREENSHARE,
|
|
10
14
|
type: NotificationTypes.LOCAL_SCREENSHARE
|
|
@@ -66,7 +70,7 @@ export const HMSNotifications = () => {
|
|
|
66
70
|
}, atBottom ? null : styles.notificationWrapper, atBottom ? null : {
|
|
67
71
|
bottom: index * 16
|
|
68
72
|
}]
|
|
69
|
-
}, notification.type === NotificationTypes.LOCAL_SCREENSHARE ? /*#__PURE__*/React.createElement(HMSLocalScreenshareNotification, null) : notification.type === NotificationTypes.HAND_RAISE && 'peer' in notification ? /*#__PURE__*/React.createElement(HMSHandRaiseNotification, {
|
|
73
|
+
}, notification.type === NotificationTypes.LOCAL_SCREENSHARE ? /*#__PURE__*/React.createElement(HMSLocalScreenshareNotification, null) : notification.type === NotificationTypes.RECONNECTING ? /*#__PURE__*/React.createElement(HMSReconnectingNotification, null) : notification.type === NotificationTypes.HAND_RAISE && 'peer' in notification ? /*#__PURE__*/React.createElement(HMSHandRaiseNotification, {
|
|
70
74
|
id: notification.id,
|
|
71
75
|
peer: notification.peer,
|
|
72
76
|
autoDismiss: atTop,
|
|
@@ -76,9 +80,31 @@ export const HMSNotifications = () => {
|
|
|
76
80
|
peerName: notification.peer.name,
|
|
77
81
|
autoDismiss: atTop,
|
|
78
82
|
dismissDelay: 10000
|
|
83
|
+
}) : notification.type === NotificationTypes.TERMINAL_ERROR && 'exception' in notification ? /*#__PURE__*/React.createElement(HMSTerminalErrorNotification, {
|
|
84
|
+
id: notification.id,
|
|
85
|
+
exception: notification.exception,
|
|
86
|
+
autoDismiss: false
|
|
87
|
+
}) : notification.type === NotificationTypes.ERROR && 'message' in notification ? /*#__PURE__*/React.createElement(HMSNotification, {
|
|
88
|
+
icon: /*#__PURE__*/React.createElement(AlertTriangleIcon, {
|
|
89
|
+
type: "line"
|
|
90
|
+
}),
|
|
91
|
+
id: notification.id,
|
|
92
|
+
text: notification.message,
|
|
93
|
+
autoDismiss: false,
|
|
94
|
+
dismissable: true
|
|
79
95
|
}) : null);
|
|
80
96
|
}));
|
|
81
97
|
};
|
|
98
|
+
export const useHMSNotificationsHeight = () => {
|
|
99
|
+
const numberOfNotifications = useSelector(state => {
|
|
100
|
+
const allNotifications = state.app.notifications;
|
|
101
|
+
const isLocalScreenShared = state.hmsStates.isLocalScreenShared;
|
|
102
|
+
return Math.min(allNotifications.length, isLocalScreenShared ? 2 : 3) + (isLocalScreenShared ? 1 : 0);
|
|
103
|
+
});
|
|
104
|
+
if (numberOfNotifications === 0) return 0;
|
|
105
|
+
return 8 + (numberOfNotifications - 1) * 16 + 56; // marginBottom + calculated paddingTop + content
|
|
106
|
+
};
|
|
107
|
+
|
|
82
108
|
const styles = StyleSheet.create({
|
|
83
109
|
absoluteContainer: {
|
|
84
110
|
position: 'relative',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","shallowEqual","useSelector","StyleSheet","View","HMSLocalScreenshareNotification","HMSHandRaiseNotification","HMSRoleChangeDeclinedNotification","NotificationTypes","LOCAL_SCREENSHARE_PAYLOAD","id","LOCAL_SCREENSHARE","type","HMSNotifications","isLocalScreenShared","state","hmsStates","notifications","allNotifications","app","list","push","length","firstNotification","secondNotification","thirdNotification","createElement","style","styles","absoluteContainer","paddingTop","map","notification","index","arr","atTop","atBottom","key","transform","scale","getScale","notificationWrapper","bottom","HAND_RAISE","peer","autoDismiss","dismissDelay","ROLE_CHANGE_DECLINED","peerName","name","create","position","marginBottom","width","totalItem","current"],"sourceRoot":"../../../src","sources":["components/HMSNotifications.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,YAAY,EAAEC,WAAW,QAAQ,aAAa;AACvD,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;
|
|
1
|
+
{"version":3,"names":["React","shallowEqual","useSelector","StyleSheet","View","HMSLocalScreenshareNotification","HMSHandRaiseNotification","HMSRoleChangeDeclinedNotification","NotificationTypes","HMSTerminalErrorNotification","HMSNotification","AlertTriangleIcon","HMSReconnectingNotification","LOCAL_SCREENSHARE_PAYLOAD","id","LOCAL_SCREENSHARE","type","HMSNotifications","isLocalScreenShared","state","hmsStates","notifications","allNotifications","app","list","push","length","firstNotification","secondNotification","thirdNotification","createElement","style","styles","absoluteContainer","paddingTop","map","notification","index","arr","atTop","atBottom","key","transform","scale","getScale","notificationWrapper","bottom","RECONNECTING","HAND_RAISE","peer","autoDismiss","dismissDelay","ROLE_CHANGE_DECLINED","peerName","name","TERMINAL_ERROR","exception","ERROR","icon","text","message","dismissable","useHMSNotificationsHeight","numberOfNotifications","Math","min","create","position","marginBottom","width","totalItem","current"],"sourceRoot":"../../../src","sources":["components/HMSNotifications.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,YAAY,EAAEC,WAAW,QAAQ,aAAa;AACvD,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAG/C,SAASC,+BAA+B,QAAQ,mCAAmC;AACnF,SAASC,wBAAwB,QAAQ,4BAA4B;AACrE,SAASC,iCAAiC,QAAQ,qCAAqC;AACvF,SAASC,iBAAiB,QAAQ,UAAU;AAC5C,SAASC,4BAA4B,QAAQ,gCAAgC;AAC7E,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SAASC,iBAAiB,QAAQ,UAAU;AAC5C,SAASC,2BAA2B,QAAQ,+BAA+B;AAI3E,MAAMC,yBAAyB,GAAG;EAChCC,EAAE,EAAEN,iBAAiB,CAACO,iBAAiB;EACvCC,IAAI,EAAER,iBAAiB,CAACO;AAC1B,CAAC;AAED,OAAO,MAAME,gBAAiD,GAAGA,CAAA,KAAM;EACrE,MAAMC,mBAAmB,GAAGhB,WAAW,CACpCiB,KAAgB,IAAKA,KAAK,CAACC,SAAS,CAACF,mBACxC,CAAC;;EAED;EACA,MAAMG,aAAa,GAAGnB,WAAW,CAAEiB,KAAgB,IAAK;IACtD;IACA,MAAMG,gBAAgB,GAAGH,KAAK,CAACI,GAAG,CAACF,aAAa;IAEhD,IAAIG,IAA6B,GAAG,EAAE;IAEtC,IAAIN,mBAAmB,EAAE;MACvBM,IAAI,CAACC,IAAI,CAACZ,yBAAyB,CAAC;;MAEpC;MACA,IAAIS,gBAAgB,CAACI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CAAC,EAAE,OAAO,CAAC;EAEzC,OAAO,CAAC,GAAG,CAACA,qBAAqB,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;AACpD,CAAC;;AAED,MAAM/B,MAAM,GAAG7B,UAAU,CAAC+D,MAAM,CAAC;EAC/BjC,iBAAiB,EAAE;IACjBkC,QAAQ,EAAE,UAAU;IACpBC,YAAY,EAAE,CAAC;IACfC,KAAK,EAAE;EACT,CAAC;EACDxB,mBAAmB,EAAE;IACnBsB,QAAQ,EAAE,UAAU;IACpBE,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAEF,MAAMzB,QAAQ,GAAGA,CAAC0B,SAAiB,EAAEC,OAAe,KAAa;EAC/D,IAAID,SAAS,KAAK,CAAC,EAAE;IACnB,OAAO,CAAC;EACV;EAEA,IAAIA,SAAS,KAAK,CAAC,EAAE;IACnB,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAACC,OAAO,CAAC;EAC3B;EAEA,IAAID,SAAS,KAAK,CAAC,EAAE;IACnB,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAACC,OAAO,CAAC;EACjC;EAEA,OAAO,CAAC;AACV,CAAC"}
|
|
@@ -5,10 +5,16 @@ import MaskedView from '@react-native-masked-view/masked-view';
|
|
|
5
5
|
import { HMSKeyboardAvoidingView } from './HMSKeyboardAvoidingView';
|
|
6
6
|
import { HMSSendMessageInput } from './HMSSendMessageInput';
|
|
7
7
|
import { HMSHLSMessageList } from './HMSHLSMessageList';
|
|
8
|
+
import { useFooterHeight } from './Footer';
|
|
9
|
+
import { useHMSNotificationsHeight } from './HMSNotifications';
|
|
8
10
|
const colors = ['rgba(0, 0, 0, 0)', 'rgba(255, 255, 255, 1)', 'rgba(255, 255, 255, 1)'];
|
|
9
11
|
const colorLocations = [0, 0.4, 1];
|
|
10
12
|
export const HLSChatView = () => {
|
|
11
|
-
|
|
13
|
+
const footerHeight = useFooterHeight();
|
|
14
|
+
const hmsNotificationsHeight = useHMSNotificationsHeight();
|
|
15
|
+
return /*#__PURE__*/React.createElement(HMSKeyboardAvoidingView, {
|
|
16
|
+
bottomOffset: footerHeight + hmsNotificationsHeight
|
|
17
|
+
}, /*#__PURE__*/React.createElement(MaskedView, {
|
|
12
18
|
maskElement: /*#__PURE__*/React.createElement(LinearGradient, {
|
|
13
19
|
pointerEvents: "box-none",
|
|
14
20
|
style: StyleSheet.absoluteFill,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","StyleSheet","LinearGradient","MaskedView","HMSKeyboardAvoidingView","HMSSendMessageInput","HMSHLSMessageList","colors","colorLocations","HLSChatView","createElement","maskElement","pointerEvents","style","absoluteFill","locations"],"sourceRoot":"../../../src","sources":["components/HMSOverlayChatView.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,UAAU,QAAQ,cAAc;AACzC,OAAOC,cAAc,MAAM,8BAA8B;AACzD,OAAOC,UAAU,MAAM,uCAAuC;AAE9D,SAASC,uBAAuB,QAAQ,2BAA2B;AACnE,SAASC,mBAAmB,QAAQ,uBAAuB;AAC3D,SAASC,iBAAiB,QAAQ,qBAAqB;
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","LinearGradient","MaskedView","HMSKeyboardAvoidingView","HMSSendMessageInput","HMSHLSMessageList","useFooterHeight","useHMSNotificationsHeight","colors","colorLocations","HLSChatView","footerHeight","hmsNotificationsHeight","createElement","bottomOffset","maskElement","pointerEvents","style","absoluteFill","locations"],"sourceRoot":"../../../src","sources":["components/HMSOverlayChatView.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,UAAU,QAAQ,cAAc;AACzC,OAAOC,cAAc,MAAM,8BAA8B;AACzD,OAAOC,UAAU,MAAM,uCAAuC;AAE9D,SAASC,uBAAuB,QAAQ,2BAA2B;AACnE,SAASC,mBAAmB,QAAQ,uBAAuB;AAC3D,SAASC,iBAAiB,QAAQ,qBAAqB;AACvD,SAASC,eAAe,QAAQ,UAAU;AAC1C,SAASC,yBAAyB,QAAQ,oBAAoB;AAE9D,MAAMC,MAAM,GAAG,CACb,kBAAkB,EAClB,wBAAwB,EACxB,wBAAwB,CACzB;AACD,MAAMC,cAAc,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;AAElC,OAAO,MAAMC,WAAW,GAAGA,CAAA,KAAM;EAC/B,MAAMC,YAAY,GAAGL,eAAe,CAAC,CAAC;EACtC,MAAMM,sBAAsB,GAAGL,yBAAyB,CAAC,CAAC;EAE1D,oBACER,KAAA,CAAAc,aAAA,CAACV,uBAAuB;IAACW,YAAY,EAAEH,YAAY,GAAGC;EAAuB,gBAC3Eb,KAAA,CAAAc,aAAA,CAACX,UAAU;IACTa,WAAW,eACThB,KAAA,CAAAc,aAAA,CAACZ,cAAc;MACbe,aAAa,EAAC,UAAU;MACxBC,KAAK,EAAEjB,UAAU,CAACkB,YAAa;MAC/BV,MAAM,EAAEA,MAAO;MACfW,SAAS,EAAEV;IAAe,CAC3B;EACF,gBAEDV,KAAA,CAAAc,aAAA,CAACR,iBAAiB,MAAE,CACV,CAAC,eAEbN,KAAA,CAAAc,aAAA,CAACT,mBAAmB,MAAE,CACC,CAAC;AAE9B,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ActivityIndicator } from 'react-native';
|
|
3
|
+
import { HMSNotification } from './HMSNotification';
|
|
4
|
+
import { useHMSRoomColorPalette, useHMSRoomStyle } from '../hooks-util';
|
|
5
|
+
import { NotificationTypes } from '../types';
|
|
6
|
+
export const HMSReconnectingNotification = () => {
|
|
7
|
+
const {
|
|
8
|
+
on_surface_high: onSurfaceHigh
|
|
9
|
+
} = useHMSRoomColorPalette();
|
|
10
|
+
const notificationStyle = useHMSRoomStyle(theme => ({
|
|
11
|
+
backgroundColor: theme.palette.surface_default
|
|
12
|
+
}));
|
|
13
|
+
return /*#__PURE__*/React.createElement(HMSNotification, {
|
|
14
|
+
id: NotificationTypes.RECONNECTING,
|
|
15
|
+
autoDismiss: false,
|
|
16
|
+
style: notificationStyle,
|
|
17
|
+
text: 'You lost your network connection. Trying to reconnect.',
|
|
18
|
+
icon: /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
19
|
+
size: "small",
|
|
20
|
+
color: onSurfaceHigh
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=HMSReconnectingNotification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","ActivityIndicator","HMSNotification","useHMSRoomColorPalette","useHMSRoomStyle","NotificationTypes","HMSReconnectingNotification","on_surface_high","onSurfaceHigh","notificationStyle","theme","backgroundColor","palette","surface_default","createElement","id","RECONNECTING","autoDismiss","style","text","icon","size","color"],"sourceRoot":"../../../src","sources":["components/HMSReconnectingNotification.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,iBAAiB,QAAQ,cAAc;AAEhD,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SAASC,sBAAsB,EAAEC,eAAe,QAAQ,eAAe;AACvE,SAASC,iBAAiB,QAAQ,UAAU;AAI5C,OAAO,MAAMC,2BAEZ,GAAGA,CAAA,KAAM;EACR,MAAM;IAAEC,eAAe,EAAEC;EAAc,CAAC,GAAGL,sBAAsB,CAAC,CAAC;EACnE,MAAMM,iBAAiB,GAAGL,eAAe,CAAEM,KAAK,KAAM;IACpDC,eAAe,EAAED,KAAK,CAACE,OAAO,CAACC;EACjC,CAAC,CAAC,CAAC;EAEH,oBACEb,KAAA,CAAAc,aAAA,CAACZ,eAAe;IACda,EAAE,EAAEV,iBAAiB,CAACW,YAAa;IACnCC,WAAW,EAAE,KAAM;IACnBC,KAAK,EAAET,iBAAkB;IACzBU,IAAI,EAAE,wDAAyD;IAC/DC,IAAI,eAAEpB,KAAA,CAAAc,aAAA,CAACb,iBAAiB;MAACoB,IAAI,EAAC,OAAO;MAACC,KAAK,EAAEd;IAAc,CAAE;EAAE,CAChE,CAAC;AAEN,CAAC"}
|
|
@@ -10,7 +10,7 @@ export const HMSRecordingIndicator = () => {
|
|
|
10
10
|
});
|
|
11
11
|
const startingOrStoppingRecording = useSelector(state => {
|
|
12
12
|
var _state$hmsStates$room2;
|
|
13
|
-
return state.app.startingOrStoppingRecording || ((_state$hmsStates$room2 = state.hmsStates.room) === null || _state$hmsStates$room2 === void 0 ? void 0 : _state$hmsStates$room2.browserRecordingState.initialising);
|
|
13
|
+
return state.app.startingOrStoppingRecording || (((_state$hmsStates$room2 = state.hmsStates.room) === null || _state$hmsStates$room2 === void 0 ? void 0 : _state$hmsStates$room2.browserRecordingState.initialising) ?? false);
|
|
14
14
|
});
|
|
15
15
|
const {
|
|
16
16
|
on_surface_high: onSurfaceHighColor
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useSelector","ActivityIndicator","StyleSheet","RecordingIcon","useHMSRoomColorPalette","useHMSRoomStyle","HMSRecordingIndicator","isRecordingOn","state","_state$hmsStates$room","hmsStates","room","browserRecordingState","running","startingOrStoppingRecording","_state$hmsStates$room2","app","initialising","on_surface_high","onSurfaceHighColor","iconStyles","theme","tintColor","palette","alert_error_default","createElement","size","color","style","styles","rightSpace","icon","create","width","height","marginRight"],"sourceRoot":"../../../src","sources":["components/HMSRecordingIndicator.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,WAAW,QAAQ,aAAa;AACzC,SAASC,iBAAiB,EAAEC,UAAU,QAAQ,cAAc;AAG5D,SAASC,aAAa,QAAQ,UAAU;AACxC,SAASC,sBAAsB,EAAEC,eAAe,QAAQ,eAAe;AAEvE,OAAO,MAAMC,qBAAqB,GAAGA,CAAA,KAAM;EACzC,MAAMC,aAAa,GAAGP,WAAW,CAC9BQ,KAAgB;IAAA,IAAAC,qBAAA;IAAA,OAAK,CAAC,GAAAA,qBAAA,GAACD,KAAK,CAACE,SAAS,CAACC,IAAI,cAAAF,qBAAA,gBAAAA,qBAAA,GAApBA,qBAAA,CAAsBG,qBAAqB,cAAAH,qBAAA,eAA3CA,qBAAA,CAA6CI,OAAO;EAAA,CAC9E,CAAC;EACD,MAAMC,2BAA2B,GAAGd,WAAW,CAC5CQ,KAAgB;IAAA,IAAAO,sBAAA;IAAA,OACfP,KAAK,CAACQ,GAAG,CAACF,2BAA2B,
|
|
1
|
+
{"version":3,"names":["React","useSelector","ActivityIndicator","StyleSheet","RecordingIcon","useHMSRoomColorPalette","useHMSRoomStyle","HMSRecordingIndicator","isRecordingOn","state","_state$hmsStates$room","hmsStates","room","browserRecordingState","running","startingOrStoppingRecording","_state$hmsStates$room2","app","initialising","on_surface_high","onSurfaceHighColor","iconStyles","theme","tintColor","palette","alert_error_default","createElement","size","color","style","styles","rightSpace","icon","create","width","height","marginRight"],"sourceRoot":"../../../src","sources":["components/HMSRecordingIndicator.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,WAAW,QAAQ,aAAa;AACzC,SAASC,iBAAiB,EAAEC,UAAU,QAAQ,cAAc;AAG5D,SAASC,aAAa,QAAQ,UAAU;AACxC,SAASC,sBAAsB,EAAEC,eAAe,QAAQ,eAAe;AAEvE,OAAO,MAAMC,qBAAqB,GAAGA,CAAA,KAAM;EACzC,MAAMC,aAAa,GAAGP,WAAW,CAC9BQ,KAAgB;IAAA,IAAAC,qBAAA;IAAA,OAAK,CAAC,GAAAA,qBAAA,GAACD,KAAK,CAACE,SAAS,CAACC,IAAI,cAAAF,qBAAA,gBAAAA,qBAAA,GAApBA,qBAAA,CAAsBG,qBAAqB,cAAAH,qBAAA,eAA3CA,qBAAA,CAA6CI,OAAO;EAAA,CAC9E,CAAC;EACD,MAAMC,2BAA2B,GAAGd,WAAW,CAC5CQ,KAAgB;IAAA,IAAAO,sBAAA;IAAA,OACfP,KAAK,CAACQ,GAAG,CAACF,2BAA2B,KACpC,EAAAC,sBAAA,GAAAP,KAAK,CAACE,SAAS,CAACC,IAAI,cAAAI,sBAAA,uBAApBA,sBAAA,CAAsBH,qBAAqB,CAACK,YAAY,KAAI,KAAK,CAAC;EAAA,CACvE,CAAC;EAED,MAAM;IAAEC,eAAe,EAAEC;EAAmB,CAAC,GAAGf,sBAAsB,CAAC,CAAC;EAExE,MAAMgB,UAAU,GAAGf,eAAe,CAAEgB,KAAK,KAAM;IAC7CC,SAAS,EAAED,KAAK,CAACE,OAAO,CAACC;EAC3B,CAAC,CAAC,CAAC;EAEH,IAAIV,2BAA2B,EAAE;IAC/B,oBACEf,KAAA,CAAA0B,aAAA,CAACxB,iBAAiB;MAChByB,IAAI,EAAE,OAAQ;MACdC,KAAK,EAAER,kBAAmB;MAC1BS,KAAK,EAAEC,MAAM,CAACC;IAAW,CAC1B,CAAC;EAEN;EAEA,IAAIvB,aAAa,EAAE;IACjB,oBACER,KAAA,CAAA0B,aAAA,CAACtB,aAAa;MAACyB,KAAK,EAAE,CAACC,MAAM,CAACE,IAAI,EAAEF,MAAM,CAACC,UAAU,EAAEV,UAAU;IAAE,CAAE,CAAC;EAE1E;EAEA,OAAO,IAAI;AACb,CAAC;AAED,MAAMS,MAAM,GAAG3B,UAAU,CAAC8B,MAAM,CAAC;EAC/BD,IAAI,EAAE;IACJE,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE;EACV,CAAC;EACDJ,UAAU,EAAE;IACVK,WAAW,EAAE;EACf;AACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { StyleSheet, Text, TouchableOpacity } from 'react-native';
|
|
3
|
+
import { HMSNotification } from './HMSNotification';
|
|
4
|
+
import { AlertTriangleIcon } from '../Icons';
|
|
5
|
+
import { useHMSRoomStyleSheet, useLeaveMethods } from '../hooks-util';
|
|
6
|
+
import { OnLeaveReason } from '../utils/types';
|
|
7
|
+
import { COLORS } from '../utils/theme';
|
|
8
|
+
export const HMSTerminalErrorNotification = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
id,
|
|
11
|
+
exception,
|
|
12
|
+
autoDismiss,
|
|
13
|
+
dismissDelay
|
|
14
|
+
} = _ref;
|
|
15
|
+
const {
|
|
16
|
+
leave
|
|
17
|
+
} = useLeaveMethods();
|
|
18
|
+
const hmsRoomStyles = useHMSRoomStyleSheet((theme, typography) => ({
|
|
19
|
+
button: {
|
|
20
|
+
backgroundColor: theme.palette.alert_error_default
|
|
21
|
+
},
|
|
22
|
+
buttonText: {
|
|
23
|
+
color: COLORS.WHITE,
|
|
24
|
+
fontFamily: `${typography.font_family}-SemiBold`
|
|
25
|
+
}
|
|
26
|
+
}));
|
|
27
|
+
const handleLeaveRoomPress = () => {
|
|
28
|
+
leave(OnLeaveReason.NETWORK_ISSUES);
|
|
29
|
+
};
|
|
30
|
+
return /*#__PURE__*/React.createElement(HMSNotification, {
|
|
31
|
+
id: id,
|
|
32
|
+
icon: /*#__PURE__*/React.createElement(AlertTriangleIcon, null),
|
|
33
|
+
text: exception.description || 'Something went wrong!',
|
|
34
|
+
dismissDelay: dismissDelay,
|
|
35
|
+
autoDismiss: autoDismiss,
|
|
36
|
+
cta: /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
37
|
+
style: [styles.button, hmsRoomStyles.button],
|
|
38
|
+
onPress: handleLeaveRoomPress
|
|
39
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
40
|
+
style: [styles.buttonText, hmsRoomStyles.buttonText]
|
|
41
|
+
}, "Leave"))
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
const styles = StyleSheet.create({
|
|
45
|
+
button: {
|
|
46
|
+
paddingVertical: 8,
|
|
47
|
+
paddingHorizontal: 16,
|
|
48
|
+
borderRadius: 8,
|
|
49
|
+
marginRight: 16
|
|
50
|
+
},
|
|
51
|
+
buttonText: {
|
|
52
|
+
fontSize: 14,
|
|
53
|
+
lineHeight: 20,
|
|
54
|
+
letterSpacing: 0.25
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
//# sourceMappingURL=HMSTerminalErrorNotification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","Text","TouchableOpacity","HMSNotification","AlertTriangleIcon","useHMSRoomStyleSheet","useLeaveMethods","OnLeaveReason","COLORS","HMSTerminalErrorNotification","_ref","id","exception","autoDismiss","dismissDelay","leave","hmsRoomStyles","theme","typography","button","backgroundColor","palette","alert_error_default","buttonText","color","WHITE","fontFamily","font_family","handleLeaveRoomPress","NETWORK_ISSUES","createElement","icon","text","description","cta","style","styles","onPress","create","paddingVertical","paddingHorizontal","borderRadius","marginRight","fontSize","lineHeight","letterSpacing"],"sourceRoot":"../../../src","sources":["components/HMSTerminalErrorNotification.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,UAAU,EAAEC,IAAI,EAAEC,gBAAgB,QAAQ,cAAc;AAEjE,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SAASC,iBAAiB,QAAQ,UAAU;AAC5C,SAASC,oBAAoB,EAAEC,eAAe,QAAQ,eAAe;AACrE,SAASC,aAAa,QAAQ,gBAAgB;AAC9C,SAASC,MAAM,QAAQ,gBAAgB;AASvC,OAAO,MAAMC,4BAEZ,GAAGC,IAAA,IAAkD;EAAA,IAAjD;IAAEC,EAAE;IAAEC,SAAS;IAAEC,WAAW;IAAEC;EAAa,CAAC,GAAAJ,IAAA;EAC/C,MAAM;IAAEK;EAAM,CAAC,GAAGT,eAAe,CAAC,CAAC;EAEnC,MAAMU,aAAa,GAAGX,oBAAoB,CAAC,CAACY,KAAK,EAAEC,UAAU,MAAM;IACjEC,MAAM,EAAE;MACNC,eAAe,EAAEH,KAAK,CAACI,OAAO,CAACC;IACjC,CAAC;IACDC,UAAU,EAAE;MACVC,KAAK,EAAEhB,MAAM,CAACiB,KAAK;MACnBC,UAAU,EAAG,GAAER,UAAU,CAACS,WAAY;IACxC;EACF,CAAC,CAAC,CAAC;EAEH,MAAMC,oBAAoB,GAAGA,CAAA,KAAM;IACjCb,KAAK,CAACR,aAAa,CAACsB,cAAc,CAAC;EACrC,CAAC;EAED,oBACE9B,KAAA,CAAA+B,aAAA,CAAC3B,eAAe;IACdQ,EAAE,EAAEA,EAAG;IACPoB,IAAI,eAAEhC,KAAA,CAAA+B,aAAA,CAAC1B,iBAAiB,MAAE,CAAE;IAC5B4B,IAAI,EAAEpB,SAAS,CAACqB,WAAW,IAAI,uBAAwB;IACvDnB,YAAY,EAAEA,YAAa;IAC3BD,WAAW,EAAEA,WAAY;IACzBqB,GAAG,eACDnC,KAAA,CAAA+B,aAAA,CAAC5B,gBAAgB;MACfiC,KAAK,EAAE,CAACC,MAAM,CAACjB,MAAM,EAAEH,aAAa,CAACG,MAAM,CAAE;MAC7CkB,OAAO,EAAET;IAAqB,gBAE9B7B,KAAA,CAAA+B,aAAA,CAAC7B,IAAI;MAACkC,KAAK,EAAE,CAACC,MAAM,CAACb,UAAU,EAAEP,aAAa,CAACO,UAAU;IAAE,GAAC,OAEtD,CACU;EAClB,CACH,CAAC;AAEN,CAAC;AAED,MAAMa,MAAM,GAAGpC,UAAU,CAACsC,MAAM,CAAC;EAC/BnB,MAAM,EAAE;IACNoB,eAAe,EAAE,CAAC;IAClBC,iBAAiB,EAAE,EAAE;IACrBC,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE;EACf,CAAC;EACDnB,UAAU,EAAE;IACVoB,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
|
3
|
+
import { useSelector } from 'react-redux';
|
|
4
|
+
import { LeaveIcon } from '../Icons';
|
|
5
|
+
import { useHMSRoomStyleSheet, useLeaveMethods, useModalType } from '../hooks-util';
|
|
6
|
+
import { BottomSheet } from './BottomSheet';
|
|
7
|
+
import { StopIcon } from '../Icons';
|
|
8
|
+
import { ModalTypes, OnLeaveReason } from '../utils/types';
|
|
9
|
+
|
|
10
|
+
// const HEADER_CONTENT_HEIGHT = 24 + 8 + 8 + 2; // ICON_SIZE + TOP_PADDING + BOTTOM_PADDING + TOP&BOTTOM_BORDER_WIDTH
|
|
11
|
+
// const HEADER_HEIGHT = 8 + HEADER_CONTENT_HEIGHT + 8; // TOP_HEADER_PADDING + HEADER_CONTENT_HEIGHT + BOTTOM_HEADER_PADDING
|
|
12
|
+
export const LeaveRoomBottomSheet = () => {
|
|
13
|
+
const canEndRoom = useSelector(state => {
|
|
14
|
+
var _state$hmsStates$loca;
|
|
15
|
+
return (_state$hmsStates$loca = state.hmsStates.localPeer) === null || _state$hmsStates$loca === void 0 || (_state$hmsStates$loca = _state$hmsStates$loca.role) === null || _state$hmsStates$loca === void 0 || (_state$hmsStates$loca = _state$hmsStates$loca.permissions) === null || _state$hmsStates$loca === void 0 ? void 0 : _state$hmsStates$loca.endRoom;
|
|
16
|
+
});
|
|
17
|
+
const canStream = useSelector(state => {
|
|
18
|
+
var _state$hmsStates$loca2;
|
|
19
|
+
return (_state$hmsStates$loca2 = state.hmsStates.localPeer) === null || _state$hmsStates$loca2 === void 0 || (_state$hmsStates$loca2 = _state$hmsStates$loca2.role) === null || _state$hmsStates$loca2 === void 0 || (_state$hmsStates$loca2 = _state$hmsStates$loca2.permissions) === null || _state$hmsStates$loca2 === void 0 ? void 0 : _state$hmsStates$loca2.hlsStreaming;
|
|
20
|
+
});
|
|
21
|
+
const isStreaming = useSelector(state => {
|
|
22
|
+
var _state$hmsStates$room;
|
|
23
|
+
return ((_state$hmsStates$room = state.hmsStates.room) === null || _state$hmsStates$room === void 0 || (_state$hmsStates$room = _state$hmsStates$room.hlsStreamingState) === null || _state$hmsStates$room === void 0 ? void 0 : _state$hmsStates$room.running) ?? false;
|
|
24
|
+
});
|
|
25
|
+
const hmsRoomStyles = useHMSRoomStyleSheet((theme, typography) => ({
|
|
26
|
+
text: {
|
|
27
|
+
color: theme.palette.on_surface_high,
|
|
28
|
+
fontFamily: `${typography.font_family}-SemiBold`
|
|
29
|
+
},
|
|
30
|
+
subtext: {
|
|
31
|
+
color: theme.palette.on_surface_low,
|
|
32
|
+
fontFamily: `${typography.font_family}-Regular`
|
|
33
|
+
},
|
|
34
|
+
endButton: {
|
|
35
|
+
backgroundColor: theme.palette.alert_error_dim
|
|
36
|
+
},
|
|
37
|
+
endText: {
|
|
38
|
+
color: theme.palette.alert_error_brighter,
|
|
39
|
+
fontFamily: `${typography.font_family}-SemiBold`
|
|
40
|
+
},
|
|
41
|
+
endSubtext: {
|
|
42
|
+
color: theme.palette.alert_error_bright,
|
|
43
|
+
fontFamily: `${typography.font_family}-Regular`
|
|
44
|
+
},
|
|
45
|
+
endIcon: {
|
|
46
|
+
tintColor: theme.palette.alert_error_brighter
|
|
47
|
+
}
|
|
48
|
+
}));
|
|
49
|
+
const leavePopCloseAction = React.useRef(ModalTypes.DEFAULT);
|
|
50
|
+
const {
|
|
51
|
+
modalVisibleType,
|
|
52
|
+
handleModalVisibleType
|
|
53
|
+
} = useModalType();
|
|
54
|
+
const {
|
|
55
|
+
leave
|
|
56
|
+
} = useLeaveMethods();
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Closes the Leave Popup Menu
|
|
60
|
+
* No action is taken when the popup is hidden
|
|
61
|
+
*/
|
|
62
|
+
const onPopupDismiss = () => {
|
|
63
|
+
leavePopCloseAction.current = ModalTypes.DEFAULT;
|
|
64
|
+
handleModalVisibleType(ModalTypes.DEFAULT);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Closes the Leave Popup Menu
|
|
69
|
+
* Leave Modal will open after the popup is hidden
|
|
70
|
+
*/
|
|
71
|
+
const onLeavePress = async () => {
|
|
72
|
+
leavePopCloseAction.current = ModalTypes.DEFAULT;
|
|
73
|
+
handleModalVisibleType(ModalTypes.DEFAULT);
|
|
74
|
+
await leave(OnLeaveReason.LEAVE);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Closes the Leave Popup Menu
|
|
79
|
+
* End Session Modal will open after the popup is hidden
|
|
80
|
+
*/
|
|
81
|
+
const onEndSessionPress = async () => {
|
|
82
|
+
leavePopCloseAction.current = ModalTypes.END_ROOM;
|
|
83
|
+
handleModalVisibleType(ModalTypes.DEFAULT);
|
|
84
|
+
};
|
|
85
|
+
const onEndStreamPress = async () => {
|
|
86
|
+
leavePopCloseAction.current = ModalTypes.END_ROOM;
|
|
87
|
+
handleModalVisibleType(ModalTypes.DEFAULT);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Handles action to take when the leave popup is hidden
|
|
92
|
+
*/
|
|
93
|
+
const handlePopupHide = () => {
|
|
94
|
+
if (leavePopCloseAction.current !== ModalTypes.DEFAULT) {
|
|
95
|
+
handleModalVisibleType(leavePopCloseAction.current);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
return /*#__PURE__*/React.createElement(BottomSheet, {
|
|
99
|
+
isVisible: modalVisibleType === ModalTypes.LEAVE_ROOM,
|
|
100
|
+
containerStyle: styles.container,
|
|
101
|
+
dismissModal: onPopupDismiss,
|
|
102
|
+
onModalHide: handlePopupHide,
|
|
103
|
+
animationOutTiming: 700
|
|
104
|
+
}, /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
105
|
+
style: styles.button,
|
|
106
|
+
onPress: onLeavePress
|
|
107
|
+
}, /*#__PURE__*/React.createElement(LeaveIcon, {
|
|
108
|
+
style: styles.icon
|
|
109
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
110
|
+
style: styles.textContainer
|
|
111
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
112
|
+
style: [styles.text, hmsRoomStyles.text]
|
|
113
|
+
}, "Leave"), /*#__PURE__*/React.createElement(Text, {
|
|
114
|
+
style: [styles.subtext, hmsRoomStyles.subtext]
|
|
115
|
+
}, "Others will continue after you leave. You can join the session again."))), canStream && isStreaming ? /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
116
|
+
style: [styles.button, hmsRoomStyles.endButton],
|
|
117
|
+
onPress: onEndStreamPress
|
|
118
|
+
}, /*#__PURE__*/React.createElement(StopIcon, {
|
|
119
|
+
style: [styles.icon, hmsRoomStyles.endIcon]
|
|
120
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
121
|
+
style: styles.textContainer
|
|
122
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
123
|
+
style: [styles.text, hmsRoomStyles.endText]
|
|
124
|
+
}, "End Stream"), /*#__PURE__*/React.createElement(Text, {
|
|
125
|
+
style: [styles.subtext, hmsRoomStyles.endSubtext]
|
|
126
|
+
}, "The stream will end for everyone after they\u2019ve watched it."))) : canEndRoom ? /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
127
|
+
style: [styles.button, hmsRoomStyles.endButton],
|
|
128
|
+
onPress: onEndSessionPress
|
|
129
|
+
}, /*#__PURE__*/React.createElement(StopIcon, {
|
|
130
|
+
style: [styles.icon, hmsRoomStyles.endIcon]
|
|
131
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
132
|
+
style: styles.textContainer
|
|
133
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
134
|
+
style: [styles.text, hmsRoomStyles.endText]
|
|
135
|
+
}, "End Session"), /*#__PURE__*/React.createElement(Text, {
|
|
136
|
+
style: [styles.subtext, hmsRoomStyles.endSubtext]
|
|
137
|
+
}, "The session will end for everyone in the room immediately."))) : null));
|
|
138
|
+
};
|
|
139
|
+
const styles = StyleSheet.create({
|
|
140
|
+
container: {
|
|
141
|
+
paddingBottom: 0
|
|
142
|
+
},
|
|
143
|
+
button: {
|
|
144
|
+
flexDirection: 'row',
|
|
145
|
+
padding: 24
|
|
146
|
+
},
|
|
147
|
+
icon: {
|
|
148
|
+
width: 24,
|
|
149
|
+
height: 24,
|
|
150
|
+
marginRight: 16
|
|
151
|
+
},
|
|
152
|
+
textContainer: {
|
|
153
|
+
flex: 1
|
|
154
|
+
},
|
|
155
|
+
text: {
|
|
156
|
+
fontSize: 20,
|
|
157
|
+
lineHeight: 24,
|
|
158
|
+
letterSpacing: 0.15
|
|
159
|
+
},
|
|
160
|
+
subtext: {
|
|
161
|
+
fontSize: 14,
|
|
162
|
+
lineHeight: 20,
|
|
163
|
+
letterSpacing: 0.25,
|
|
164
|
+
marginTop: 4
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
//# sourceMappingURL=LeaveRoomBottomSheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","Text","TouchableOpacity","View","useSelector","LeaveIcon","useHMSRoomStyleSheet","useLeaveMethods","useModalType","BottomSheet","StopIcon","ModalTypes","OnLeaveReason","LeaveRoomBottomSheet","canEndRoom","state","_state$hmsStates$loca","hmsStates","localPeer","role","permissions","endRoom","canStream","_state$hmsStates$loca2","hlsStreaming","isStreaming","_state$hmsStates$room","room","hlsStreamingState","running","hmsRoomStyles","theme","typography","text","color","palette","on_surface_high","fontFamily","font_family","subtext","on_surface_low","endButton","backgroundColor","alert_error_dim","endText","alert_error_brighter","endSubtext","alert_error_bright","endIcon","tintColor","leavePopCloseAction","useRef","DEFAULT","modalVisibleType","handleModalVisibleType","leave","onPopupDismiss","current","onLeavePress","LEAVE","onEndSessionPress","END_ROOM","onEndStreamPress","handlePopupHide","createElement","isVisible","LEAVE_ROOM","containerStyle","styles","container","dismissModal","onModalHide","animationOutTiming","style","button","onPress","icon","textContainer","create","paddingBottom","flexDirection","padding","width","height","marginRight","flex","fontSize","lineHeight","letterSpacing","marginTop"],"sourceRoot":"../../../src","sources":["components/LeaveRoomBottomSheet.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAA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AACtD,QAAQ;IAAC+D,KAAK,EAAE,CAACL,MAAM,CAACQ,IAAI,EAAE9C,aAAa,CAACkB,OAAO;EAAE,CAAE,CAAC,eAEzDjD,KAAA,CAAAiE,aAAA,CAAC7D,IAAI;IAACsE,KAAK,EAAEL,MAAM,CAACS;EAAc,gBAChC9E,KAAA,CAAAiE,aAAA,CAAC/D,IAAI;IAACwE,KAAK,EAAE,CAACL,MAAM,CAACnC,IAAI,EAAEH,aAAa,CAACc,OAAO;EAAE,GAAC,aAE7C,CAAC,eACP7C,KAAA,CAAAiE,aAAA,CAAC/D,IAAI;IACHwE,KAAK,EAAE,CAACL,MAAM,CAAC7B,OAAO,EAAET,aAAa,CAACgB,UAAU;EAAE,GACnD,4DAEK,CACF,CACU,CAAC,GACjB,IACA,CACK,CAAC;AAElB,CAAC;AAED,MAAMsB,MAAM,GAAGpE,UAAU,CAAC8E,MAAM,CAAC;EAC/BT,SAAS,EAAE;IACTU,aAAa,EAAE;EACjB,CAAC;EACDL,MAAM,EAAE;IACNM,aAAa,EAAE,KAAK;IACpBC,OAAO,EAAE;EACX,CAAC;EACDL,IAAI,EAAE;IACJM,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVC,WAAW,EAAE;EACf,CAAC;EACDP,aAAa,EAAE;IACbQ,IAAI,EAAE;EACR,CAAC;EACDpD,IAAI,EAAE;IACJqD,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdC,aAAa,EAAE;EACjB,CAAC;EACDjD,OAAO,EAAE;IACP+C,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdC,aAAa,EAAE,IAAI;IACnBC,SAAS,EAAE;EACb;AACF,CAAC,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { StyleSheet, View } from 'react-native';
|
|
|
3
3
|
import { useSelector } from 'react-redux';
|
|
4
4
|
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
5
5
|
import { useRTCStatsListeners } from '../utils/hooks';
|
|
6
|
-
import { clearPendingModalTasks, useFetchHMSRoles, useHMSMessages, useHMSNetworkQualityUpdate, useHMSPIPRoomLeave, useHMSReconnection, useHMSRemovedFromRoomUpdate, useHMSRoomStyle, useIsHLSViewer, usePIPListener } from '../hooks-util';
|
|
6
|
+
import { clearPendingModalTasks, useAutoPip, useBackButtonPress, useFetchHMSRoles, useHMSMessages, useHMSNetworkQualityUpdate, useHMSPIPRoomLeave, useHMSReconnection, useHMSRemovedFromRoomUpdate, useHMSRoomStyle, useIsHLSViewer, usePIPListener } from '../hooks-util';
|
|
7
7
|
import { MeetingScreenContent } from './MeetingScreenContent';
|
|
8
8
|
import { HMSHLSStreamLoading } from './HMSHLSStreamLoading';
|
|
9
9
|
export const Meeting = _ref => {
|
|
@@ -31,6 +31,10 @@ export const Meeting = _ref => {
|
|
|
31
31
|
|
|
32
32
|
// Subscribe to Peers Network quality updates
|
|
33
33
|
useHMSNetworkQualityUpdate();
|
|
34
|
+
useAutoPip(peerTrackNodes.length === 1);
|
|
35
|
+
|
|
36
|
+
// Handle Back button press and show leave room modal
|
|
37
|
+
useBackButtonPress();
|
|
34
38
|
|
|
35
39
|
// Clearing any pending modal opening tasks
|
|
36
40
|
React.useEffect(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","StyleSheet","View","useSelector","SafeAreaView","useRTCStatsListeners","clearPendingModalTasks","useFetchHMSRoles","useHMSMessages","useHMSNetworkQualityUpdate","useHMSPIPRoomLeave","useHMSReconnection","useHMSRemovedFromRoomUpdate","useHMSRoomStyle","useIsHLSViewer","usePIPListener","MeetingScreenContent","HMSHLSStreamLoading","Meeting","_ref","peerTrackNodes","startingHLSStream","state","app","isHLSViewer","useEffect","containerStyles","theme","backgroundColor","palette","background_dim","createElement","Container","style","styles","container","edges","create","flex","flexDirection"],"sourceRoot":"../../../src","sources":["components/Meeting.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,SAASC,WAAW,QAAQ,aAAa;AACzC,SAASC,YAAY,QAAQ,gCAAgC;AAG7D,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SACEC,sBAAsB,EACtBC,gBAAgB,EAChBC,cAAc,EACdC,0BAA0B,EAC1BC,kBAAkB,EAClBC,kBAAkB,EAClBC,2BAA2B,EAC3BC,eAAe,EACfC,cAAc,EACdC,cAAc,QACT,eAAe;AACtB,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,mBAAmB,QAAQ,uBAAuB;AAO3D,OAAO,MAAMC,OAA+B,GAAGC,IAAA,IAAwB;EAAA,IAAvB;IAAEC;EAAe,CAAC,GAAAD,IAAA;EAChE,MAAME,iBAAiB,
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","View","useSelector","SafeAreaView","useRTCStatsListeners","clearPendingModalTasks","useAutoPip","useBackButtonPress","useFetchHMSRoles","useHMSMessages","useHMSNetworkQualityUpdate","useHMSPIPRoomLeave","useHMSReconnection","useHMSRemovedFromRoomUpdate","useHMSRoomStyle","useIsHLSViewer","usePIPListener","MeetingScreenContent","HMSHLSStreamLoading","Meeting","_ref","peerTrackNodes","startingHLSStream","state","app","isHLSViewer","length","useEffect","containerStyles","theme","backgroundColor","palette","background_dim","createElement","Container","style","styles","container","edges","create","flex","flexDirection"],"sourceRoot":"../../../src","sources":["components/Meeting.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,SAASC,WAAW,QAAQ,aAAa;AACzC,SAASC,YAAY,QAAQ,gCAAgC;AAG7D,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SACEC,sBAAsB,EACtBC,UAAU,EACVC,kBAAkB,EAClBC,gBAAgB,EAChBC,cAAc,EACdC,0BAA0B,EAC1BC,kBAAkB,EAClBC,kBAAkB,EAClBC,2BAA2B,EAC3BC,eAAe,EAC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Ae,CAAE;IAC3CU,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO;EAAE,gBAEzBvC,KAAA,CAAAkC,aAAA,CAAChB,oBAAoB;IAACI,cAAc,EAAEA;EAAe,CAAE,CAG9C,CAAC;AAEhB,CAAC;AAED,MAAMe,MAAM,GAAGpC,UAAU,CAACuC,MAAM,CAAC;EAC/BF,SAAS,EAAE;IACTG,IAAI,EAAE,CAAC;IACPC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC"}
|
|
@@ -11,7 +11,8 @@ import { HMSStatusBar } from './StatusBar';
|
|
|
11
11
|
import { AnimatedFooter } from './AnimatedFooter';
|
|
12
12
|
import { HLSFooter } from './HLSFooter';
|
|
13
13
|
import { AnimatedHeader } from './AnimatedHeader';
|
|
14
|
-
import { ReconnectionView } from './ReconnectionView';
|
|
14
|
+
// import { ReconnectionView } from './ReconnectionView';
|
|
15
|
+
|
|
15
16
|
export const MeetingScreenContent = _ref => {
|
|
16
17
|
let {
|
|
17
18
|
peerTrackNodes
|
|
@@ -82,7 +83,7 @@ export const MeetingScreenContent = _ref => {
|
|
|
82
83
|
})), /*#__PURE__*/React.createElement(DisplayView, {
|
|
83
84
|
offset: offset,
|
|
84
85
|
peerTrackNodes: peerTrackNodes
|
|
85
|
-
})
|
|
86
|
+
})), isPipModeActive ? null : isHLSViewer ? /*#__PURE__*/React.createElement(HLSFooter, {
|
|
86
87
|
offset: offset
|
|
87
88
|
}) : /*#__PURE__*/React.createElement(AnimatedFooter, {
|
|
88
89
|
offset: offset
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useRef","useState","StyleSheet","Pressable","View","useSelector","Easing","cancelAnimation","runOnJS","useSharedValue","withTiming","PipModes","Footer","DisplayView","Header","useIsHLSViewer","HMSStatusBar","AnimatedFooter","HLSFooter","AnimatedHeader","
|
|
1
|
+
{"version":3,"names":["React","useCallback","useRef","useState","StyleSheet","Pressable","View","useSelector","Easing","cancelAnimation","runOnJS","useSharedValue","withTiming","PipModes","Footer","DisplayView","Header","useIsHLSViewer","HMSStatusBar","AnimatedFooter","HLSFooter","AnimatedHeader","MeetingScreenContent","_ref","peerTrackNodes","offset","isHLSViewer","timerIdRef","controlsHidden","setControlsHidden","isPipModeActive","state","app","pipModeStatus","ACTIVE","toggleControls","current","clearTimeout","value","duration","easing","ease","finished","createElement","onPress","style","styles","container","disabled","hidden","barStyle","reconnectionWrapper","transparent","showControls","create","flex","position","takeLessSpaceAsItCan"],"sourceRoot":"../../../src","sources":["components/MeetingScreenContent.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC5D,SAASC,UAAU,EAAEC,SAAS,EAAEC,IAAI,QAAQ,cAAc;AAC1D,SAASC,WAAW,QAAQ,aAAa;AACzC,SACEC,MAAM,EACNC,eAAe,EACfC,OAAO,EACPC,cAAc,EACdC,UAAU,QACL,yBAAyB;AAEhC,SAASC,QAAQ,QAAQ,gBAAgB;AAGzC,SAASC,MAAM,QAAQ,UAAU;AACjC,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,MAAM,QAAQ,UAAU;AACjC,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,YAAY,QAAQ,aAAa;AAC1C,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,cAAc,QAAQ,kBAAkB;AACjD;;AAMA,OAAO,MAAMC,oBAAyD,GAAGC,IAAA,IAEnE;EAAA,IAFoE;IACxEC;EACF,CAAC,GAAAD,IAAA;EACC,MAAME,MAAM,GAAGd,cAAc,CAAC,CAAC,CAAC;EAChC,MAAMe,WAAW,GAAGT,cAAc,CAAC,CAAC;EACpC,MAAMU,UAAU,GAAGzB,MAAM,CAAwB,IAAI,CAAC;EACtD,MAAM,CAAC0B,cAAc,EAAEC,iBAAiB,CAAC,GAAG1B,QAAQ,CAAC,KAAK,CAAC;EAC3D,MAAM2B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,EAAEA;EAAO,gBAC7BzB,KAAA,CAAA2C,aAAA,CAAC3B,MAAM;IAACoC,WAAW,EAAE1B,WAAY;IAAC2B,YAAY,EAAE,CAAC3B;EAAY,CAAE,CACjD,CACjB,eAED1B,KAAA,CAAA2C,aAAA,CAAC5B,WAAW;IAACU,MAAM,EAAEA,MAAO;IAACD,cAAc,EAAEA;EAAe,CAAE,CAG1D,CAAC,EAENM,eAAe,GAAG,IAAI,GAAGJ,WAAW,gBACnC1B,KAAA,CAAA2C,aAAA,CAACvB,SAAS;IAACK,MAAM,EAAEA;EAAO,CAAE,CAAC,gBAE7BzB,KAAA,CAAA2C,aAAA,CAACxB,cAAc;IAACM,MAAM,EAAEA;EAAO,gBAC7BzB,KAAA,CAAA2C,aAAA,CAAC7B,MAAM,MAAE,CACK,CAET,CAAC;AAEhB,CAAC;AAED,MAAMgC,MAAM,GAAG1C,UAAU,CAACkD,MAAM,CAAC;EAC/BP,SAAS,EAAE;IACTQ,IAAI,EAAE,CAAC;IACPC,QAAQ,EAAE;EACZ,CAAC;EACDC,oBAAoB,EAAE;IACpBF,IAAI,EAAE;EACR,CAAC;EACDJ,mBAAmB,EAAE;IACnBI,IAAI,EAAE;EACR;AACF,CAAC,CAAC"}
|
|
@@ -1,31 +1,96 @@
|
|
|
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
|
import { PeerVideoTileView } from './PeerVideoTile/PeerVideoTileView';
|
|
5
|
+
import { COLORS } from '../utils/theme';
|
|
4
6
|
const PIPView = _ref => {
|
|
5
7
|
let {
|
|
6
8
|
peerTrackNodes,
|
|
7
9
|
customView
|
|
8
10
|
} = _ref;
|
|
9
|
-
const
|
|
10
|
-
const dominantSpeakerId = useSelector(state => {
|
|
11
|
-
const dominantSpeaker = state.hmsStates.activeSpeakers[0];
|
|
12
|
-
return (dominantSpeaker === null || dominantSpeaker === void 0 ? void 0 : dominantSpeaker.peer.peerID) ?? null;
|
|
13
|
-
});
|
|
14
|
-
if (dominantSpeakerId) {
|
|
15
|
-
memoDominantSpeakerIdRef.current = dominantSpeakerId;
|
|
16
|
-
}
|
|
11
|
+
const firstSSNode = useSelector(state => state.app.screensharePeerTrackNodes[0]);
|
|
17
12
|
if (customView) {
|
|
18
13
|
return customView;
|
|
19
14
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
if (firstSSNode) {
|
|
16
|
+
return /*#__PURE__*/React.createElement(PeerVideoTileView, {
|
|
17
|
+
key: firstSSNode.id,
|
|
18
|
+
peerTrackNode: firstSSNode
|
|
19
|
+
});
|
|
24
20
|
}
|
|
25
|
-
return /*#__PURE__*/React.createElement(
|
|
26
|
-
|
|
27
|
-
peerTrackNode: preferedPeerTrack
|
|
21
|
+
return /*#__PURE__*/React.createElement(PIPPeerTiles, {
|
|
22
|
+
peerTrackNodes: peerTrackNodes
|
|
28
23
|
});
|
|
29
24
|
};
|
|
30
25
|
export default PIPView;
|
|
26
|
+
const PIPPeerTiles = _ref2 => {
|
|
27
|
+
let {
|
|
28
|
+
peerTrackNodes
|
|
29
|
+
} = _ref2;
|
|
30
|
+
const memoDominantSpeakerIdsRef = React.useRef([]);
|
|
31
|
+
const dominantSpeakerIds = useSelector(state => {
|
|
32
|
+
return state.hmsStates.activeSpeakers.slice(0, 3).map(speaker => speaker.peer.peerID);
|
|
33
|
+
}, shallowEqual);
|
|
34
|
+
if (dominantSpeakerIds.length > 0 && anyNewDominantSpeaker(memoDominantSpeakerIdsRef.current, dominantSpeakerIds)) {
|
|
35
|
+
memoDominantSpeakerIdsRef.current = dominantSpeakerIds;
|
|
36
|
+
}
|
|
37
|
+
const preferredPeerTrackNodes = React.useMemo(() => {
|
|
38
|
+
return getDominantSpeakers(memoDominantSpeakerIdsRef.current, peerTrackNodes);
|
|
39
|
+
}, [memoDominantSpeakerIdsRef.current, peerTrackNodes]);
|
|
40
|
+
if (preferredPeerTrackNodes.length === 0) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
44
|
+
style: {
|
|
45
|
+
flex: 1,
|
|
46
|
+
flexDirection: 'row',
|
|
47
|
+
backgroundColor: COLORS.BLACK
|
|
48
|
+
}
|
|
49
|
+
}, preferredPeerTrackNodes.map((node, index, arr) => {
|
|
50
|
+
const isFirst = index === 0;
|
|
51
|
+
const dividerWidth = arr.length > 2 ? 4 : 5;
|
|
52
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
53
|
+
key: node.id
|
|
54
|
+
}, isFirst ? null : /*#__PURE__*/React.createElement(View, {
|
|
55
|
+
style: {
|
|
56
|
+
height: '100%',
|
|
57
|
+
width: dividerWidth
|
|
58
|
+
}
|
|
59
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
60
|
+
style: {
|
|
61
|
+
flex: 1
|
|
62
|
+
}
|
|
63
|
+
}, /*#__PURE__*/React.createElement(PeerVideoTileView, {
|
|
64
|
+
peerTrackNode: node
|
|
65
|
+
})));
|
|
66
|
+
}));
|
|
67
|
+
};
|
|
68
|
+
function anyNewDominantSpeaker(oldSpeakers, newSpeakers) {
|
|
69
|
+
if (newSpeakers.length !== oldSpeakers.length) {
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
const uniques = new Set([...oldSpeakers, ...newSpeakers]);
|
|
73
|
+
return uniques.size > oldSpeakers.length;
|
|
74
|
+
}
|
|
75
|
+
function getDominantSpeakers(dominantSpeakerIds, peerTrackNodes) {
|
|
76
|
+
if (peerTrackNodes.length <= 3) {
|
|
77
|
+
return peerTrackNodes;
|
|
78
|
+
}
|
|
79
|
+
const list = peerTrackNodes.slice(0, 3);
|
|
80
|
+
let dominantSpeakerIdsCopy = dominantSpeakerIds.slice();
|
|
81
|
+
for (let i = 3; i < peerTrackNodes.length; i++) {
|
|
82
|
+
const peerTrackNode = peerTrackNodes[i];
|
|
83
|
+
if (dominantSpeakerIdsCopy.length <= 0 || !peerTrackNode) {
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
if (dominantSpeakerIdsCopy.includes(peerTrackNode.peer.peerID)) {
|
|
87
|
+
dominantSpeakerIdsCopy = dominantSpeakerIdsCopy.filter(speakerId => speakerId !== peerTrackNode.peer.peerID);
|
|
88
|
+
list.unshift(peerTrackNode);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (list.length > 3) {
|
|
92
|
+
list.length = 3;
|
|
93
|
+
}
|
|
94
|
+
return list;
|
|
95
|
+
}
|
|
31
96
|
//# sourceMappingURL=PIPView.js.map
|