@100mslive/react-native-room-kit 1.1.7 → 1.1.9-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/HMSInstanceSetup.js +11 -5
- package/lib/commonjs/HMSInstanceSetup.js.map +1 -1
- package/lib/commonjs/HMSRoomSetup.js +8 -0
- package/lib/commonjs/HMSRoomSetup.js.map +1 -1
- package/lib/commonjs/Icons/AddImage/assets/add-image.png +0 -0
- package/lib/commonjs/Icons/AddImage/assets/add-image@2x.png +0 -0
- package/lib/commonjs/Icons/AddImage/assets/add-image@3x.png +0 -0
- package/lib/commonjs/Icons/AddImage/index.js +33 -0
- package/lib/commonjs/Icons/AddImage/index.js.map +1 -0
- package/lib/commonjs/Icons/BlurPeople/assets/blur-people.png +0 -0
- package/lib/commonjs/Icons/BlurPeople/assets/blur-people@2x.png +0 -0
- package/lib/commonjs/Icons/BlurPeople/assets/blur-people@3x.png +0 -0
- package/lib/commonjs/Icons/BlurPeople/index.js +33 -0
- package/lib/commonjs/Icons/BlurPeople/index.js.map +1 -0
- package/lib/commonjs/Icons/CrossCircle/assets/cross-circle-large.png +0 -0
- package/lib/commonjs/Icons/CrossCircle/assets/cross-circle-large@2x.png +0 -0
- package/lib/commonjs/Icons/CrossCircle/assets/cross-circle-large@3x.png +0 -0
- package/lib/commonjs/Icons/CrossCircle/index.js +7 -2
- package/lib/commonjs/Icons/CrossCircle/index.js.map +1 -1
- package/lib/commonjs/Icons/Pencil/assets/pencil-board.png +0 -0
- package/lib/commonjs/Icons/Pencil/assets/pencil-board@2x.png +0 -0
- package/lib/commonjs/Icons/Pencil/assets/pencil-board@3x.png +0 -0
- package/lib/commonjs/Icons/Pencil/index.js +2 -1
- package/lib/commonjs/Icons/Pencil/index.js.map +1 -1
- package/lib/commonjs/Icons/VirtualBackground/assets/virtual-background.png +0 -0
- package/lib/commonjs/Icons/VirtualBackground/assets/virtual-background@2x.png +0 -0
- package/lib/commonjs/Icons/VirtualBackground/assets/virtual-background@3x.png +0 -0
- package/lib/commonjs/Icons/VirtualBackground/index.js +33 -0
- package/lib/commonjs/Icons/VirtualBackground/index.js.map +1 -0
- package/lib/commonjs/Icons/index.js +33 -0
- package/lib/commonjs/Icons/index.js.map +1 -1
- package/lib/commonjs/components/Chat/ChatMessage.js +13 -1
- package/lib/commonjs/components/Chat/ChatMessage.js.map +1 -1
- package/lib/commonjs/components/DisplayView.js +2 -1
- package/lib/commonjs/components/DisplayView.js.map +1 -1
- package/lib/commonjs/components/Footer.js +1 -1
- package/lib/commonjs/components/Footer.js.map +1 -1
- package/lib/commonjs/components/FullScreenWhiteboard.js +58 -0
- package/lib/commonjs/components/FullScreenWhiteboard.js.map +1 -0
- package/lib/commonjs/components/GridView.js +6 -4
- package/lib/commonjs/components/GridView.js.map +1 -1
- package/lib/commonjs/components/HLSChatView.js +7 -2
- package/lib/commonjs/components/HLSChatView.js.map +1 -1
- package/lib/commonjs/components/HLSDescriptionPane.js +3 -29
- package/lib/commonjs/components/HLSDescriptionPane.js.map +1 -1
- package/lib/commonjs/components/HLSPlayerContainer.js +4 -1
- package/lib/commonjs/components/HLSPlayerContainer.js.map +1 -1
- package/lib/commonjs/components/HMSHLSMessage.js +14 -1
- package/lib/commonjs/components/HMSHLSMessage.js.map +1 -1
- package/lib/commonjs/components/HMSManageCameraRotation.js +11 -4
- package/lib/commonjs/components/HMSManageCameraRotation.js.map +1 -1
- package/lib/commonjs/components/HMSManageLocalVideo.js +11 -4
- package/lib/commonjs/components/HMSManageLocalVideo.js.map +1 -1
- package/lib/commonjs/components/HMSManageVirtualBackground.js +55 -0
- package/lib/commonjs/components/HMSManageVirtualBackground.js.map +1 -0
- package/lib/commonjs/components/HMSOverlayMessageView.js +14 -1
- package/lib/commonjs/components/HMSOverlayMessageView.js.map +1 -1
- package/lib/commonjs/components/HMSRoomOptions.js +2 -1
- package/lib/commonjs/components/HMSRoomOptions.js.map +1 -1
- package/lib/commonjs/components/MeetingScreenContent.js +22 -2
- package/lib/commonjs/components/MeetingScreenContent.js.map +1 -1
- package/lib/commonjs/components/Preview.js +8 -3
- package/lib/commonjs/components/Preview.js.map +1 -1
- package/lib/commonjs/components/RoomSettingsModalContent.js +91 -6
- package/lib/commonjs/components/RoomSettingsModalContent.js.map +1 -1
- package/lib/commonjs/components/TilesContainer.js +4 -4
- package/lib/commonjs/components/TilesContainer.js.map +1 -1
- package/lib/commonjs/components/VirtualBackgroundBottomSheet.js +52 -0
- package/lib/commonjs/components/VirtualBackgroundBottomSheet.js.map +1 -0
- package/lib/commonjs/components/VirtualBackgroundModalContent.js +364 -0
- package/lib/commonjs/components/VirtualBackgroundModalContent.js.map +1 -0
- package/lib/commonjs/components/WebrtcView.js +2 -2
- package/lib/commonjs/components/WebrtcView.js.map +1 -1
- package/lib/commonjs/components/Whiteboard.js +72 -0
- package/lib/commonjs/components/Whiteboard.js.map +1 -0
- package/lib/commonjs/components/WhiteboardContainer.js +35 -0
- package/lib/commonjs/components/WhiteboardContainer.js.map +1 -0
- package/lib/commonjs/components/WhiteboardFullScreenButton.js +42 -0
- package/lib/commonjs/components/WhiteboardFullScreenButton.js.map +1 -0
- package/lib/commonjs/hooks-util.js +36 -6
- package/lib/commonjs/hooks-util.js.map +1 -1
- package/lib/commonjs/modules/imagePickerWrapper.js +19 -0
- package/lib/commonjs/modules/imagePickerWrapper.js.map +1 -0
- package/lib/commonjs/modules/videoPluginWrapper.js +13 -0
- package/lib/commonjs/modules/videoPluginWrapper.js.map +1 -0
- package/lib/commonjs/redux/actionTypes.js +6 -0
- package/lib/commonjs/redux/actionTypes.js.map +1 -1
- package/lib/commonjs/redux/actions/index.js +27 -3
- 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 +13 -1
- package/lib/commonjs/redux/reducers/hmsStates.js.map +1 -1
- package/lib/commonjs/utils/functions.js +33 -1
- package/lib/commonjs/utils/functions.js.map +1 -1
- package/lib/commonjs/utils/types.js +1 -0
- package/lib/commonjs/utils/types.js.map +1 -1
- package/lib/module/HMSInstanceSetup.js +12 -6
- package/lib/module/HMSInstanceSetup.js.map +1 -1
- package/lib/module/HMSRoomSetup.js +10 -2
- package/lib/module/HMSRoomSetup.js.map +1 -1
- package/lib/module/Icons/AddImage/assets/add-image.png +0 -0
- package/lib/module/Icons/AddImage/assets/add-image@2x.png +0 -0
- package/lib/module/Icons/AddImage/assets/add-image@3x.png +0 -0
- package/lib/module/Icons/AddImage/index.js +25 -0
- package/lib/module/Icons/AddImage/index.js.map +1 -0
- package/lib/module/Icons/BlurPeople/assets/blur-people.png +0 -0
- package/lib/module/Icons/BlurPeople/assets/blur-people@2x.png +0 -0
- package/lib/module/Icons/BlurPeople/assets/blur-people@3x.png +0 -0
- package/lib/module/Icons/BlurPeople/index.js +25 -0
- package/lib/module/Icons/BlurPeople/index.js.map +1 -0
- package/lib/module/Icons/CrossCircle/assets/cross-circle-large.png +0 -0
- package/lib/module/Icons/CrossCircle/assets/cross-circle-large@2x.png +0 -0
- package/lib/module/Icons/CrossCircle/assets/cross-circle-large@3x.png +0 -0
- package/lib/module/Icons/CrossCircle/index.js +7 -2
- package/lib/module/Icons/CrossCircle/index.js.map +1 -1
- package/lib/module/Icons/Pencil/assets/pencil-board.png +0 -0
- package/lib/module/Icons/Pencil/assets/pencil-board@2x.png +0 -0
- package/lib/module/Icons/Pencil/assets/pencil-board@3x.png +0 -0
- package/lib/module/Icons/Pencil/index.js +2 -1
- package/lib/module/Icons/Pencil/index.js.map +1 -1
- package/lib/module/Icons/VirtualBackground/assets/virtual-background.png +0 -0
- package/lib/module/Icons/VirtualBackground/assets/virtual-background@2x.png +0 -0
- package/lib/module/Icons/VirtualBackground/assets/virtual-background@3x.png +0 -0
- package/lib/module/Icons/VirtualBackground/index.js +25 -0
- package/lib/module/Icons/VirtualBackground/index.js.map +1 -0
- package/lib/module/Icons/index.js +3 -0
- package/lib/module/Icons/index.js.map +1 -1
- package/lib/module/components/Chat/ChatMessage.js +15 -3
- package/lib/module/components/Chat/ChatMessage.js.map +1 -1
- package/lib/module/components/DisplayView.js +2 -1
- package/lib/module/components/DisplayView.js.map +1 -1
- package/lib/module/components/Footer.js +1 -1
- package/lib/module/components/Footer.js.map +1 -1
- package/lib/module/components/FullScreenWhiteboard.js +48 -0
- package/lib/module/components/FullScreenWhiteboard.js.map +1 -0
- package/lib/module/components/GridView.js +6 -4
- package/lib/module/components/GridView.js.map +1 -1
- package/lib/module/components/HLSChatView.js +7 -2
- package/lib/module/components/HLSChatView.js.map +1 -1
- package/lib/module/components/HLSDescriptionPane.js +2 -28
- package/lib/module/components/HLSDescriptionPane.js.map +1 -1
- package/lib/module/components/HLSPlayerContainer.js +4 -1
- package/lib/module/components/HLSPlayerContainer.js.map +1 -1
- package/lib/module/components/HMSHLSMessage.js +15 -2
- package/lib/module/components/HMSHLSMessage.js.map +1 -1
- package/lib/module/components/HMSManageCameraRotation.js +11 -4
- package/lib/module/components/HMSManageCameraRotation.js.map +1 -1
- package/lib/module/components/HMSManageLocalVideo.js +11 -4
- package/lib/module/components/HMSManageLocalVideo.js.map +1 -1
- package/lib/module/components/HMSManageVirtualBackground.js +46 -0
- package/lib/module/components/HMSManageVirtualBackground.js.map +1 -0
- package/lib/module/components/HMSOverlayMessageView.js +15 -2
- package/lib/module/components/HMSOverlayMessageView.js.map +1 -1
- package/lib/module/components/HMSRoomOptions.js +2 -1
- package/lib/module/components/HMSRoomOptions.js.map +1 -1
- package/lib/module/components/MeetingScreenContent.js +23 -3
- package/lib/module/components/MeetingScreenContent.js.map +1 -1
- package/lib/module/components/Preview.js +8 -3
- package/lib/module/components/Preview.js.map +1 -1
- package/lib/module/components/RoomSettingsModalContent.js +94 -9
- package/lib/module/components/RoomSettingsModalContent.js.map +1 -1
- package/lib/module/components/TilesContainer.js +4 -4
- package/lib/module/components/TilesContainer.js.map +1 -1
- package/lib/module/components/VirtualBackgroundBottomSheet.js +43 -0
- package/lib/module/components/VirtualBackgroundBottomSheet.js.map +1 -0
- package/lib/module/components/VirtualBackgroundModalContent.js +355 -0
- package/lib/module/components/VirtualBackgroundModalContent.js.map +1 -0
- package/lib/module/components/WebrtcView.js +2 -2
- package/lib/module/components/WebrtcView.js.map +1 -1
- package/lib/module/components/Whiteboard.js +64 -0
- package/lib/module/components/Whiteboard.js.map +1 -0
- package/lib/module/components/WhiteboardContainer.js +27 -0
- package/lib/module/components/WhiteboardContainer.js.map +1 -0
- package/lib/module/components/WhiteboardFullScreenButton.js +33 -0
- package/lib/module/components/WhiteboardFullScreenButton.js.map +1 -0
- package/lib/module/hooks-util.js +36 -6
- package/lib/module/hooks-util.js.map +1 -1
- package/lib/module/modules/imagePickerWrapper.js +14 -0
- package/lib/module/modules/imagePickerWrapper.js.map +1 -0
- package/lib/module/modules/videoPluginWrapper.js +8 -0
- package/lib/module/modules/videoPluginWrapper.js.map +1 -0
- package/lib/module/redux/actionTypes.js +6 -0
- package/lib/module/redux/actionTypes.js.map +1 -1
- package/lib/module/redux/actions/index.js +20 -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 +13 -1
- package/lib/module/redux/reducers/hmsStates.js.map +1 -1
- package/lib/module/utils/functions.js +29 -1
- package/lib/module/utils/functions.js.map +1 -1
- package/lib/module/utils/types.js +1 -0
- package/lib/module/utils/types.js.map +1 -1
- package/lib/typescript/HMSInstanceSetup.d.ts.map +1 -1
- package/lib/typescript/HMSRoomSetup.d.ts.map +1 -1
- package/lib/typescript/Icons/AddImage/index.d.ts +7 -0
- package/lib/typescript/Icons/AddImage/index.d.ts.map +1 -0
- package/lib/typescript/Icons/BlurPeople/index.d.ts +7 -0
- package/lib/typescript/Icons/BlurPeople/index.d.ts.map +1 -0
- package/lib/typescript/Icons/CrossCircle/index.d.ts +1 -0
- package/lib/typescript/Icons/CrossCircle/index.d.ts.map +1 -1
- package/lib/typescript/Icons/Pencil/index.d.ts +1 -0
- package/lib/typescript/Icons/Pencil/index.d.ts.map +1 -1
- package/lib/typescript/Icons/VirtualBackground/index.d.ts +7 -0
- package/lib/typescript/Icons/VirtualBackground/index.d.ts.map +1 -0
- package/lib/typescript/Icons/index.d.ts +3 -0
- package/lib/typescript/Icons/index.d.ts.map +1 -1
- package/lib/typescript/components/Chat/ChatMessage.d.ts.map +1 -1
- package/lib/typescript/components/DisplayView.d.ts.map +1 -1
- package/lib/typescript/components/Footer.d.ts.map +1 -1
- package/lib/typescript/components/FullScreenWhiteboard.d.ts +3 -0
- package/lib/typescript/components/FullScreenWhiteboard.d.ts.map +1 -0
- package/lib/typescript/components/GridView.d.ts.map +1 -1
- package/lib/typescript/components/HLSChatView.d.ts.map +1 -1
- package/lib/typescript/components/HLSDescriptionPane.d.ts.map +1 -1
- package/lib/typescript/components/HLSPlayerContainer.d.ts.map +1 -1
- package/lib/typescript/components/HMSHLSMessage.d.ts.map +1 -1
- package/lib/typescript/components/HMSManageCameraRotation.d.ts +8 -1
- package/lib/typescript/components/HMSManageCameraRotation.d.ts.map +1 -1
- package/lib/typescript/components/HMSManageLocalVideo.d.ts +8 -1
- package/lib/typescript/components/HMSManageLocalVideo.d.ts.map +1 -1
- package/lib/typescript/components/HMSManageVirtualBackground.d.ts +8 -0
- package/lib/typescript/components/HMSManageVirtualBackground.d.ts.map +1 -0
- package/lib/typescript/components/HMSOverlayMessageView.d.ts.map +1 -1
- package/lib/typescript/components/HMSRoomOptions.d.ts.map +1 -1
- package/lib/typescript/components/MeetingScreenContent.d.ts.map +1 -1
- package/lib/typescript/components/Preview.d.ts.map +1 -1
- package/lib/typescript/components/RoomSettingsModalContent.d.ts.map +1 -1
- package/lib/typescript/components/TilesContainer.d.ts.map +1 -1
- package/lib/typescript/components/VirtualBackgroundBottomSheet.d.ts +3 -0
- package/lib/typescript/components/VirtualBackgroundBottomSheet.d.ts.map +1 -0
- package/lib/typescript/components/VirtualBackgroundModalContent.d.ts +6 -0
- package/lib/typescript/components/VirtualBackgroundModalContent.d.ts.map +1 -0
- package/lib/typescript/components/WebrtcView.d.ts.map +1 -1
- package/lib/typescript/components/Whiteboard.d.ts +6 -0
- package/lib/typescript/components/Whiteboard.d.ts.map +1 -0
- package/lib/typescript/components/WhiteboardContainer.d.ts +6 -0
- package/lib/typescript/components/WhiteboardContainer.d.ts.map +1 -0
- package/lib/typescript/components/WhiteboardFullScreenButton.d.ts +5 -0
- package/lib/typescript/components/WhiteboardFullScreenButton.d.ts.map +1 -0
- package/lib/typescript/hooks-util.d.ts.map +1 -1
- package/lib/typescript/modules/imagePickerWrapper.d.ts +6 -0
- package/lib/typescript/modules/imagePickerWrapper.d.ts.map +1 -0
- package/lib/typescript/modules/videoPluginWrapper.d.ts +19 -0
- package/lib/typescript/modules/videoPluginWrapper.d.ts.map +1 -0
- package/lib/typescript/redux/actionTypes.d.ts +4 -0
- package/lib/typescript/redux/actionTypes.d.ts.map +1 -1
- package/lib/typescript/redux/actions/index.d.ts +22 -1
- package/lib/typescript/redux/actions/index.d.ts.map +1 -1
- package/lib/typescript/redux/index.d.ts +4 -0
- package/lib/typescript/redux/index.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/appState.d.ts +2 -0
- package/lib/typescript/redux/reducers/appState.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/hmsStates.d.ts +13 -2
- package/lib/typescript/redux/reducers/hmsStates.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/index.d.ts +4 -0
- package/lib/typescript/redux/reducers/index.d.ts.map +1 -1
- package/lib/typescript/utils/functions.d.ts +2 -0
- package/lib/typescript/utils/functions.d.ts.map +1 -1
- package/lib/typescript/utils/types.d.ts +1 -0
- package/lib/typescript/utils/types.d.ts.map +1 -1
- package/package.json +10 -3
- package/src/HMSInstanceSetup.tsx +17 -4
- package/src/HMSRoomSetup.tsx +21 -0
- package/src/Icons/AddImage/assets/add-image.png +0 -0
- package/src/Icons/AddImage/assets/add-image@2x.png +0 -0
- package/src/Icons/AddImage/assets/add-image@3x.png +0 -0
- package/src/Icons/AddImage/index.tsx +33 -0
- package/src/Icons/BlurPeople/assets/blur-people.png +0 -0
- package/src/Icons/BlurPeople/assets/blur-people@2x.png +0 -0
- package/src/Icons/BlurPeople/assets/blur-people@3x.png +0 -0
- package/src/Icons/BlurPeople/index.tsx +33 -0
- package/src/Icons/CrossCircle/assets/cross-circle-large.png +0 -0
- package/src/Icons/CrossCircle/assets/cross-circle-large@2x.png +0 -0
- package/src/Icons/CrossCircle/assets/cross-circle-large@3x.png +0 -0
- package/src/Icons/CrossCircle/index.tsx +19 -3
- package/src/Icons/Pencil/assets/pencil-board.png +0 -0
- package/src/Icons/Pencil/assets/pencil-board@2x.png +0 -0
- package/src/Icons/Pencil/assets/pencil-board@3x.png +0 -0
- package/src/Icons/Pencil/index.tsx +9 -2
- package/src/Icons/VirtualBackground/assets/virtual-background.png +0 -0
- package/src/Icons/VirtualBackground/assets/virtual-background@2x.png +0 -0
- package/src/Icons/VirtualBackground/assets/virtual-background@3x.png +0 -0
- package/src/Icons/VirtualBackground/index.tsx +33 -0
- package/src/Icons/index.ts +3 -0
- package/src/components/Chat/ChatMessage.tsx +19 -2
- package/src/components/DisplayView.tsx +3 -0
- package/src/components/Footer.tsx +5 -2
- package/src/components/FullScreenWhiteboard.tsx +59 -0
- package/src/components/GridView.tsx +14 -5
- package/src/components/HLSChatView.tsx +7 -4
- package/src/components/HLSDescriptionPane.tsx +2 -33
- package/src/components/HLSPlayerContainer.tsx +15 -7
- package/src/components/HMSHLSMessage.tsx +16 -1
- package/src/components/HMSManageCameraRotation.tsx +18 -4
- package/src/components/HMSManageLocalVideo.tsx +20 -4
- package/src/components/HMSManageVirtualBackground.tsx +76 -0
- package/src/components/HMSOverlayMessageView.tsx +16 -1
- package/src/components/HMSRoomOptions.tsx +3 -0
- package/src/components/MeetingScreenContent.tsx +28 -2
- package/src/components/Preview.tsx +12 -5
- package/src/components/RoomSettingsModalContent.tsx +108 -2
- package/src/components/TilesContainer.tsx +7 -5
- package/src/components/VirtualBackgroundBottomSheet.tsx +62 -0
- package/src/components/VirtualBackgroundModalContent.tsx +500 -0
- package/src/components/WebrtcView.tsx +11 -4
- package/src/components/Whiteboard.tsx +101 -0
- package/src/components/WhiteboardContainer.tsx +35 -0
- package/src/components/WhiteboardFullScreenButton.tsx +52 -0
- package/src/hooks-util.ts +41 -9
- package/src/modules/imagePickerWrapper.ts +20 -0
- package/src/modules/videoPluginWrapper.ts +32 -0
- package/src/redux/actionTypes.ts +8 -0
- package/src/redux/actions/index.ts +22 -0
- package/src/redux/reducers/appState.ts +16 -0
- package/src/redux/reducers/hmsStates.ts +29 -1
- package/src/utils/{functions.ts → functions.tsx} +34 -0
- package/src/utils/types.ts +1 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View, StyleSheet } from 'react-native';
|
|
3
|
+
import { useSelector } from 'react-redux';
|
|
3
4
|
import type { HMSHLSPlayer } from '@100mslive/react-native-hms';
|
|
4
5
|
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
5
6
|
import {
|
|
@@ -13,11 +14,16 @@ import {
|
|
|
13
14
|
import { useHLSViewsConstraints } from '../hooks-util';
|
|
14
15
|
import { HLSPlayer } from './HLSPlayer';
|
|
15
16
|
import { HLSPlayerControls } from './HLSPlayerControls';
|
|
17
|
+
import { PipModes } from '../utils/types';
|
|
18
|
+
import type { RootState } from '../redux';
|
|
16
19
|
|
|
17
20
|
export const _HLSPlayerContainer: React.FC = () => {
|
|
18
21
|
const hlsPlayerRef =
|
|
19
22
|
React.useRef<React.ElementRef<typeof HMSHLSPlayer>>(null);
|
|
20
23
|
const { playerWrapperConstraints } = useHLSViewsConstraints();
|
|
24
|
+
const isPipModeActive = useSelector(
|
|
25
|
+
(state: RootState) => state.app.pipModeStatus === PipModes.ACTIVE
|
|
26
|
+
);
|
|
21
27
|
|
|
22
28
|
const animatedValue = useSharedValue(1);
|
|
23
29
|
|
|
@@ -82,13 +88,15 @@ export const _HLSPlayerContainer: React.FC = () => {
|
|
|
82
88
|
>
|
|
83
89
|
<HLSPlayer ref={hlsPlayerRef} />
|
|
84
90
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
{isPipModeActive ? null : (
|
|
92
|
+
<HLSPlayerControls
|
|
93
|
+
playerRef={hlsPlayerRef}
|
|
94
|
+
animatedValue={animatedValue}
|
|
95
|
+
cancelCurrentControlAnimation={cancelCurrentControlAnimation}
|
|
96
|
+
hideControlsAfterDelay={hideControlsAfterDelay}
|
|
97
|
+
resetHideControlAnimation={resetHideControlAnimation}
|
|
98
|
+
/>
|
|
99
|
+
)}
|
|
92
100
|
</View>
|
|
93
101
|
</GestureDetector>
|
|
94
102
|
);
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
StyleSheet,
|
|
7
7
|
Platform,
|
|
8
8
|
TouchableOpacity,
|
|
9
|
+
Linking,
|
|
9
10
|
} from 'react-native';
|
|
10
11
|
import type { HMSMessage } from '@100mslive/react-native-hms';
|
|
11
12
|
|
|
@@ -19,6 +20,7 @@ import { PinIcon, ThreeDotsIcon } from '../Icons';
|
|
|
19
20
|
import { setSelectedMessageForAction } from '../redux/actions';
|
|
20
21
|
import { ModalTypes } from '../utils/types';
|
|
21
22
|
import type { RootState } from '../redux';
|
|
23
|
+
import { splitLinksAndContent } from '../utils/functions';
|
|
22
24
|
|
|
23
25
|
interface HMSHLSMessageProps {
|
|
24
26
|
message: HMSMessage;
|
|
@@ -63,6 +65,9 @@ const _HMSHLSMessage: React.FC<HMSHLSMessageProps> = ({ message }) => {
|
|
|
63
65
|
pinnedLabel: {
|
|
64
66
|
color: '#ffffff',
|
|
65
67
|
},
|
|
68
|
+
link: {
|
|
69
|
+
color: theme.palette.primary_bright,
|
|
70
|
+
},
|
|
66
71
|
}),
|
|
67
72
|
[]
|
|
68
73
|
);
|
|
@@ -81,6 +86,13 @@ const _HMSHLSMessage: React.FC<HMSHLSMessageProps> = ({ message }) => {
|
|
|
81
86
|
message.sender &&
|
|
82
87
|
message.sender.peerID !== localPeerId); // can remove participants
|
|
83
88
|
|
|
89
|
+
const handleLinkPress = async (url: string) => {
|
|
90
|
+
const canOpen = await Linking.canOpenURL(url);
|
|
91
|
+
if (canOpen) {
|
|
92
|
+
await Linking.openURL(url);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
|
|
84
96
|
return (
|
|
85
97
|
<View style={styles.container}>
|
|
86
98
|
{isPinned ? (
|
|
@@ -106,7 +118,10 @@ const _HMSHLSMessage: React.FC<HMSHLSMessageProps> = ({ message }) => {
|
|
|
106
118
|
{' '}
|
|
107
119
|
</Text>
|
|
108
120
|
|
|
109
|
-
{message.message
|
|
121
|
+
{splitLinksAndContent(message.message, {
|
|
122
|
+
pressHandler: handleLinkPress,
|
|
123
|
+
style: hmsRoomStyles.link,
|
|
124
|
+
})}
|
|
110
125
|
</Text>
|
|
111
126
|
|
|
112
127
|
{canTakeAction ? (
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useSelector } from 'react-redux';
|
|
3
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
4
|
|
|
4
5
|
import { RotateCameraIcon } from '../Icons';
|
|
5
6
|
import { useCanPublishVideo, useHMSActions } from '../hooks-sdk';
|
|
@@ -8,17 +9,25 @@ import { PressableIcon } from './PressableIcon';
|
|
|
8
9
|
import { useHMSRoomStyle } from '../hooks-util';
|
|
9
10
|
import { TestIds } from '../utils/constants';
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
interface HMSManageCameraRotationProps extends RotateCameraButtonProps {}
|
|
13
|
+
|
|
14
|
+
export const HMSManageCameraRotation: React.FC<
|
|
15
|
+
HMSManageCameraRotationProps
|
|
16
|
+
> = ({ style }) => {
|
|
12
17
|
const canPublishVideo = useCanPublishVideo();
|
|
13
18
|
|
|
14
19
|
if (!canPublishVideo) {
|
|
15
20
|
return null;
|
|
16
21
|
}
|
|
17
22
|
|
|
18
|
-
return <RotateCameraButton />;
|
|
23
|
+
return <RotateCameraButton style={style} />;
|
|
19
24
|
};
|
|
20
25
|
|
|
21
|
-
|
|
26
|
+
interface RotateCameraButtonProps {
|
|
27
|
+
style?: StyleProp<ViewStyle>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const RotateCameraButton: React.FC<RotateCameraButtonProps> = ({ style }) => {
|
|
22
31
|
const hmsActions = useHMSActions();
|
|
23
32
|
// TODO: set initial `isLocalVideoMuted` state value as per initial track setting
|
|
24
33
|
const isLocalVideoMuted = useSelector(
|
|
@@ -43,9 +52,14 @@ const RotateCameraButton = () => {
|
|
|
43
52
|
|
|
44
53
|
return (
|
|
45
54
|
<PressableIcon
|
|
46
|
-
testID={
|
|
55
|
+
testID={
|
|
56
|
+
isLocalVideoMuted
|
|
57
|
+
? TestIds.switch_camera_disabled
|
|
58
|
+
: TestIds.switch_camera
|
|
59
|
+
}
|
|
47
60
|
onPress={handleVideoMuteTogglePress}
|
|
48
61
|
disabled={isLocalVideoMuted}
|
|
62
|
+
style={style}
|
|
49
63
|
>
|
|
50
64
|
<RotateCameraIcon style={cameraIconStyles} />
|
|
51
65
|
</PressableIcon>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useSelector } from 'react-redux';
|
|
3
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
4
|
|
|
4
5
|
import type { RootState } from '../redux';
|
|
5
6
|
import { useCanPublishVideo, useHMSActions } from '../hooks-sdk';
|
|
@@ -7,17 +8,27 @@ import { PressableIcon } from './PressableIcon';
|
|
|
7
8
|
import { CameraIcon } from '../Icons';
|
|
8
9
|
import { TestIds } from '../utils/constants';
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
interface HMSManageLocalVideoProps extends ToggleVideoMuteButtonProps {}
|
|
12
|
+
|
|
13
|
+
export const HMSManageLocalVideo: React.FC<HMSManageLocalVideoProps> = ({
|
|
14
|
+
style,
|
|
15
|
+
}) => {
|
|
11
16
|
const canPublishVideo = useCanPublishVideo();
|
|
12
17
|
|
|
13
18
|
if (!canPublishVideo) {
|
|
14
19
|
return null;
|
|
15
20
|
}
|
|
16
21
|
|
|
17
|
-
return <ToggleVideoMuteButton />;
|
|
22
|
+
return <ToggleVideoMuteButton style={style} />;
|
|
18
23
|
};
|
|
19
24
|
|
|
20
|
-
|
|
25
|
+
interface ToggleVideoMuteButtonProps {
|
|
26
|
+
style?: StyleProp<ViewStyle>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const ToggleVideoMuteButton: React.FC<ToggleVideoMuteButtonProps> = ({
|
|
30
|
+
style,
|
|
31
|
+
}) => {
|
|
21
32
|
const hmsActions = useHMSActions();
|
|
22
33
|
// TODO: set initial `isLocalVideoMuted` state value as per initial track setting
|
|
23
34
|
const isLocalVideoMuted = useSelector(
|
|
@@ -32,9 +43,14 @@ const ToggleVideoMuteButton = () => {
|
|
|
32
43
|
|
|
33
44
|
return (
|
|
34
45
|
<PressableIcon
|
|
35
|
-
testID={
|
|
46
|
+
testID={
|
|
47
|
+
!!isLocalVideoMuted
|
|
48
|
+
? TestIds.camera_muted_btn
|
|
49
|
+
: TestIds.camera_unmuted_btn
|
|
50
|
+
}
|
|
36
51
|
onPress={handleVideoMuteTogglePress}
|
|
37
52
|
active={isLocalVideoMuted}
|
|
53
|
+
style={style}
|
|
38
54
|
>
|
|
39
55
|
<CameraIcon muted={!!isLocalVideoMuted} />
|
|
40
56
|
</PressableIcon>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useSelector } from 'react-redux';
|
|
3
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
4
|
+
|
|
5
|
+
import { VirtualBackgroundIcon } from '../Icons';
|
|
6
|
+
import { useCanPublishVideo } from '../hooks-sdk';
|
|
7
|
+
import type { RootState } from '../redux';
|
|
8
|
+
import { PressableIcon } from './PressableIcon';
|
|
9
|
+
import { useHMSRoomStyle, useModalType } from '../hooks-util';
|
|
10
|
+
import { VirtualBackgroundBottomSheet } from './VirtualBackgroundBottomSheet';
|
|
11
|
+
import { ModalTypes } from '../utils/types';
|
|
12
|
+
|
|
13
|
+
interface HMSManageVirtualBackgroundProps {
|
|
14
|
+
style?: StyleProp<ViewStyle>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const HMSManageVirtualBackground: React.FC<
|
|
18
|
+
HMSManageVirtualBackgroundProps
|
|
19
|
+
> = ({ style }) => {
|
|
20
|
+
const canPublishVideo = useCanPublishVideo();
|
|
21
|
+
const videoPluginExists = useSelector(
|
|
22
|
+
(state: RootState) => !!state.hmsStates.videoPlugin
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
if (!canPublishVideo || !videoPluginExists) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return <VirtualBackgroundButton style={style} />;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
interface VirtualBackgroundButtonProps {
|
|
33
|
+
style?: StyleProp<ViewStyle>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const VirtualBackgroundButton: React.FC<VirtualBackgroundButtonProps> = ({
|
|
37
|
+
style,
|
|
38
|
+
}) => {
|
|
39
|
+
const { handleModalVisibleType } = useModalType();
|
|
40
|
+
const isLocalVideoMuted = useSelector(
|
|
41
|
+
(state: RootState) => state.hmsStates.isLocalVideoMuted
|
|
42
|
+
);
|
|
43
|
+
const videoPluginExists = useSelector(
|
|
44
|
+
(state: RootState) => !!state.hmsStates.videoPlugin
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
const handleVideoMuteTogglePress = async () => {
|
|
48
|
+
if (isLocalVideoMuted || !videoPluginExists) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
handleModalVisibleType(ModalTypes.VIRTUAL_BACKGROUND);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const cameraIconStyles = useHMSRoomStyle(
|
|
55
|
+
(theme) => ({
|
|
56
|
+
tintColor: isLocalVideoMuted
|
|
57
|
+
? theme.palette.on_surface_low
|
|
58
|
+
: theme.palette.on_surface_high,
|
|
59
|
+
}),
|
|
60
|
+
[isLocalVideoMuted]
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<React.Fragment>
|
|
65
|
+
<PressableIcon
|
|
66
|
+
onPress={handleVideoMuteTogglePress}
|
|
67
|
+
disabled={isLocalVideoMuted}
|
|
68
|
+
style={style}
|
|
69
|
+
>
|
|
70
|
+
<VirtualBackgroundIcon style={cameraIconStyles} />
|
|
71
|
+
</PressableIcon>
|
|
72
|
+
|
|
73
|
+
<VirtualBackgroundBottomSheet />
|
|
74
|
+
</React.Fragment>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
StyleSheet,
|
|
7
7
|
Platform,
|
|
8
8
|
TouchableOpacity,
|
|
9
|
+
Linking,
|
|
9
10
|
} from 'react-native';
|
|
10
11
|
import type { HMSMessage } from '@100mslive/react-native-hms';
|
|
11
12
|
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
@@ -20,6 +21,7 @@ import { PinIcon, ThreeDotsIcon } from '../Icons';
|
|
|
20
21
|
import { setSelectedMessageForAction } from '../redux/actions';
|
|
21
22
|
import { ModalTypes } from '../utils/types';
|
|
22
23
|
import type { RootState } from '../redux';
|
|
24
|
+
import { splitLinksAndContent } from '../utils/functions';
|
|
23
25
|
|
|
24
26
|
interface HMSMessageProps {
|
|
25
27
|
message: HMSMessage;
|
|
@@ -66,6 +68,9 @@ const _HMSOverlayMessageView: React.FC<HMSMessageProps> = ({ message }) => {
|
|
|
66
68
|
pinnedLabel: {
|
|
67
69
|
color: '#ffffff',
|
|
68
70
|
},
|
|
71
|
+
link: {
|
|
72
|
+
color: _theme.palette.primary_bright,
|
|
73
|
+
},
|
|
69
74
|
}),
|
|
70
75
|
[]
|
|
71
76
|
);
|
|
@@ -84,6 +89,13 @@ const _HMSOverlayMessageView: React.FC<HMSMessageProps> = ({ message }) => {
|
|
|
84
89
|
message.sender &&
|
|
85
90
|
message.sender.peerID !== localPeerId); // can remove participants
|
|
86
91
|
|
|
92
|
+
const handleLinkPress = async (url: string) => {
|
|
93
|
+
const canOpen = await Linking.canOpenURL(url);
|
|
94
|
+
if (canOpen) {
|
|
95
|
+
await Linking.openURL(url);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
|
|
87
99
|
return (
|
|
88
100
|
<View style={styles.container}>
|
|
89
101
|
{isPinned ? (
|
|
@@ -126,7 +138,10 @@ const _HMSOverlayMessageView: React.FC<HMSMessageProps> = ({ message }) => {
|
|
|
126
138
|
</View>
|
|
127
139
|
|
|
128
140
|
<Text style={[styles.message, hmsRoomStyles.message]}>
|
|
129
|
-
{message.message
|
|
141
|
+
{splitLinksAndContent(message.message, {
|
|
142
|
+
pressHandler: handleLinkPress,
|
|
143
|
+
style: hmsRoomStyles.link,
|
|
144
|
+
})}
|
|
130
145
|
</Text>
|
|
131
146
|
</View>
|
|
132
147
|
);
|
|
@@ -23,6 +23,7 @@ import { ChangeNameModalContent } from './ChangeNameModalContent';
|
|
|
23
23
|
import { StopRecordingModalContent } from './StopRecordingModalContent';
|
|
24
24
|
import { TestIds } from '../utils/constants';
|
|
25
25
|
import { PollsAndQuizBottomSheet } from './PollsAndQuizBottomSheet';
|
|
26
|
+
import { VirtualBackgroundBottomSheet } from './VirtualBackgroundBottomSheet';
|
|
26
27
|
|
|
27
28
|
interface HMSRoomOptionsProps {}
|
|
28
29
|
|
|
@@ -74,6 +75,8 @@ export const HMSRoomOptions: React.FC<HMSRoomOptionsProps> = () => {
|
|
|
74
75
|
|
|
75
76
|
<PollsAndQuizBottomSheet />
|
|
76
77
|
|
|
78
|
+
<VirtualBackgroundBottomSheet />
|
|
79
|
+
|
|
77
80
|
<BottomSheet
|
|
78
81
|
isVisible={modalVisible === ModalTypes.CHANGE_NAME}
|
|
79
82
|
dismissModal={dismissModal}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useRef, useState, useEffect } from 'react';
|
|
2
|
-
import { StyleSheet, View, Keyboard } from 'react-native';
|
|
2
|
+
import { StyleSheet, View, Keyboard, Platform } from 'react-native';
|
|
3
3
|
import { useSelector } from 'react-redux';
|
|
4
4
|
import {
|
|
5
5
|
Easing,
|
|
@@ -21,6 +21,7 @@ import { useKeyboardState } from '../hooks-util';
|
|
|
21
21
|
import { HMSStatusBar } from './StatusBar';
|
|
22
22
|
import { AnimatedFooter } from './AnimatedFooter';
|
|
23
23
|
import { AnimatedHeader } from './AnimatedHeader';
|
|
24
|
+
import { useIsLandscapeOrientation } from '../utils/dimension';
|
|
24
25
|
// import { ReconnectionView } from './ReconnectionView';
|
|
25
26
|
|
|
26
27
|
interface MeetingScreenContentProps {
|
|
@@ -33,9 +34,14 @@ export const MeetingScreenContent: React.FC<MeetingScreenContentProps> = ({
|
|
|
33
34
|
const offset = useSharedValue(1);
|
|
34
35
|
const timerIdRef = useRef<NodeJS.Timeout | null>(null);
|
|
35
36
|
const [controlsHidden, setControlsHidden] = useState(false);
|
|
37
|
+
const isLandscapeOrientation = useIsLandscapeOrientation();
|
|
36
38
|
const isPipModeActive = useSelector(
|
|
37
39
|
(state: RootState) => state.app.pipModeStatus === PipModes.ACTIVE
|
|
38
40
|
);
|
|
41
|
+
const whiteboardActive =
|
|
42
|
+
Platform.OS === 'android'
|
|
43
|
+
? useSelector((state: RootState) => !!state.hmsStates.whiteboard)
|
|
44
|
+
: null;
|
|
39
45
|
const { keyboardState } = useKeyboardState();
|
|
40
46
|
|
|
41
47
|
const dismissKeyboard = useCallback(() => {
|
|
@@ -75,9 +81,28 @@ export const MeetingScreenContent: React.FC<MeetingScreenContentProps> = ({
|
|
|
75
81
|
[dismissKeyboard, clearTimer]
|
|
76
82
|
);
|
|
77
83
|
|
|
84
|
+
if (
|
|
85
|
+
!!whiteboardActive &&
|
|
86
|
+
(isLandscapeOrientation ? offset.value === 1 : offset.value < 1)
|
|
87
|
+
) {
|
|
88
|
+
cancelAnimation(offset);
|
|
89
|
+
offset.value = withTiming(
|
|
90
|
+
isLandscapeOrientation ? 0 : 1,
|
|
91
|
+
{ duration: 200, easing: Easing.ease },
|
|
92
|
+
(finished) => {
|
|
93
|
+
if (finished) {
|
|
94
|
+
runOnJS(setControlsHidden)(offset.value === 0);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
78
100
|
// Handles Auto hiding the controls for the first time
|
|
79
101
|
// to make this feature discoverable
|
|
80
102
|
useEffect(() => {
|
|
103
|
+
if (!!whiteboardActive) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
81
106
|
clearTimer();
|
|
82
107
|
timerIdRef.current = setTimeout(() => {
|
|
83
108
|
timerIdRef.current = null;
|
|
@@ -85,9 +110,10 @@ export const MeetingScreenContent: React.FC<MeetingScreenContentProps> = ({
|
|
|
85
110
|
}, HeaderFooterHideDelayMs);
|
|
86
111
|
|
|
87
112
|
return clearTimer;
|
|
88
|
-
}, [clearTimer, toggleControls]);
|
|
113
|
+
}, [clearTimer, toggleControls, !!whiteboardActive]);
|
|
89
114
|
|
|
90
115
|
const tapGesture = Gesture.Tap()
|
|
116
|
+
.enabled(Platform.select({ android: !whiteboardActive, default: true }))
|
|
91
117
|
.onEnd(() => toggleControls())
|
|
92
118
|
.requireExternalGestureToFail();
|
|
93
119
|
|
|
@@ -37,6 +37,7 @@ import { hexToRgbA } from '../utils/theme';
|
|
|
37
37
|
import { HMSManageNoiseCancellation } from './HMSManageNoiseCancellation';
|
|
38
38
|
import { useSelector } from 'react-redux';
|
|
39
39
|
import type { RootState } from '../redux';
|
|
40
|
+
import { HMSManageVirtualBackground } from './HMSManageVirtualBackground';
|
|
40
41
|
|
|
41
42
|
const backButtonEdges = ['top'] as const;
|
|
42
43
|
const headerEdges = ['top', 'left', 'right'] as const;
|
|
@@ -174,11 +175,17 @@ export const Preview = ({
|
|
|
174
175
|
<View style={styles.micAndCameraControls}>
|
|
175
176
|
<HMSManageLocalAudio />
|
|
176
177
|
|
|
177
|
-
<
|
|
178
|
-
|
|
179
|
-
|
|
178
|
+
<HMSManageLocalVideo
|
|
179
|
+
style={styles.manageLocalButtonWrapper}
|
|
180
|
+
/>
|
|
180
181
|
|
|
181
|
-
<HMSManageCameraRotation
|
|
182
|
+
<HMSManageCameraRotation
|
|
183
|
+
style={styles.manageLocalButtonWrapper}
|
|
184
|
+
/>
|
|
185
|
+
|
|
186
|
+
<HMSManageVirtualBackground
|
|
187
|
+
style={styles.manageLocalButtonWrapper}
|
|
188
|
+
/>
|
|
182
189
|
</View>
|
|
183
190
|
|
|
184
191
|
{showNoiseCancellationButton && <HMSManageNoiseCancellation />}
|
|
@@ -242,7 +249,7 @@ const styles = StyleSheet.create({
|
|
|
242
249
|
alignItems: 'center',
|
|
243
250
|
},
|
|
244
251
|
manageLocalButtonWrapper: {
|
|
245
|
-
|
|
252
|
+
marginLeft: 16,
|
|
246
253
|
},
|
|
247
254
|
joinButtonRow: {
|
|
248
255
|
marginVertical: 16,
|
|
@@ -3,7 +3,7 @@ import { View, StyleSheet, Text, TouchableOpacity } from 'react-native';
|
|
|
3
3
|
import type { TouchableOpacityProps } from 'react-native';
|
|
4
4
|
import type { HMSAudioMixingMode } from '@100mslive/react-native-hms';
|
|
5
5
|
import { HMSRecordingState } from '@100mslive/react-native-hms';
|
|
6
|
-
import { useSelector } from 'react-redux';
|
|
6
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
7
7
|
|
|
8
8
|
import type { RootState } from '../redux';
|
|
9
9
|
import { ModalTypes } from '../utils/types';
|
|
@@ -16,12 +16,14 @@ import {
|
|
|
16
16
|
PollVoteIcon,
|
|
17
17
|
RecordingIcon,
|
|
18
18
|
ScreenShareIcon,
|
|
19
|
+
VirtualBackgroundIcon,
|
|
19
20
|
WaveIcon,
|
|
20
21
|
} from '../Icons';
|
|
21
22
|
import { BottomSheet, useBottomSheetActions } from './BottomSheet';
|
|
22
23
|
import {
|
|
23
24
|
isPublishingAllowed,
|
|
24
25
|
useHMSConferencingScreenConfig,
|
|
26
|
+
useHMSInstance,
|
|
25
27
|
useHMSLayoutConfig,
|
|
26
28
|
useHMSRoomColorPalette,
|
|
27
29
|
useHMSRoomStyleSheet,
|
|
@@ -38,6 +40,8 @@ import { RoomSettingsModalDebugModeContent } from './RoomSettingsModalDebugModeC
|
|
|
38
40
|
import { ParticipantsCount } from './ParticipantsCount';
|
|
39
41
|
import { selectAllowedTracksToPublish } from '../hooks-sdk-selectors';
|
|
40
42
|
import { TestIds } from '../utils/constants';
|
|
43
|
+
import { addNotification } from '../redux/actions';
|
|
44
|
+
import { NotificationTypes } from '../types';
|
|
41
45
|
|
|
42
46
|
interface RoomSettingsModalContentProps {
|
|
43
47
|
newAudioMixingMode: HMSAudioMixingMode;
|
|
@@ -56,6 +60,8 @@ export const RoomSettingsModalContent: React.FC<
|
|
|
56
60
|
> = (props) => {
|
|
57
61
|
const { closeRoomSettingsModal, setModalVisible } = props;
|
|
58
62
|
|
|
63
|
+
const hmsInstance = useHMSInstance();
|
|
64
|
+
const dispatch = useDispatch();
|
|
59
65
|
const debugMode = useSelector((state: RootState) => state.user.debugMode);
|
|
60
66
|
|
|
61
67
|
const hmsActions = useHMSActions();
|
|
@@ -76,6 +82,10 @@ export const RoomSettingsModalContent: React.FC<
|
|
|
76
82
|
return permissions?.pollRead || permissions?.pollWrite;
|
|
77
83
|
});
|
|
78
84
|
|
|
85
|
+
const whiteboardAdminPermission = useSelector((state: RootState) => {
|
|
86
|
+
return !!state.hmsStates.localPeer?.role?.permissions?.whiteboard?.admin;
|
|
87
|
+
});
|
|
88
|
+
|
|
79
89
|
const { registerOnModalHideAction } = useBottomSheetActions();
|
|
80
90
|
|
|
81
91
|
const { canShowParticipants, show } = useShowChatAndParticipants();
|
|
@@ -252,6 +262,27 @@ export const RoomSettingsModalContent: React.FC<
|
|
|
252
262
|
};
|
|
253
263
|
// #endregion
|
|
254
264
|
|
|
265
|
+
// #region Virtual Background
|
|
266
|
+
const videoPlugin = useSelector(
|
|
267
|
+
(state: RootState) => state.hmsStates.videoPlugin
|
|
268
|
+
);
|
|
269
|
+
const isLocalVideoMuted = useSelector(
|
|
270
|
+
(state: RootState) => state.hmsStates.isLocalVideoMuted
|
|
271
|
+
);
|
|
272
|
+
const virtualBackgroundApplied = useSelector(
|
|
273
|
+
(state: RootState) => state.app.selectedVirtualBackground !== null
|
|
274
|
+
);
|
|
275
|
+
const handleVirtualBackground = () => {
|
|
276
|
+
// Register callback to be called when bottom sheet is hiddden
|
|
277
|
+
registerOnModalHideAction(() => {
|
|
278
|
+
if (!videoPlugin || isLocalVideoMuted) return;
|
|
279
|
+
setModalVisible(ModalTypes.VIRTUAL_BACKGROUND);
|
|
280
|
+
});
|
|
281
|
+
// Close the current bottom sheet
|
|
282
|
+
closeRoomSettingsModal();
|
|
283
|
+
};
|
|
284
|
+
// #endregion
|
|
285
|
+
|
|
255
286
|
const changeName = () => {
|
|
256
287
|
// Register callback to be called when bottom sheet is hiddden
|
|
257
288
|
registerOnModalHideAction(() => {
|
|
@@ -271,6 +302,61 @@ export const RoomSettingsModalContent: React.FC<
|
|
|
271
302
|
closeRoomSettingsModal();
|
|
272
303
|
};
|
|
273
304
|
|
|
305
|
+
const whiteboard = useSelector(
|
|
306
|
+
(state: RootState) => state.hmsStates.whiteboard
|
|
307
|
+
);
|
|
308
|
+
const screenShareNodesAvailable = useSelector(
|
|
309
|
+
(state: RootState) => state.app.screensharePeerTrackNodes.length > 0
|
|
310
|
+
);
|
|
311
|
+
|
|
312
|
+
const toggleWhiteboard = async () => {
|
|
313
|
+
if (!whiteboardAdminPermission) return;
|
|
314
|
+
|
|
315
|
+
if (whiteboard && whiteboard.isOwner) {
|
|
316
|
+
hmsInstance.interactivityCenter
|
|
317
|
+
.stopWhiteboard()
|
|
318
|
+
.then((success) => {
|
|
319
|
+
console.log('#stopWhiteboard stopped whiteboard ', success);
|
|
320
|
+
})
|
|
321
|
+
.catch((error) => {
|
|
322
|
+
console.log('#stopWhiteboard error ', error);
|
|
323
|
+
});
|
|
324
|
+
} else if (whiteboard && !whiteboard.isOwner) {
|
|
325
|
+
const uid = Math.random().toString(16).slice(2);
|
|
326
|
+
dispatch(
|
|
327
|
+
addNotification({
|
|
328
|
+
id: uid,
|
|
329
|
+
type: NotificationTypes.ERROR,
|
|
330
|
+
title:
|
|
331
|
+
'Only the peer who started the whiteboard has the ability to close it!',
|
|
332
|
+
})
|
|
333
|
+
);
|
|
334
|
+
} else if (isLocalScreenShared || screenShareNodesAvailable) {
|
|
335
|
+
const uid = Math.random().toString(16).slice(2);
|
|
336
|
+
dispatch(
|
|
337
|
+
addNotification({
|
|
338
|
+
id: uid,
|
|
339
|
+
type: NotificationTypes.ERROR,
|
|
340
|
+
title: isLocalScreenShared
|
|
341
|
+
? 'Discontinue screenshare to open the whiteboard!'
|
|
342
|
+
: "Can't open whiteboard while screenshare is happening!",
|
|
343
|
+
})
|
|
344
|
+
);
|
|
345
|
+
} else {
|
|
346
|
+
hmsInstance.interactivityCenter
|
|
347
|
+
.startWhiteboard('Interactive Session')
|
|
348
|
+
.then((success) => {
|
|
349
|
+
console.log('#startWhiteboard started whiteboard ', success);
|
|
350
|
+
})
|
|
351
|
+
.catch((error) => {
|
|
352
|
+
console.log('#startWhiteboard error ', error);
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
// Close the current bottom sheet
|
|
357
|
+
closeRoomSettingsModal();
|
|
358
|
+
};
|
|
359
|
+
|
|
274
360
|
const canShowBRB = useHMSLayoutConfig(
|
|
275
361
|
(layoutConfig) =>
|
|
276
362
|
!!layoutConfig?.screens?.conferencing?.default?.elements?.brb
|
|
@@ -394,6 +480,17 @@ export const RoomSettingsModalContent: React.FC<
|
|
|
394
480
|
isActive: false,
|
|
395
481
|
hide: !canReadOrWritePoll,
|
|
396
482
|
},
|
|
483
|
+
{
|
|
484
|
+
id: 'whiteboard',
|
|
485
|
+
icon: (
|
|
486
|
+
<PencilIcon type="board" style={{ width: 20, height: 20 }} />
|
|
487
|
+
),
|
|
488
|
+
label: whiteboard ? 'Close Whiteboard' : 'Open Whiteboard',
|
|
489
|
+
pressHandler: toggleWhiteboard,
|
|
490
|
+
isActive: !!whiteboard && whiteboard.isOwner,
|
|
491
|
+
disabled: !!whiteboard && !whiteboard.isOwner,
|
|
492
|
+
hide: !whiteboardAdminPermission,
|
|
493
|
+
},
|
|
397
494
|
{
|
|
398
495
|
id: 'noise-cancellation',
|
|
399
496
|
icon: <WaveIcon style={{ width: 20, height: 20 }} />,
|
|
@@ -405,6 +502,15 @@ export const RoomSettingsModalContent: React.FC<
|
|
|
405
502
|
hide: !showNoiseCancellationButton,
|
|
406
503
|
disabled: isLocalAudioMuted,
|
|
407
504
|
},
|
|
505
|
+
{
|
|
506
|
+
id: 'virtual-background',
|
|
507
|
+
icon: <VirtualBackgroundIcon style={{ width: 20, height: 20 }} />,
|
|
508
|
+
label: 'Virtual Background',
|
|
509
|
+
pressHandler: handleVirtualBackground,
|
|
510
|
+
isActive: virtualBackgroundApplied,
|
|
511
|
+
hide: !videoPlugin,
|
|
512
|
+
disabled: isLocalVideoMuted,
|
|
513
|
+
},
|
|
408
514
|
].filter((itm) => !itm.hide),
|
|
409
515
|
true
|
|
410
516
|
).map((itm, idx) => {
|
|
@@ -458,7 +564,7 @@ type SettingItemProps = {
|
|
|
458
564
|
onPress(): void;
|
|
459
565
|
disabled?: TouchableOpacityProps['disabled'];
|
|
460
566
|
testID?: TouchableOpacityProps['testID'];
|
|
461
|
-
isActive?: boolean;
|
|
567
|
+
isActive?: boolean | null;
|
|
462
568
|
};
|
|
463
569
|
|
|
464
570
|
const SettingItem: React.FC<SettingItemProps> = ({
|
|
@@ -25,13 +25,15 @@ const _TilesContainer: React.FC<TilesContainerProps> = ({
|
|
|
25
25
|
const { width: safeWidth } = useSafeAreaFrame();
|
|
26
26
|
const isLandscapeOrientation = useIsLandscapeOrientation();
|
|
27
27
|
|
|
28
|
-
const
|
|
29
|
-
(state: RootState) =>
|
|
28
|
+
const screenshareTilesOrWhiteboardAcive = useSelector(
|
|
29
|
+
(state: RootState) =>
|
|
30
|
+
state.app.screensharePeerTrackNodes.length > 0 ||
|
|
31
|
+
!!state.hmsStates.whiteboard
|
|
30
32
|
);
|
|
31
33
|
|
|
32
34
|
const stylesConfig = computeTileWidthAndHeight(peerTrackNodes.length, {
|
|
33
35
|
isLandscapeOrientation,
|
|
34
|
-
type:
|
|
36
|
+
type: screenshareTilesOrWhiteboardAcive ? 'row' : 'default',
|
|
35
37
|
});
|
|
36
38
|
|
|
37
39
|
// In this layout, Tile will take as much height and width as possible
|
|
@@ -44,12 +46,12 @@ const _TilesContainer: React.FC<TilesContainerProps> = ({
|
|
|
44
46
|
// If tile are growable, then we want whatever remaining space to be between them
|
|
45
47
|
{
|
|
46
48
|
justifyContent:
|
|
47
|
-
|
|
49
|
+
screenshareTilesOrWhiteboardAcive && peerTrackNodes.length === 1
|
|
48
50
|
? 'center'
|
|
49
51
|
: growableTileLayout
|
|
50
52
|
? 'space-between'
|
|
51
53
|
: 'center',
|
|
52
|
-
flexDirection:
|
|
54
|
+
flexDirection: screenshareTilesOrWhiteboardAcive
|
|
53
55
|
? 'row'
|
|
54
56
|
: isLandscapeOrientation
|
|
55
57
|
? 'row'
|