@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
|
@@ -19,7 +19,10 @@ const StopRecordingModalContent = _ref => {
|
|
|
19
19
|
} = _ref;
|
|
20
20
|
const dispatch = (0, _reactRedux.useDispatch)();
|
|
21
21
|
const hmsInstance = (0, _hooksUtil.useHMSInstance)();
|
|
22
|
-
const startingOrStoppingRecording = (0, _reactRedux.useSelector)(state =>
|
|
22
|
+
const startingOrStoppingRecording = (0, _reactRedux.useSelector)(state => {
|
|
23
|
+
var _state$hmsStates$room;
|
|
24
|
+
return state.app.startingOrStoppingRecording || (((_state$hmsStates$room = state.hmsStates.room) === null || _state$hmsStates$room === void 0 ? void 0 : _state$hmsStates$room.browserRecordingState.initialising) ?? false);
|
|
25
|
+
});
|
|
23
26
|
const hmsRoomStyles = (0, _hooksUtil.useHMSRoomStyleSheet)((theme, typography) => ({
|
|
24
27
|
headerText: {
|
|
25
28
|
color: theme.palette.alert_error_default,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","_interopRequireWildcard","require","_reactRedux","_reactNative","_hooksUtil","_Icons","_HMSDangerButton","_actions","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","StopRecordingModalContent","_ref","dismissModal","dispatch","useDispatch","hmsInstance","useHMSInstance","startingOrStoppingRecording","useSelector","state","app","hmsRoomStyles","useHMSRoomStyleSheet","theme","typography","headerText","color","palette","alert_error_default","fontFamily","font_family","text","on_surface_medium","stopRecording","setStartingOrStoppingRecording","stopRtmpAndRecording","error","createElement","View","style","styles","container","header","headerControls","AlertTriangleIcon","Text","TouchableOpacity","onPress","hitSlop","closeIconHitSlop","CloseIcon","HMSDangerButton","loading","title","disabled","exports","StyleSheet","create","marginTop","marginHorizontal","flexDirection","alignItems","justifyContent","marginBottom","fontSize","lineHeight","letterSpacing","marginLeft","bottom","left","right","top"],"sourceRoot":"../../../src","sources":["components/StopRecordingModalContent.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAGA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAAkE,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAc,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAI,CAAA,IAAAV,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAgB,GAAA,CAAAnB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAM3D,MAAMY,yBAEZ,GAAGC,IAAA,IAAsB;EAAA,IAArB;IAAEC;EAAa,CAAC,GAAAD,IAAA;EACnB,MAAME,QAAQ,GAAG,IAAAC,uBAAW,EAAC,CAAC;EAC9B,MAAMC,WAAW,GAAG,IAAAC,yBAAc,EAAC,CAAC;EACpC,MAAMC,2BAA2B,GAAG,IAAAC,uBAAW,EAC5CC,KAAgB,
|
|
1
|
+
{"version":3,"names":["React","_interopRequireWildcard","require","_reactRedux","_reactNative","_hooksUtil","_Icons","_HMSDangerButton","_actions","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","StopRecordingModalContent","_ref","dismissModal","dispatch","useDispatch","hmsInstance","useHMSInstance","startingOrStoppingRecording","useSelector","state","_state$hmsStates$room","app","hmsStates","room","browserRecordingState","initialising","hmsRoomStyles","useHMSRoomStyleSheet","theme","typography","headerText","color","palette","alert_error_default","fontFamily","font_family","text","on_surface_medium","stopRecording","setStartingOrStoppingRecording","stopRtmpAndRecording","error","createElement","View","style","styles","container","header","headerControls","AlertTriangleIcon","Text","TouchableOpacity","onPress","hitSlop","closeIconHitSlop","CloseIcon","HMSDangerButton","loading","title","disabled","exports","StyleSheet","create","marginTop","marginHorizontal","flexDirection","alignItems","justifyContent","marginBottom","fontSize","lineHeight","letterSpacing","marginLeft","bottom","left","right","top"],"sourceRoot":"../../../src","sources":["components/StopRecordingModalContent.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAGA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAAkE,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAc,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAI,CAAA,IAAAV,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAgB,GAAA,CAAAnB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAM3D,MAAMY,yBAEZ,GAAGC,IAAA,IAAsB;EAAA,IAArB;IAAEC;EAAa,CAAC,GAAAD,IAAA;EACnB,MAAME,QAAQ,GAAG,IAAAC,uBAAW,EAAC,CAAC;EAC9B,MAAMC,WAAW,GAAG,IAAAC,yBAAc,EAAC,CAAC;EACpC,MAAMC,2BAA2B,GAAG,IAAAC,uBAAW,EAC5CC,KAAgB;IAAA,IAAAC,qBAAA;IAAA,OACfD,KAAK,CAACE,GAAG,CAACJ,2BAA2B,KACpC,EAAAG,qBAAA,GAAAD,KAAK,CAACG,SAAS,CAACC,IAAI,cAAAH,qBAAA,uBAApBA,qBAAA,CAAsBI,qBAAqB,CAACC,YAAY,KAAI,KAAK,CAAC;EAAA,CACvE,CAAC;EAED,MAAMC,aAAa,GAAG,IAAAC,+BAAoB,EAAC,CAACC,KAAK,EAAEC,UAAU,MAAM;IACjEC,UAAU,EAAE;MACVC,KAAK,EAAEH,KAAK,CAACI,OAAO,CAACC,mBAAmB;MACxCC,UAAU,EAAG,GAAEL,UAAU,CAACM,WAAY;IACxC,CAAC;IACDC,IAAI,EAAE;MACJL,KAAK,EAAEH,KAAK,CAACI,OAAO,CAACK,iBAAiB;MACtCH,UAAU,EAAG,GAAEL,UAAU,CAACM,WAAY;IACxC;EACF,CAAC,CAAC,CAAC;EAEH,MAAMG,aAAa,GAAG,MAAAA,CAAA,KAAY;IAChCzB,QAAQ,CAAC,IAAA0B,uCAA8B,EAAC,IAAI,CAAC,CAAC;IAC9C,IAAI;MACF,MAAMxB,WAAW,CAACyB,oBAAoB,CAAC,CAAC;MACxC5B,YAAY,CAAC,CAAC;IAChB,CAAC,CAAC,OAAO6B,KAAK,EAAE;MACd5B,QAAQ,CAAC,IAAA0B,uCAA8B,EAAC,KAAK,CAAC,CAAC;IACjD;EACF,CAAC;EAED,oBACE3D,KAAA,CAAA8D,aAAA,CAAC1D,YAAA,CAAA2D,IAAI;IAACC,KAAK,EAAEC,MAAM,CAACC;EAAU,gBAC5BlE,KAAA,CAAA8D,aAAA,CAAC1D,YAAA,CAAA2D,IAAI;IAACC,KAAK,EAAEC,MAAM,CAACE;EAAO,gBACzBnE,KAAA,CAAA8D,aAAA,CAAC1D,YAAA,CAAA2D,IAAI;IAACC,KAAK,EAAEC,MAAM,CAACG;EAAe,gBACjCpE,KAAA,CAAA8D,aAAA,CAACxD,MAAA,CAAA+D,iBAAiB,MAAE,CAAC,eAErBrE,KAAA,CAAA8D,aAAA,CAAC1D,YAAA,CAAAkE,IAAI;IAACN,KAAK,EAAE,CAACC,MAAM,CAACf,UAAU,EAAEJ,aAAa,CAACI,UAAU;EAAE,GAAC,gBAEtD,CACF,CAAC,eAEPlD,KAAA,CAAA8D,aAAA,CAAC1D,YAAA,CAAAmE,gBAAgB;IACfC,OAAO,EAAExC,YAAa;IACtByC,OAAO,EAAER,MAAM,CAACS;EAAiB,gBAEjC1E,KAAA,CAAA8D,aAAA,CAACxD,MAAA,CAAAqE,SAAS,MAAE,CACI,CACd,CAAC,eAEP3E,KAAA,CAAA8D,aAAA,CAAC1D,YAAA,CAAAkE,IAAI;IAACN,KAAK,EAAE,CAACC,MAAM,CAACT,IAAI,EAAEV,aAAa,CAACU,IAAI;EAAE,GAAC,sEAE1C,CAAC,eAEPxD,KAAA,CAAA8D,aAAA,CAACvD,gBAAA,CAAAqE,eAAe;IACdC,OAAO,EAAExC,2BAA4B;IACrCmC,OAAO,EAAEd,aAAc;IACvBoB,KAAK,EAAC,gBAAgB;IACtBC,QAAQ,EAAE1C;EAA4B,CACvC,CACG,CAAC;AAEX,CAAC;AAAC2C,OAAA,CAAAlD,yBAAA,GAAAA,yBAAA;AAEF,MAAMmC,MAAM,GAAGgB,uBAAU,CAACC,MAAM,CAAC;EAC/BhB,SAAS,EAAE;IACTiB,SAAS,EAAE,EAAE;IACbC,gBAAgB,EAAE;EACpB,CAAC;EACDjB,MAAM,EAAE;IACNkB,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,eAAe;IAC/BC,YAAY,EAAE;EAChB,CAAC;EACDpB,cAAc,EAAE;IACdiB,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE;EACd,CAAC;EACDpC,UAAU,EAAE;IACVuC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdC,aAAa,EAAE,IAAI;IACnBC,UAAU,EAAE;EACd,CAAC;EACDlB,gBAAgB,EAAE;IAChBmB,MAAM,EAAE,EAAE;IACVC,IAAI,EAAE,EAAE;IACRC,KAAK,EAAE,EAAE;IACTC,GAAG,EAAE;EACP,CAAC;EACDxC,IAAI,EAAE;IACJiC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdC,aAAa,EAAE,IAAI;IACnBH,YAAY,EAAE;EAChB;AACF,CAAC,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useShowLandscapeLayout = exports.useShowChatAndParticipants = exports.useShouldGoLive = exports.useSendMessage = exports.usePortraitChatViewVisible = exports.usePIPListener = exports.useOffStageParticipants = exports.useModalType = exports.useLeaveMethods = exports.useLandscapeChatViewVisible = exports.useIsHLSViewer = exports.useHMSSessionStoreListeners = exports.useHMSSessionStore = exports.useHMSRoomTypography = exports.useHMSRoomTheme = exports.useHMSRoomStyleSheet = exports.useHMSRoomStyle = exports.useHMSRoomColorPalette = exports.useHMSRoleChangeRequest = exports.useHMSRemovedFromRoomUpdate = exports.useHMSReconnection = exports.useHMSPIPRoomLeave = exports.useHMSNetworkQualityUpdate = exports.useHMSMessages = exports.useHMSListeners = exports.useHMSLayoutConfig = exports.useHMSInstance = exports.useHMSConfig = exports.useHMSConferencingScreenConfig = exports.useHMSChatLayoutConfig = exports.useHMSChangeTrackStateRequest = exports.useHMSActiveSpeakerUpdates = exports.useFilteredParticipants = exports.useFetchHMSRoles = exports.isPublishingAllowed = exports.clearPendingModalTasks = exports.clearConfig = void 0;
|
|
6
|
+
exports.useStartRecording = exports.useShowLandscapeLayout = exports.useShowChatAndParticipants = exports.useShouldGoLive = exports.useSendMessage = exports.useSavePropsToStore = exports.usePortraitChatViewVisible = exports.usePipAspectRatio = exports.usePIPListener = exports.useOffStageParticipants = exports.useModalType = exports.useLeaveMethods = exports.useLandscapeChatViewVisible = exports.useIsHLSViewer = exports.useHMSSessionStoreListeners = exports.useHMSSessionStore = exports.useHMSRoomTypography = exports.useHMSRoomTheme = exports.useHMSRoomStyleSheet = exports.useHMSRoomStyle = exports.useHMSRoomColorPalette = exports.useHMSRoleChangeRequest = exports.useHMSRemovedFromRoomUpdate = exports.useHMSReconnection = exports.useHMSPIPRoomLeave = exports.useHMSNetworkQualityUpdate = exports.useHMSMessages = exports.useHMSListeners = exports.useHMSLayoutConfig = exports.useHMSInstance = exports.useHMSConfig = exports.useHMSConferencingScreenConfig = exports.useHMSChatLayoutConfig = exports.useHMSChangeTrackStateRequest = exports.useHMSActiveSpeakerUpdates = exports.useFilteredParticipants = exports.useFetchHMSRoles = exports.useEnableAutoPip = exports.useDisableAutoPip = exports.useBackButtonPress = exports.useAutoPip = exports.isPublishingAllowed = exports.clearPendingModalTasks = exports.clearConfig = void 0;
|
|
7
7
|
var _reactNativeHms = require("@100mslive/react-native-hms");
|
|
8
8
|
var _reactNativeSimpleToast = _interopRequireDefault(require("react-native-simple-toast"));
|
|
9
9
|
var _react = require("react");
|
|
@@ -19,7 +19,6 @@ var _dimension = require("./utils/dimension");
|
|
|
19
19
|
var _hooksUtilSelectors = require("./hooks-util-selectors");
|
|
20
20
|
var _HMSManager = require("./modules/HMSManager");
|
|
21
21
|
var _theme = require("./utils/theme");
|
|
22
|
-
var _utils = require("./utils");
|
|
23
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
23
|
const useHMSListeners = setPeerTrackNodes => {
|
|
25
24
|
const hmsInstance = useHMSInstance();
|
|
@@ -244,14 +243,14 @@ const useHMSPeersUpdate = (hmsInstance, updateLocalPeer, setPeerTrackNodes) => {
|
|
|
244
243
|
const canChangeRole = (_reduxState$hmsStates = reduxState.hmsStates.localPeer) === null || _reduxState$hmsStates === void 0 || (_reduxState$hmsStates = _reduxState$hmsStates.role) === null || _reduxState$hmsStates === void 0 || (_reduxState$hmsStates = _reduxState$hmsStates.permissions) === null || _reduxState$hmsStates === void 0 ? void 0 : _reduxState$hmsStates.changeRole;
|
|
245
244
|
if (shouldBringOnStage && canChangeRole) {
|
|
246
245
|
dispatch((0, _actions.addNotification)({
|
|
247
|
-
id: `${peer.peerID}-${
|
|
248
|
-
type:
|
|
246
|
+
id: `${peer.peerID}-${_types2.NotificationTypes.HAND_RAISE}`,
|
|
247
|
+
type: _types2.NotificationTypes.HAND_RAISE,
|
|
249
248
|
peer
|
|
250
249
|
}));
|
|
251
250
|
}
|
|
252
251
|
} else {
|
|
253
252
|
const notifications = reduxState.app.notifications;
|
|
254
|
-
const notificationToRemove = notifications.find(notification => notification.id === `${peer.peerID}-${
|
|
253
|
+
const notificationToRemove = notifications.find(notification => notification.id === `${peer.peerID}-${_types2.NotificationTypes.HAND_RAISE}`);
|
|
255
254
|
if (notificationToRemove) {
|
|
256
255
|
dispatch((0, _actions.removeNotification)(notificationToRemove.id));
|
|
257
256
|
}
|
|
@@ -808,12 +807,12 @@ const useHMSMessages = () => {
|
|
|
808
807
|
});
|
|
809
808
|
(0, _react.useEffect)(() => {
|
|
810
809
|
const onMessageListener = message => {
|
|
811
|
-
if (message.type ===
|
|
810
|
+
if (message.type === _types2.NotificationTypes.ROLE_CHANGE_DECLINED) {
|
|
812
811
|
if (canChangeRole) {
|
|
813
812
|
var _message$sender;
|
|
814
813
|
dispatch((0, _actions.addNotification)({
|
|
815
|
-
id: `${(_message$sender = message.sender) === null || _message$sender === void 0 ? void 0 : _message$sender.peerID}-${
|
|
816
|
-
type:
|
|
814
|
+
id: `${(_message$sender = message.sender) === null || _message$sender === void 0 ? void 0 : _message$sender.peerID}-${_types2.NotificationTypes.ROLE_CHANGE_DECLINED}`,
|
|
815
|
+
type: _types2.NotificationTypes.ROLE_CHANGE_DECLINED,
|
|
817
816
|
peer: message.sender
|
|
818
817
|
}));
|
|
819
818
|
}
|
|
@@ -838,12 +837,21 @@ const useHMSReconnection = () => {
|
|
|
838
837
|
let mounted = true;
|
|
839
838
|
hmsInstance.addEventListener(_reactNativeHms.HMSUpdateListenerActions.RECONNECTING, () => {
|
|
840
839
|
if (mounted) {
|
|
841
|
-
|
|
840
|
+
(0, _reactRedux.batch)(() => {
|
|
841
|
+
dispatch((0, _actions.setReconnecting)(true));
|
|
842
|
+
dispatch((0, _actions.addNotification)({
|
|
843
|
+
id: _types2.NotificationTypes.RECONNECTING,
|
|
844
|
+
type: _types2.NotificationTypes.RECONNECTING
|
|
845
|
+
}));
|
|
846
|
+
});
|
|
842
847
|
}
|
|
843
848
|
});
|
|
844
849
|
hmsInstance.addEventListener(_reactNativeHms.HMSUpdateListenerActions.RECONNECTED, () => {
|
|
845
850
|
if (mounted) {
|
|
846
|
-
|
|
851
|
+
(0, _reactRedux.batch)(() => {
|
|
852
|
+
dispatch((0, _actions.setReconnecting)(false));
|
|
853
|
+
dispatch((0, _actions.removeNotification)(_types2.NotificationTypes.RECONNECTING));
|
|
854
|
+
});
|
|
847
855
|
}
|
|
848
856
|
});
|
|
849
857
|
return () => {
|
|
@@ -858,10 +866,10 @@ const useHMSPIPRoomLeave = () => {
|
|
|
858
866
|
const hmsInstance = useHMSInstance();
|
|
859
867
|
const {
|
|
860
868
|
destroy
|
|
861
|
-
} = useLeaveMethods(
|
|
869
|
+
} = useLeaveMethods();
|
|
862
870
|
(0, _react.useEffect)(() => {
|
|
863
871
|
const pipRoomLeaveHandler = () => {
|
|
864
|
-
destroy();
|
|
872
|
+
destroy(_types.OnLeaveReason.PIP);
|
|
865
873
|
};
|
|
866
874
|
hmsInstance.addEventListener(_reactNativeHms.HMSPIPListenerActions.ON_PIP_ROOM_LEAVE, pipRoomLeaveHandler);
|
|
867
875
|
return () => {
|
|
@@ -874,10 +882,10 @@ const useHMSRemovedFromRoomUpdate = () => {
|
|
|
874
882
|
const hmsInstance = useHMSInstance();
|
|
875
883
|
const {
|
|
876
884
|
destroy
|
|
877
|
-
} = useLeaveMethods(
|
|
885
|
+
} = useLeaveMethods();
|
|
878
886
|
(0, _react.useEffect)(() => {
|
|
879
|
-
const removedFromRoomHandler =
|
|
880
|
-
destroy();
|
|
887
|
+
const removedFromRoomHandler = data => {
|
|
888
|
+
destroy(data.roomEnded ? _types.OnLeaveReason.ROOM_END : _types.OnLeaveReason.PEER_KICKED);
|
|
881
889
|
};
|
|
882
890
|
hmsInstance.addEventListener(_reactNativeHms.HMSUpdateListenerActions.ON_REMOVED_FROM_ROOM, removedFromRoomHandler);
|
|
883
891
|
return () => {
|
|
@@ -927,6 +935,75 @@ const useHMSNetworkQualityUpdate = () => {
|
|
|
927
935
|
}, [hmsInstance]);
|
|
928
936
|
};
|
|
929
937
|
exports.useHMSNetworkQualityUpdate = useHMSNetworkQualityUpdate;
|
|
938
|
+
const useEnableAutoPip = () => {
|
|
939
|
+
const hmsInstance = useHMSInstance();
|
|
940
|
+
const enableAutoPip = (0, _react.useCallback)(data => {
|
|
941
|
+
hmsInstance.setPipParams({
|
|
942
|
+
...data,
|
|
943
|
+
autoEnterPipMode: true
|
|
944
|
+
});
|
|
945
|
+
}, [hmsInstance]);
|
|
946
|
+
return enableAutoPip;
|
|
947
|
+
};
|
|
948
|
+
exports.useEnableAutoPip = useEnableAutoPip;
|
|
949
|
+
const useDisableAutoPip = () => {
|
|
950
|
+
const hmsInstance = useHMSInstance();
|
|
951
|
+
const disableAutoPip = (0, _react.useCallback)(data => {
|
|
952
|
+
hmsInstance.setPipParams({
|
|
953
|
+
...data,
|
|
954
|
+
autoEnterPipMode: false
|
|
955
|
+
});
|
|
956
|
+
}, [hmsInstance]);
|
|
957
|
+
return disableAutoPip;
|
|
958
|
+
};
|
|
959
|
+
exports.useDisableAutoPip = useDisableAutoPip;
|
|
960
|
+
const useAutoPip = oneToOneCall => {
|
|
961
|
+
const enableAutoPip = useEnableAutoPip();
|
|
962
|
+
const disableAutoPip = useDisableAutoPip();
|
|
963
|
+
const autoEnterPipMode = (0, _reactRedux.useSelector)(state => state.app.autoEnterPipMode);
|
|
964
|
+
const [numerator, denominator] = usePipAspectRatio(oneToOneCall);
|
|
965
|
+
(0, _react.useEffect)(() => {
|
|
966
|
+
if (autoEnterPipMode) {
|
|
967
|
+
enableAutoPip({
|
|
968
|
+
aspectRatio: [numerator, denominator]
|
|
969
|
+
});
|
|
970
|
+
return disableAutoPip;
|
|
971
|
+
}
|
|
972
|
+
}, [numerator, denominator, autoEnterPipMode, enableAutoPip, disableAutoPip]);
|
|
973
|
+
};
|
|
974
|
+
exports.useAutoPip = useAutoPip;
|
|
975
|
+
const usePipAspectRatio = oneToOneCall => {
|
|
976
|
+
const isHLSViewer = useIsHLSViewer();
|
|
977
|
+
const hlsPlayerResolution = (0, _reactNativeHms.useHMSHLSPlayerResolution)();
|
|
978
|
+
const firstSSNodeId = (0, _reactRedux.useSelector)(state => {
|
|
979
|
+
var _ssPeerTrackNode$trac;
|
|
980
|
+
const ssPeerTrackNode = state.app.screensharePeerTrackNodes[0];
|
|
981
|
+
return ssPeerTrackNode === null || ssPeerTrackNode === void 0 || (_ssPeerTrackNode$trac = ssPeerTrackNode.track) === null || _ssPeerTrackNode$trac === void 0 ? void 0 : _ssPeerTrackNode$trac.trackId;
|
|
982
|
+
});
|
|
983
|
+
const ssResolution = (0, _reactNativeHms.useHmsViewsResolutionsState)(firstSSNodeId);
|
|
984
|
+
const aspectRatio = (0, _react.useMemo)(() => {
|
|
985
|
+
// When user is hlsviewer and we have stream resolution
|
|
986
|
+
if (isHLSViewer && hlsPlayerResolution) {
|
|
987
|
+
return [hlsPlayerResolution.width, hlsPlayerResolution.height];
|
|
988
|
+
}
|
|
989
|
+
// When user is hlsviewer and we don't have stream resolution
|
|
990
|
+
if (isHLSViewer) {
|
|
991
|
+
return [9, 16];
|
|
992
|
+
}
|
|
993
|
+
// When we have screenshare resolution, use it
|
|
994
|
+
if (ssResolution) {
|
|
995
|
+
return [ssResolution.width, ssResolution.height];
|
|
996
|
+
}
|
|
997
|
+
// When there is no screenshare and one-to-one call is happening
|
|
998
|
+
if (!firstSSNodeId && oneToOneCall) {
|
|
999
|
+
return [9, 16];
|
|
1000
|
+
}
|
|
1001
|
+
// default aspect ratio
|
|
1002
|
+
return [16, 9];
|
|
1003
|
+
}, [isHLSViewer, firstSSNodeId, oneToOneCall, ssResolution, hlsPlayerResolution]);
|
|
1004
|
+
return aspectRatio;
|
|
1005
|
+
};
|
|
1006
|
+
exports.usePipAspectRatio = usePipAspectRatio;
|
|
930
1007
|
const useHMSActiveSpeakerUpdates = (setPeerTrackNodes, active) => {
|
|
931
1008
|
const hmsInstance = useHMSInstance();
|
|
932
1009
|
const dispatch = (0, _reactRedux.useDispatch)();
|
|
@@ -1285,7 +1362,8 @@ const useFilteredParticipants = filterText => {
|
|
|
1285
1362
|
const firstTen = filteredList.slice(0, 10);
|
|
1286
1363
|
t.push({
|
|
1287
1364
|
id: role.name,
|
|
1288
|
-
label: `${role.name} (${typeof offStageRoleTotalCount === 'number'
|
|
1365
|
+
label: `${role.name} (${typeof offStageRoleTotalCount === 'number' && offStageRoleTotalCount > filteredList.length ? offStageRoleTotalCount // only use `offStageRoleTotalCount` when it is number and more than list length
|
|
1366
|
+
: filteredList.length})`,
|
|
1289
1367
|
showViewAll: typeof offStageRoleTotalCount === 'number' && formattedSearchText.length <= 0 ? offStageRoleTotalCount > 10 : filteredList.length > 10,
|
|
1290
1368
|
data: firstTen
|
|
1291
1369
|
});
|
|
@@ -1317,12 +1395,12 @@ const useShouldGoLive = () => {
|
|
|
1317
1395
|
return shouldGoLive;
|
|
1318
1396
|
};
|
|
1319
1397
|
exports.useShouldGoLive = useShouldGoLive;
|
|
1320
|
-
const useLeaveMethods =
|
|
1398
|
+
const useLeaveMethods = () => {
|
|
1321
1399
|
const navigation = (0, _react.useContext)(_native.NavigationContext);
|
|
1322
1400
|
const hmsInstance = useHMSInstance();
|
|
1323
1401
|
const dispatch = (0, _reactRedux.useDispatch)();
|
|
1324
1402
|
const reduxStore = (0, _reactRedux.useStore)();
|
|
1325
|
-
const destroy = (0, _react.useCallback)(
|
|
1403
|
+
const destroy = (0, _react.useCallback)(reason => {
|
|
1326
1404
|
try {
|
|
1327
1405
|
const s = hmsInstance.destroy();
|
|
1328
1406
|
console.log('Destroy Success: ', s);
|
|
@@ -1348,9 +1426,9 @@ const useLeaveMethods = isUnmounted => {
|
|
|
1348
1426
|
|
|
1349
1427
|
const onLeave = reduxStore.getState().user.onLeave;
|
|
1350
1428
|
if (typeof onLeave === 'function') {
|
|
1351
|
-
onLeave();
|
|
1429
|
+
onLeave(reason);
|
|
1352
1430
|
dispatch((0, _actions.clearStore)());
|
|
1353
|
-
} else if (navigation && navigation.canGoBack
|
|
1431
|
+
} else if (navigation && typeof navigation.canGoBack === 'function' && navigation.canGoBack()) {
|
|
1354
1432
|
navigation.goBack();
|
|
1355
1433
|
dispatch((0, _actions.clearStore)());
|
|
1356
1434
|
} else {
|
|
@@ -1364,8 +1442,8 @@ const useLeaveMethods = isUnmounted => {
|
|
|
1364
1442
|
return Promise.reject(e);
|
|
1365
1443
|
}
|
|
1366
1444
|
}, [hmsInstance]);
|
|
1367
|
-
const leave = (0, _react.useCallback)(async function () {
|
|
1368
|
-
let shouldEndStream = arguments.length >
|
|
1445
|
+
const leave = (0, _react.useCallback)(async function (reason) {
|
|
1446
|
+
let shouldEndStream = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1369
1447
|
if (shouldEndStream) {
|
|
1370
1448
|
hmsInstance.stopHLSStreaming().catch(error => {
|
|
1371
1449
|
console.log('Stop HLS Streaming Error: ', error);
|
|
@@ -1374,26 +1452,26 @@ const useLeaveMethods = isUnmounted => {
|
|
|
1374
1452
|
try {
|
|
1375
1453
|
const d = await hmsInstance.leave();
|
|
1376
1454
|
console.log('Leave Success: ', d);
|
|
1377
|
-
await destroy();
|
|
1455
|
+
await destroy(reason);
|
|
1378
1456
|
} catch (e) {
|
|
1379
1457
|
console.log(`Leave Room Error: ${e}`);
|
|
1380
1458
|
_reactNativeSimpleToast.default.showWithGravity(`Leave Room Error: ${e}`, _reactNativeSimpleToast.default.LONG, _reactNativeSimpleToast.default.TOP);
|
|
1381
1459
|
}
|
|
1382
1460
|
}, [destroy, hmsInstance]);
|
|
1383
|
-
const
|
|
1461
|
+
const prebuiltCleanUp = (0, _react.useCallback)(async () => {
|
|
1384
1462
|
try {
|
|
1385
1463
|
await hmsInstance.leave();
|
|
1386
1464
|
await hmsInstance.destroy();
|
|
1387
1465
|
dispatch((0, _actions.clearStore)());
|
|
1388
1466
|
} catch (error) {
|
|
1389
|
-
_reactNativeSimpleToast.default.showWithGravity(`Unable to
|
|
1467
|
+
_reactNativeSimpleToast.default.showWithGravity(`Unable to leave or destroy: ${error}`, _reactNativeSimpleToast.default.LONG, _reactNativeSimpleToast.default.TOP);
|
|
1390
1468
|
}
|
|
1391
1469
|
}, [hmsInstance]);
|
|
1392
|
-
const endRoom = (0, _react.useCallback)(async
|
|
1470
|
+
const endRoom = (0, _react.useCallback)(async reason => {
|
|
1393
1471
|
try {
|
|
1394
1472
|
const d = await hmsInstance.endRoom('Host ended the room');
|
|
1395
1473
|
console.log('EndRoom Success: ', d);
|
|
1396
|
-
await destroy();
|
|
1474
|
+
await destroy(reason);
|
|
1397
1475
|
} catch (e) {
|
|
1398
1476
|
console.log('EndRoom Error: ', e);
|
|
1399
1477
|
}
|
|
@@ -1402,7 +1480,7 @@ const useLeaveMethods = isUnmounted => {
|
|
|
1402
1480
|
destroy,
|
|
1403
1481
|
leave,
|
|
1404
1482
|
endRoom,
|
|
1405
|
-
|
|
1483
|
+
prebuiltCleanUp
|
|
1406
1484
|
};
|
|
1407
1485
|
};
|
|
1408
1486
|
|
|
@@ -1550,4 +1628,91 @@ const useHMSConferencingScreenConfig = (selector, equalityFn) => {
|
|
|
1550
1628
|
}, equalityFn);
|
|
1551
1629
|
};
|
|
1552
1630
|
exports.useHMSConferencingScreenConfig = useHMSConferencingScreenConfig;
|
|
1631
|
+
const useBackButtonPress = () => {
|
|
1632
|
+
const {
|
|
1633
|
+
handleModalVisibleType
|
|
1634
|
+
} = useModalType();
|
|
1635
|
+
const handleBackPress = (0, _reactRedux.useSelector)(state => state.app.handleBackButton);
|
|
1636
|
+
(0, _react.useEffect)(() => {
|
|
1637
|
+
if (handleBackPress) {
|
|
1638
|
+
const backPressHandler = () => {
|
|
1639
|
+
handleModalVisibleType(_types.ModalTypes.LEAVE_ROOM);
|
|
1640
|
+
|
|
1641
|
+
/**
|
|
1642
|
+
* When true is returned the event will not be bubbled up
|
|
1643
|
+
* & no other back action will execute
|
|
1644
|
+
*/
|
|
1645
|
+
return true;
|
|
1646
|
+
|
|
1647
|
+
/**
|
|
1648
|
+
* Returning false will let the event to bubble up & let other event listeners
|
|
1649
|
+
* or the system's default back action to be executed.
|
|
1650
|
+
*/
|
|
1651
|
+
// return false;
|
|
1652
|
+
};
|
|
1653
|
+
|
|
1654
|
+
const subscription = _reactNative.BackHandler.addEventListener('hardwareBackPress', backPressHandler);
|
|
1655
|
+
return () => {
|
|
1656
|
+
if (typeof subscription.remove === 'function') {
|
|
1657
|
+
subscription.remove();
|
|
1658
|
+
} else {
|
|
1659
|
+
_reactNative.BackHandler.removeEventListener('hardwareBackPress', backPressHandler);
|
|
1660
|
+
}
|
|
1661
|
+
};
|
|
1662
|
+
}
|
|
1663
|
+
}, [handleBackPress, handleModalVisibleType]);
|
|
1664
|
+
};
|
|
1665
|
+
exports.useBackButtonPress = useBackButtonPress;
|
|
1666
|
+
const useSavePropsToStore = (props, dispatch) => {
|
|
1667
|
+
const {
|
|
1668
|
+
roomCode,
|
|
1669
|
+
options,
|
|
1670
|
+
onLeave,
|
|
1671
|
+
handleBackButton,
|
|
1672
|
+
autoEnterPipMode
|
|
1673
|
+
} = props;
|
|
1674
|
+
(0, _react.useEffect)(() => {
|
|
1675
|
+
dispatch((0, _actions.setPrebuiltData)({
|
|
1676
|
+
roomCode,
|
|
1677
|
+
options
|
|
1678
|
+
}));
|
|
1679
|
+
}, [roomCode, options]);
|
|
1680
|
+
(0, _react.useEffect)(() => {
|
|
1681
|
+
dispatch((0, _actions.setOnLeaveHandler)(onLeave));
|
|
1682
|
+
}, [onLeave]);
|
|
1683
|
+
(0, _react.useEffect)(() => {
|
|
1684
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
1685
|
+
dispatch((0, _actions.setHandleBackButton)(handleBackButton));
|
|
1686
|
+
}
|
|
1687
|
+
}, [handleBackButton]);
|
|
1688
|
+
(0, _react.useEffect)(() => {
|
|
1689
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
1690
|
+
dispatch((0, _actions.setAutoEnterPipMode)(autoEnterPipMode));
|
|
1691
|
+
}
|
|
1692
|
+
}, [autoEnterPipMode]);
|
|
1693
|
+
};
|
|
1694
|
+
exports.useSavePropsToStore = useSavePropsToStore;
|
|
1695
|
+
const useStartRecording = () => {
|
|
1696
|
+
const dispatch = (0, _reactRedux.useDispatch)();
|
|
1697
|
+
const hmsInstance = useHMSInstance();
|
|
1698
|
+
const startRecording = (0, _react.useCallback)(() => {
|
|
1699
|
+
dispatch((0, _actions.setStartingOrStoppingRecording)(true));
|
|
1700
|
+
hmsInstance.startRTMPOrRecording({
|
|
1701
|
+
record: true
|
|
1702
|
+
}).catch(error => {
|
|
1703
|
+
(0, _reactRedux.batch)(() => {
|
|
1704
|
+
dispatch((0, _actions.setStartingOrStoppingRecording)(false));
|
|
1705
|
+
dispatch((0, _actions.addNotification)({
|
|
1706
|
+
id: Math.random().toString(16).slice(2),
|
|
1707
|
+
type: _types2.NotificationTypes.ERROR,
|
|
1708
|
+
message: error.message
|
|
1709
|
+
}));
|
|
1710
|
+
});
|
|
1711
|
+
});
|
|
1712
|
+
}, [hmsInstance]);
|
|
1713
|
+
return {
|
|
1714
|
+
startRecording
|
|
1715
|
+
};
|
|
1716
|
+
};
|
|
1717
|
+
exports.useStartRecording = useStartRecording;
|
|
1553
1718
|
//# sourceMappingURL=hooks-util.js.map
|