@100mslive/react-native-room-kit 1.1.6 → 1.1.8
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/HMSRoomSetup.js +8 -0
- package/lib/commonjs/HMSRoomSetup.js.map +1 -1
- package/lib/commonjs/Icons/Pause/assets/pause-med.png +0 -0
- package/lib/commonjs/Icons/Pause/assets/pause-med@2x.png +0 -0
- package/lib/commonjs/Icons/Pause/assets/pause-med@3x.png +0 -0
- package/lib/commonjs/Icons/Pause/index.js +35 -0
- package/lib/commonjs/Icons/Pause/index.js.map +1 -0
- 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/Play/assets/play-med.png +0 -0
- package/lib/commonjs/Icons/Play/assets/play-med@2x.png +0 -0
- package/lib/commonjs/Icons/Play/assets/play-med@3x.png +0 -0
- package/lib/commonjs/Icons/Play/index.js +35 -0
- package/lib/commonjs/Icons/Play/index.js.map +1 -0
- package/lib/commonjs/Icons/SeekArrow/assets/seek-backward-arrow.png +0 -0
- package/lib/commonjs/Icons/SeekArrow/assets/seek-backward-arrow@2x.png +0 -0
- package/lib/commonjs/Icons/SeekArrow/assets/seek-backward-arrow@3x.png +0 -0
- package/lib/commonjs/Icons/SeekArrow/assets/seek-forward-arrow.png +0 -0
- package/lib/commonjs/Icons/SeekArrow/assets/seek-forward-arrow@2x.png +0 -0
- package/lib/commonjs/Icons/SeekArrow/assets/seek-forward-arrow@3x.png +0 -0
- package/lib/commonjs/Icons/SeekArrow/index.js +34 -0
- package/lib/commonjs/Icons/SeekArrow/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/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/HLSChatMessages.js +4 -5
- package/lib/commonjs/components/HLSChatMessages.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/HLSCloseMeetingControl.js +41 -0
- package/lib/commonjs/components/HLSCloseMeetingControl.js.map +1 -0
- package/lib/commonjs/components/HLSClosedCaptionControl.js +109 -0
- package/lib/commonjs/components/HLSClosedCaptionControl.js.map +1 -0
- package/lib/commonjs/components/HLSDistanceFromLive.js +56 -0
- package/lib/commonjs/components/HLSDistanceFromLive.js.map +1 -0
- package/lib/commonjs/components/HLSFullScreenControl.js +42 -0
- package/lib/commonjs/components/HLSFullScreenControl.js.map +1 -0
- package/lib/commonjs/components/HLSGoLiveControl.js +78 -0
- package/lib/commonjs/components/HLSGoLiveControl.js.map +1 -0
- package/lib/commonjs/components/HLSPlayPauseControl.js +62 -0
- package/lib/commonjs/components/HLSPlayPauseControl.js.map +1 -0
- package/lib/commonjs/components/HLSPlayer.js +82 -81
- package/lib/commonjs/components/HLSPlayer.js.map +1 -1
- package/lib/commonjs/components/HLSPlayerContainer.js +65 -3
- package/lib/commonjs/components/HLSPlayerContainer.js.map +1 -1
- package/lib/commonjs/components/HLSPlayerControls.js +89 -46
- package/lib/commonjs/components/HLSPlayerControls.js.map +1 -1
- package/lib/commonjs/components/HLSSeekbackwardControl.js +67 -0
- package/lib/commonjs/components/HLSSeekbackwardControl.js.map +1 -0
- package/lib/commonjs/components/HLSSeekbar.js +285 -0
- package/lib/commonjs/components/HLSSeekbar.js.map +1 -0
- package/lib/commonjs/components/HLSSeekforwardControl.js +71 -0
- package/lib/commonjs/components/HLSSeekforwardControl.js.map +1 -0
- package/lib/commonjs/components/HMSHLSMessage.js +19 -41
- package/lib/commonjs/components/HMSHLSMessage.js.map +1 -1
- package/lib/commonjs/components/HMSHLSMessageList.js +2 -2
- package/lib/commonjs/components/HMSHLSMessageList.js.map +1 -1
- package/lib/commonjs/components/HMSOverlayMessageView.js +150 -0
- package/lib/commonjs/components/HMSOverlayMessageView.js.map +1 -0
- package/lib/commonjs/components/MeetingScreenContent.js +22 -2
- package/lib/commonjs/components/MeetingScreenContent.js.map +1 -1
- package/lib/commonjs/components/Participants/ParticipantsList.js +4 -4
- package/lib/commonjs/components/Participants/ParticipantsList.js.map +1 -1
- package/lib/commonjs/components/RoomSettingsModalContent.js +63 -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/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 +66 -8
- package/lib/commonjs/hooks-util.js.map +1 -1
- package/lib/commonjs/redux/actionTypes.js +5 -0
- package/lib/commonjs/redux/actionTypes.js.map +1 -1
- package/lib/commonjs/redux/actions/index.js +22 -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 +7 -1
- package/lib/commonjs/redux/reducers/hmsStates.js.map +1 -1
- package/lib/module/HMSRoomSetup.js +10 -2
- package/lib/module/HMSRoomSetup.js.map +1 -1
- package/lib/module/Icons/Pause/assets/pause-med.png +0 -0
- package/lib/module/Icons/Pause/assets/pause-med@2x.png +0 -0
- package/lib/module/Icons/Pause/assets/pause-med@3x.png +0 -0
- package/lib/module/Icons/Pause/index.js +27 -0
- package/lib/module/Icons/Pause/index.js.map +1 -0
- 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/Play/assets/play-med.png +0 -0
- package/lib/module/Icons/Play/assets/play-med@2x.png +0 -0
- package/lib/module/Icons/Play/assets/play-med@3x.png +0 -0
- package/lib/module/Icons/Play/index.js +27 -0
- package/lib/module/Icons/Play/index.js.map +1 -0
- package/lib/module/Icons/SeekArrow/assets/seek-backward-arrow.png +0 -0
- package/lib/module/Icons/SeekArrow/assets/seek-backward-arrow@2x.png +0 -0
- package/lib/module/Icons/SeekArrow/assets/seek-backward-arrow@3x.png +0 -0
- package/lib/module/Icons/SeekArrow/assets/seek-forward-arrow.png +0 -0
- package/lib/module/Icons/SeekArrow/assets/seek-forward-arrow@2x.png +0 -0
- package/lib/module/Icons/SeekArrow/assets/seek-forward-arrow@3x.png +0 -0
- package/lib/module/Icons/SeekArrow/index.js +26 -0
- package/lib/module/Icons/SeekArrow/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/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/HLSChatMessages.js +5 -6
- package/lib/module/components/HLSChatMessages.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/HLSCloseMeetingControl.js +33 -0
- package/lib/module/components/HLSCloseMeetingControl.js.map +1 -0
- package/lib/module/components/HLSClosedCaptionControl.js +100 -0
- package/lib/module/components/HLSClosedCaptionControl.js.map +1 -0
- package/lib/module/components/HLSDistanceFromLive.js +48 -0
- package/lib/module/components/HLSDistanceFromLive.js.map +1 -0
- package/lib/module/components/HLSFullScreenControl.js +34 -0
- package/lib/module/components/HLSFullScreenControl.js.map +1 -0
- package/lib/module/components/HLSGoLiveControl.js +70 -0
- package/lib/module/components/HLSGoLiveControl.js.map +1 -0
- package/lib/module/components/HLSPlayPauseControl.js +54 -0
- package/lib/module/components/HLSPlayPauseControl.js.map +1 -0
- package/lib/module/components/HLSPlayer.js +83 -81
- package/lib/module/components/HLSPlayer.js.map +1 -1
- package/lib/module/components/HLSPlayerContainer.js +65 -3
- package/lib/module/components/HLSPlayerContainer.js.map +1 -1
- package/lib/module/components/HLSPlayerControls.js +89 -50
- package/lib/module/components/HLSPlayerControls.js.map +1 -1
- package/lib/module/components/HLSSeekbackwardControl.js +59 -0
- package/lib/module/components/HLSSeekbackwardControl.js.map +1 -0
- package/lib/module/components/HLSSeekbar.js +276 -0
- package/lib/module/components/HLSSeekbar.js.map +1 -0
- package/lib/module/components/HLSSeekforwardControl.js +63 -0
- package/lib/module/components/HLSSeekforwardControl.js.map +1 -0
- package/lib/module/components/HMSHLSMessage.js +19 -41
- package/lib/module/components/HMSHLSMessage.js.map +1 -1
- package/lib/module/components/HMSHLSMessageList.js +2 -2
- package/lib/module/components/HMSHLSMessageList.js.map +1 -1
- package/lib/module/components/HMSOverlayMessageView.js +142 -0
- package/lib/module/components/HMSOverlayMessageView.js.map +1 -0
- package/lib/module/components/MeetingScreenContent.js +23 -3
- package/lib/module/components/MeetingScreenContent.js.map +1 -1
- package/lib/module/components/Participants/ParticipantsList.js +4 -4
- package/lib/module/components/Participants/ParticipantsList.js.map +1 -1
- package/lib/module/components/RoomSettingsModalContent.js +65 -8
- 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/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 +66 -9
- package/lib/module/hooks-util.js.map +1 -1
- package/lib/module/redux/actionTypes.js +5 -0
- package/lib/module/redux/actionTypes.js.map +1 -1
- package/lib/module/redux/actions/index.js +16 -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 +7 -1
- package/lib/module/redux/reducers/hmsStates.js.map +1 -1
- package/lib/typescript/HMSRoomSetup.d.ts.map +1 -1
- package/lib/typescript/Icons/Pause/index.d.ts +8 -0
- package/lib/typescript/Icons/Pause/index.d.ts.map +1 -0
- 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/Play/index.d.ts +8 -0
- package/lib/typescript/Icons/Play/index.d.ts.map +1 -0
- package/lib/typescript/Icons/SeekArrow/index.d.ts +8 -0
- package/lib/typescript/Icons/SeekArrow/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/CustomButton.d.ts +5 -5
- package/lib/typescript/components/CustomButton.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/HLSChatMessages.d.ts.map +1 -1
- package/lib/typescript/components/HLSChatView.d.ts.map +1 -1
- package/lib/typescript/components/HLSCloseMeetingControl.d.ts +8 -0
- package/lib/typescript/components/HLSCloseMeetingControl.d.ts.map +1 -0
- package/lib/typescript/components/HLSClosedCaptionControl.d.ts +10 -0
- package/lib/typescript/components/HLSClosedCaptionControl.d.ts.map +1 -0
- package/lib/typescript/components/HLSDistanceFromLive.d.ts +8 -0
- package/lib/typescript/components/HLSDistanceFromLive.d.ts.map +1 -0
- package/lib/typescript/components/HLSFullScreenControl.d.ts +8 -0
- package/lib/typescript/components/HLSFullScreenControl.d.ts.map +1 -0
- package/lib/typescript/components/HLSGoLiveControl.d.ts +10 -0
- package/lib/typescript/components/HLSGoLiveControl.d.ts.map +1 -0
- package/lib/typescript/components/HLSPlayPauseControl.d.ts +8 -0
- package/lib/typescript/components/HLSPlayPauseControl.d.ts.map +1 -0
- package/lib/typescript/components/HLSPlayer.d.ts +4 -2
- package/lib/typescript/components/HLSPlayer.d.ts.map +1 -1
- package/lib/typescript/components/HLSPlayerContainer.d.ts.map +1 -1
- package/lib/typescript/components/HLSPlayerControls.d.ts +12 -2
- package/lib/typescript/components/HLSPlayerControls.d.ts.map +1 -1
- package/lib/typescript/components/HLSSeekbackwardControl.d.ts +8 -0
- package/lib/typescript/components/HLSSeekbackwardControl.d.ts.map +1 -0
- package/lib/typescript/components/HLSSeekbar.d.ts +66 -0
- package/lib/typescript/components/HLSSeekbar.d.ts.map +1 -0
- package/lib/typescript/components/HLSSeekforwardControl.d.ts +8 -0
- package/lib/typescript/components/HLSSeekforwardControl.d.ts.map +1 -0
- package/lib/typescript/components/HMSHLSMessage.d.ts.map +1 -1
- package/lib/typescript/components/HMSOverlayMessageView.d.ts +8 -0
- package/lib/typescript/components/HMSOverlayMessageView.d.ts.map +1 -0
- package/lib/typescript/components/MeetingScreenContent.d.ts.map +1 -1
- package/lib/typescript/components/Modals.d.ts +3 -3
- package/lib/typescript/components/Modals.d.ts.map +1 -1
- package/lib/typescript/components/Participants/ParticipantsList.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/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 +12 -7
- package/lib/typescript/hooks-util.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 +17 -1
- package/lib/typescript/redux/actions/index.d.ts.map +1 -1
- package/lib/typescript/redux/index.d.ts +19 -16
- 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 +7 -2
- package/lib/typescript/redux/reducers/hmsStates.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/index.d.ts +19 -16
- package/lib/typescript/redux/reducers/index.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/HMSRoomSetup.tsx +21 -0
- package/src/Icons/Pause/assets/pause-med.png +0 -0
- package/src/Icons/Pause/assets/pause-med@2x.png +0 -0
- package/src/Icons/Pause/assets/pause-med@3x.png +0 -0
- package/src/Icons/Pause/index.tsx +36 -0
- 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/Play/assets/play-med.png +0 -0
- package/src/Icons/Play/assets/play-med@2x.png +0 -0
- package/src/Icons/Play/assets/play-med@3x.png +0 -0
- package/src/Icons/Play/index.tsx +36 -0
- package/src/Icons/SeekArrow/assets/seek-backward-arrow.png +0 -0
- package/src/Icons/SeekArrow/assets/seek-backward-arrow@2x.png +0 -0
- package/src/Icons/SeekArrow/assets/seek-backward-arrow@3x.png +0 -0
- package/src/Icons/SeekArrow/assets/seek-forward-arrow.png +0 -0
- package/src/Icons/SeekArrow/assets/seek-forward-arrow@2x.png +0 -0
- package/src/Icons/SeekArrow/assets/seek-forward-arrow@3x.png +0 -0
- package/src/Icons/SeekArrow/index.tsx +40 -0
- package/src/Icons/index.ts +3 -0
- 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/HLSChatMessages.tsx +4 -6
- package/src/components/HLSChatView.tsx +7 -4
- package/src/components/HLSCloseMeetingControl.tsx +39 -0
- package/src/components/HLSClosedCaptionControl.tsx +140 -0
- package/src/components/HLSDistanceFromLive.tsx +69 -0
- package/src/components/HLSFullScreenControl.tsx +46 -0
- package/src/components/HLSGoLiveControl.tsx +104 -0
- package/src/components/HLSPlayPauseControl.tsx +69 -0
- package/src/components/HLSPlayer.tsx +98 -88
- package/src/components/HLSPlayerContainer.tsx +89 -14
- package/src/components/HLSPlayerControls.tsx +137 -58
- package/src/components/HLSSeekbackwardControl.tsx +88 -0
- package/src/components/HLSSeekbar.tsx +381 -0
- package/src/components/HLSSeekforwardControl.tsx +97 -0
- package/src/components/HMSHLSMessage.tsx +32 -49
- package/src/components/HMSHLSMessageList.tsx +2 -2
- package/src/components/HMSOverlayMessageView.tsx +189 -0
- package/src/components/MeetingScreenContent.tsx +28 -2
- package/src/components/Participants/ParticipantsList.tsx +12 -10
- package/src/components/RoomSettingsModalContent.tsx +77 -2
- package/src/components/TilesContainer.tsx +7 -5
- 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 +80 -10
- package/src/redux/actionTypes.ts +7 -0
- package/src/redux/actions/index.ts +16 -0
- package/src/redux/reducers/appState.ts +16 -0
- package/src/redux/reducers/hmsStates.ts +15 -1
- package/lib/commonjs/components/CustomHLSPlayerControls.js +0 -80
- package/lib/commonjs/components/CustomHLSPlayerControls.js.map +0 -1
- package/lib/module/components/CustomHLSPlayerControls.js +0 -72
- package/lib/module/components/CustomHLSPlayerControls.js.map +0 -1
- package/lib/typescript/components/CustomHLSPlayerControls.d.ts +0 -7
- package/lib/typescript/components/CustomHLSPlayerControls.d.ts.map +0 -1
- package/src/components/CustomHLSPlayerControls.tsx +0 -92
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
3
|
+
import {
|
|
4
|
+
View,
|
|
5
|
+
Text,
|
|
6
|
+
StyleSheet,
|
|
7
|
+
Platform,
|
|
8
|
+
TouchableOpacity,
|
|
9
|
+
} from 'react-native';
|
|
10
|
+
import type { HMSMessage } from '@100mslive/react-native-hms';
|
|
11
|
+
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
12
|
+
|
|
13
|
+
import {
|
|
14
|
+
useAllowBlockingPeerFromChat,
|
|
15
|
+
useAllowPinningMessage,
|
|
16
|
+
useHMSRoomStyleSheet,
|
|
17
|
+
useModalType,
|
|
18
|
+
} from '../hooks-util';
|
|
19
|
+
import { PinIcon, ThreeDotsIcon } from '../Icons';
|
|
20
|
+
import { setSelectedMessageForAction } from '../redux/actions';
|
|
21
|
+
import { ModalTypes } from '../utils/types';
|
|
22
|
+
import type { RootState } from '../redux';
|
|
23
|
+
|
|
24
|
+
interface HMSMessageProps {
|
|
25
|
+
message: HMSMessage;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const _HMSOverlayMessageView: React.FC<HMSMessageProps> = ({ message }) => {
|
|
29
|
+
const dispatch = useDispatch();
|
|
30
|
+
const { handleModalVisibleType } = useModalType();
|
|
31
|
+
const localPeerId = useSelector(
|
|
32
|
+
(state: RootState) => state.hmsStates.localPeer?.peerID
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
const allowPinningMessage = useAllowPinningMessage();
|
|
36
|
+
const allowPeerBlocking = useAllowBlockingPeerFromChat();
|
|
37
|
+
const canRemoveOthers = useSelector(
|
|
38
|
+
(state: RootState) =>
|
|
39
|
+
!!state.hmsStates.localPeer?.role?.permissions?.removeOthers
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const isPinned = useSelector(
|
|
43
|
+
(state: RootState) =>
|
|
44
|
+
state.messages.pinnedMessages.findIndex(
|
|
45
|
+
(pinnedMessage) => pinnedMessage.id === message.messageId
|
|
46
|
+
) >= 0
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
const messageSender = message.sender;
|
|
50
|
+
|
|
51
|
+
const hmsRoomStyles = useHMSRoomStyleSheet(
|
|
52
|
+
(_theme, typography) => ({
|
|
53
|
+
senderName: {
|
|
54
|
+
color: '#ffffff',
|
|
55
|
+
fontFamily: `${typography.font_family}-SemiBold`,
|
|
56
|
+
textShadowColor: 'rgba(0, 0, 0, 0.5)',
|
|
57
|
+
},
|
|
58
|
+
message: {
|
|
59
|
+
color: '#ffffff',
|
|
60
|
+
fontFamily: `${typography.font_family}-Regular`,
|
|
61
|
+
textShadowColor: 'rgba(0, 0, 0, 0.5)',
|
|
62
|
+
},
|
|
63
|
+
threeDots: {
|
|
64
|
+
tintColor: '#ffffff',
|
|
65
|
+
},
|
|
66
|
+
pinnedLabel: {
|
|
67
|
+
color: '#ffffff',
|
|
68
|
+
},
|
|
69
|
+
}),
|
|
70
|
+
[]
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
const onThreeDotsPress = () => {
|
|
74
|
+
dispatch(setSelectedMessageForAction(message));
|
|
75
|
+
handleModalVisibleType(ModalTypes.MESSAGE_OPTIONS);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const canTakeAction =
|
|
79
|
+
allowPinningMessage || // can pin message, OR
|
|
80
|
+
(allowPeerBlocking &&
|
|
81
|
+
message.sender &&
|
|
82
|
+
message.sender.peerID !== localPeerId) || // can block peers, OR
|
|
83
|
+
(canRemoveOthers &&
|
|
84
|
+
message.sender &&
|
|
85
|
+
message.sender.peerID !== localPeerId); // can remove participants
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<View style={styles.container}>
|
|
89
|
+
{isPinned ? (
|
|
90
|
+
<View style={styles.pinLabelContainer}>
|
|
91
|
+
<PinIcon
|
|
92
|
+
type="pin"
|
|
93
|
+
style={[styles.pinIcon, hmsRoomStyles.threeDots]}
|
|
94
|
+
/>
|
|
95
|
+
<Text style={[styles.pinnedLabel, hmsRoomStyles.pinnedLabel]}>
|
|
96
|
+
PINNED
|
|
97
|
+
</Text>
|
|
98
|
+
</View>
|
|
99
|
+
) : null}
|
|
100
|
+
|
|
101
|
+
<View style={styles.nameWrapper}>
|
|
102
|
+
<Text
|
|
103
|
+
style={[styles.senderName, hmsRoomStyles.senderName]}
|
|
104
|
+
numberOfLines={1}
|
|
105
|
+
>
|
|
106
|
+
{messageSender
|
|
107
|
+
? messageSender.isLocal
|
|
108
|
+
? 'You'
|
|
109
|
+
: messageSender.name
|
|
110
|
+
: 'Anonymous'}
|
|
111
|
+
</Text>
|
|
112
|
+
|
|
113
|
+
{canTakeAction ? (
|
|
114
|
+
<GestureDetector gesture={Gesture.Tap()}>
|
|
115
|
+
<TouchableOpacity
|
|
116
|
+
hitSlop={styles.threeDotsHitSlop}
|
|
117
|
+
onPress={onThreeDotsPress}
|
|
118
|
+
>
|
|
119
|
+
<ThreeDotsIcon
|
|
120
|
+
stack="vertical"
|
|
121
|
+
style={[styles.threeDots, hmsRoomStyles.threeDots]}
|
|
122
|
+
/>
|
|
123
|
+
</TouchableOpacity>
|
|
124
|
+
</GestureDetector>
|
|
125
|
+
) : null}
|
|
126
|
+
</View>
|
|
127
|
+
|
|
128
|
+
<Text style={[styles.message, hmsRoomStyles.message]}>
|
|
129
|
+
{message.message}
|
|
130
|
+
</Text>
|
|
131
|
+
</View>
|
|
132
|
+
);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export const HMSOverlayMessageView = React.memo(_HMSOverlayMessageView);
|
|
136
|
+
|
|
137
|
+
const styles = StyleSheet.create({
|
|
138
|
+
container: {
|
|
139
|
+
marginTop: 8,
|
|
140
|
+
width: '100%',
|
|
141
|
+
},
|
|
142
|
+
nameWrapper: {
|
|
143
|
+
flexDirection: 'row',
|
|
144
|
+
alignItems: 'center',
|
|
145
|
+
},
|
|
146
|
+
senderName: {
|
|
147
|
+
flexGrow: 1,
|
|
148
|
+
fontSize: 14,
|
|
149
|
+
lineHeight: Platform.OS === 'android' ? 20 : undefined,
|
|
150
|
+
letterSpacing: 0.1,
|
|
151
|
+
textShadowOffset: { height: 1, width: 1 },
|
|
152
|
+
textShadowRadius: 2,
|
|
153
|
+
},
|
|
154
|
+
message: {
|
|
155
|
+
fontSize: 14,
|
|
156
|
+
lineHeight: Platform.OS === 'android' ? 20 : undefined,
|
|
157
|
+
letterSpacing: 0.25,
|
|
158
|
+
marginTop: 2,
|
|
159
|
+
textShadowOffset: { height: 0.5, width: 0.5 },
|
|
160
|
+
textShadowRadius: 2,
|
|
161
|
+
},
|
|
162
|
+
threeDots: {
|
|
163
|
+
width: 20,
|
|
164
|
+
height: 20,
|
|
165
|
+
marginLeft: 4,
|
|
166
|
+
},
|
|
167
|
+
threeDotsHitSlop: {
|
|
168
|
+
left: 12,
|
|
169
|
+
right: 12,
|
|
170
|
+
top: 12,
|
|
171
|
+
bottom: 12,
|
|
172
|
+
},
|
|
173
|
+
pinLabelContainer: {
|
|
174
|
+
flexDirection: 'row',
|
|
175
|
+
alignItems: 'center',
|
|
176
|
+
marginBottom: 4,
|
|
177
|
+
},
|
|
178
|
+
pinIcon: {
|
|
179
|
+
width: 12,
|
|
180
|
+
height: 12,
|
|
181
|
+
marginRight: 4,
|
|
182
|
+
},
|
|
183
|
+
pinnedLabel: {
|
|
184
|
+
fontSize: 10,
|
|
185
|
+
textTransform: 'uppercase',
|
|
186
|
+
lineHeight: 16,
|
|
187
|
+
letterSpacing: 1.5,
|
|
188
|
+
},
|
|
189
|
+
});
|
|
@@ -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
|
|
|
@@ -31,7 +31,7 @@ export const ParticipantsList: React.FC<ParticipantsListProps> = ({
|
|
|
31
31
|
const fetchedInitialDataRef = React.useRef(false);
|
|
32
32
|
const hmsInstance = useHMSInstance();
|
|
33
33
|
|
|
34
|
-
//
|
|
34
|
+
// Current is current selected group and off-stage group
|
|
35
35
|
const isOffStageGroup = useHMSLayoutConfig((layoutConfig) => {
|
|
36
36
|
const offStageRoles =
|
|
37
37
|
layoutConfig?.screens?.conferencing?.default?.elements?.on_stage_exp
|
|
@@ -39,12 +39,12 @@ export const ParticipantsList: React.FC<ParticipantsListProps> = ({
|
|
|
39
39
|
return offStageRoles ? offStageRoles.includes(selectedGroupId) : false;
|
|
40
40
|
});
|
|
41
41
|
|
|
42
|
-
// Getting initial data for the selected group
|
|
43
|
-
const dataForGroupId = useSelector(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
);
|
|
42
|
+
// Getting initial data for the selected group ID
|
|
43
|
+
const dataForGroupId = useSelector((state: RootState) => {
|
|
44
|
+
return selectedGroupId === 'hand-raised'
|
|
45
|
+
? state.hmsStates.groupedParticipants
|
|
46
|
+
: state.hmsStates.groupedParticipants[selectedGroupId];
|
|
47
|
+
});
|
|
48
48
|
|
|
49
49
|
const finalDataForGroupId = React.useMemo(() => {
|
|
50
50
|
if (Array.isArray(dataForGroupId)) {
|
|
@@ -52,7 +52,9 @@ export const ParticipantsList: React.FC<ParticipantsListProps> = ({
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
if (dataForGroupId && selectedGroupId === 'hand-raised') {
|
|
55
|
-
return Object.values(dataForGroupId)
|
|
55
|
+
return Object.values(dataForGroupId)
|
|
56
|
+
.flat()
|
|
57
|
+
.filter((peer) => peer.isHandRaised);
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
return null;
|
|
@@ -119,7 +121,7 @@ export const ParticipantsList: React.FC<ParticipantsListProps> = ({
|
|
|
119
121
|
|
|
120
122
|
const filteredSearchText = searchText.trim().toLowerCase();
|
|
121
123
|
|
|
122
|
-
//#region
|
|
124
|
+
//#region FlashList props
|
|
123
125
|
const data = React.useMemo(() => {
|
|
124
126
|
return (isOffStageGroup ? offStageData : dataWithHeader).filter((item) =>
|
|
125
127
|
'id' in item ? true : item.name.toLowerCase().includes(filteredSearchText)
|
|
@@ -186,7 +188,7 @@ export const ParticipantsList: React.FC<ParticipantsListProps> = ({
|
|
|
186
188
|
});
|
|
187
189
|
}
|
|
188
190
|
}, [loading, peerListIterator]);
|
|
189
|
-
//#endregion
|
|
191
|
+
//#endregion FlashList props
|
|
190
192
|
|
|
191
193
|
const searchTextExists = searchText.length > 0;
|
|
192
194
|
|
|
@@ -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';
|
|
@@ -22,6 +22,7 @@ import { BottomSheet, useBottomSheetActions } from './BottomSheet';
|
|
|
22
22
|
import {
|
|
23
23
|
isPublishingAllowed,
|
|
24
24
|
useHMSConferencingScreenConfig,
|
|
25
|
+
useHMSInstance,
|
|
25
26
|
useHMSLayoutConfig,
|
|
26
27
|
useHMSRoomColorPalette,
|
|
27
28
|
useHMSRoomStyleSheet,
|
|
@@ -38,6 +39,8 @@ import { RoomSettingsModalDebugModeContent } from './RoomSettingsModalDebugModeC
|
|
|
38
39
|
import { ParticipantsCount } from './ParticipantsCount';
|
|
39
40
|
import { selectAllowedTracksToPublish } from '../hooks-sdk-selectors';
|
|
40
41
|
import { TestIds } from '../utils/constants';
|
|
42
|
+
import { addNotification } from '../redux/actions';
|
|
43
|
+
import { NotificationTypes } from '../types';
|
|
41
44
|
|
|
42
45
|
interface RoomSettingsModalContentProps {
|
|
43
46
|
newAudioMixingMode: HMSAudioMixingMode;
|
|
@@ -56,6 +59,8 @@ export const RoomSettingsModalContent: React.FC<
|
|
|
56
59
|
> = (props) => {
|
|
57
60
|
const { closeRoomSettingsModal, setModalVisible } = props;
|
|
58
61
|
|
|
62
|
+
const hmsInstance = useHMSInstance();
|
|
63
|
+
const dispatch = useDispatch();
|
|
59
64
|
const debugMode = useSelector((state: RootState) => state.user.debugMode);
|
|
60
65
|
|
|
61
66
|
const hmsActions = useHMSActions();
|
|
@@ -76,6 +81,10 @@ export const RoomSettingsModalContent: React.FC<
|
|
|
76
81
|
return permissions?.pollRead || permissions?.pollWrite;
|
|
77
82
|
});
|
|
78
83
|
|
|
84
|
+
const whiteboardAdminPermission = useSelector((state: RootState) => {
|
|
85
|
+
return !!state.hmsStates.localPeer?.role?.permissions?.whiteboard?.admin;
|
|
86
|
+
});
|
|
87
|
+
|
|
79
88
|
const { registerOnModalHideAction } = useBottomSheetActions();
|
|
80
89
|
|
|
81
90
|
const { canShowParticipants, show } = useShowChatAndParticipants();
|
|
@@ -271,6 +280,61 @@ export const RoomSettingsModalContent: React.FC<
|
|
|
271
280
|
closeRoomSettingsModal();
|
|
272
281
|
};
|
|
273
282
|
|
|
283
|
+
const whiteboard = useSelector(
|
|
284
|
+
(state: RootState) => state.hmsStates.whiteboard
|
|
285
|
+
);
|
|
286
|
+
const screenShareNodesAvailable = useSelector(
|
|
287
|
+
(state: RootState) => state.app.screensharePeerTrackNodes.length > 0
|
|
288
|
+
);
|
|
289
|
+
|
|
290
|
+
const toggleWhiteboard = async () => {
|
|
291
|
+
if (!whiteboardAdminPermission) return;
|
|
292
|
+
|
|
293
|
+
if (whiteboard && whiteboard.isOwner) {
|
|
294
|
+
hmsInstance.interactivityCenter
|
|
295
|
+
.stopWhiteboard()
|
|
296
|
+
.then((success) => {
|
|
297
|
+
console.log('#stopWhiteboard stopped whiteboard ', success);
|
|
298
|
+
})
|
|
299
|
+
.catch((error) => {
|
|
300
|
+
console.log('#stopWhiteboard error ', error);
|
|
301
|
+
});
|
|
302
|
+
} else if (whiteboard && !whiteboard.isOwner) {
|
|
303
|
+
const uid = Math.random().toString(16).slice(2);
|
|
304
|
+
dispatch(
|
|
305
|
+
addNotification({
|
|
306
|
+
id: uid,
|
|
307
|
+
type: NotificationTypes.ERROR,
|
|
308
|
+
title:
|
|
309
|
+
'Only the peer who started the whiteboard has the ability to close it!',
|
|
310
|
+
})
|
|
311
|
+
);
|
|
312
|
+
} else if (isLocalScreenShared || screenShareNodesAvailable) {
|
|
313
|
+
const uid = Math.random().toString(16).slice(2);
|
|
314
|
+
dispatch(
|
|
315
|
+
addNotification({
|
|
316
|
+
id: uid,
|
|
317
|
+
type: NotificationTypes.ERROR,
|
|
318
|
+
title: isLocalScreenShared
|
|
319
|
+
? 'Discontinue screenshare to open the whiteboard!'
|
|
320
|
+
: "Can't open whiteboard while screenshare is happening!",
|
|
321
|
+
})
|
|
322
|
+
);
|
|
323
|
+
} else {
|
|
324
|
+
hmsInstance.interactivityCenter
|
|
325
|
+
.startWhiteboard('Interactive Session')
|
|
326
|
+
.then((success) => {
|
|
327
|
+
console.log('#startWhiteboard started whiteboard ', success);
|
|
328
|
+
})
|
|
329
|
+
.catch((error) => {
|
|
330
|
+
console.log('#startWhiteboard error ', error);
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// Close the current bottom sheet
|
|
335
|
+
closeRoomSettingsModal();
|
|
336
|
+
};
|
|
337
|
+
|
|
274
338
|
const canShowBRB = useHMSLayoutConfig(
|
|
275
339
|
(layoutConfig) =>
|
|
276
340
|
!!layoutConfig?.screens?.conferencing?.default?.elements?.brb
|
|
@@ -394,6 +458,17 @@ export const RoomSettingsModalContent: React.FC<
|
|
|
394
458
|
isActive: false,
|
|
395
459
|
hide: !canReadOrWritePoll,
|
|
396
460
|
},
|
|
461
|
+
{
|
|
462
|
+
id: 'whiteboard',
|
|
463
|
+
icon: (
|
|
464
|
+
<PencilIcon type="board" style={{ width: 20, height: 20 }} />
|
|
465
|
+
),
|
|
466
|
+
label: whiteboard ? 'Close Whiteboard' : 'Open Whiteboard',
|
|
467
|
+
pressHandler: toggleWhiteboard,
|
|
468
|
+
isActive: !!whiteboard && whiteboard.isOwner,
|
|
469
|
+
disabled: !!whiteboard && !whiteboard.isOwner,
|
|
470
|
+
hide: !whiteboardAdminPermission,
|
|
471
|
+
},
|
|
397
472
|
{
|
|
398
473
|
id: 'noise-cancellation',
|
|
399
474
|
icon: <WaveIcon style={{ width: 20, height: 20 }} />,
|
|
@@ -458,7 +533,7 @@ type SettingItemProps = {
|
|
|
458
533
|
onPress(): void;
|
|
459
534
|
disabled?: TouchableOpacityProps['disabled'];
|
|
460
535
|
testID?: TouchableOpacityProps['testID'];
|
|
461
|
-
isActive?: boolean;
|
|
536
|
+
isActive?: boolean | null;
|
|
462
537
|
};
|
|
463
538
|
|
|
464
539
|
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'
|
|
@@ -49,8 +49,10 @@ export const WebrtcView = React.forwardRef<GridViewRefAttrs, WebrtcViewProps>(
|
|
|
49
49
|
(state: RootState) => state.user.spotlightTrackId
|
|
50
50
|
);
|
|
51
51
|
|
|
52
|
-
const
|
|
53
|
-
(state: RootState) =>
|
|
52
|
+
const screenshareTilesOrWhiteboardAcive = useSelector(
|
|
53
|
+
(state: RootState) =>
|
|
54
|
+
state.app.screensharePeerTrackNodes.length > 0 ||
|
|
55
|
+
!!state.hmsStates.whiteboard
|
|
54
56
|
);
|
|
55
57
|
|
|
56
58
|
const pairedPeers = useMemo(
|
|
@@ -58,13 +60,18 @@ export const WebrtcView = React.forwardRef<GridViewRefAttrs, WebrtcViewProps>(
|
|
|
58
60
|
pairData(
|
|
59
61
|
peerTrackNodes,
|
|
60
62
|
isPortrait
|
|
61
|
-
?
|
|
63
|
+
? screenshareTilesOrWhiteboardAcive
|
|
62
64
|
? MaxTilesInOnePage.IN_PORTRAIT_WITH_SCREENSHARES
|
|
63
65
|
: MaxTilesInOnePage.IN_PORTRAIT
|
|
64
66
|
: MaxTilesInOnePage.IN_LANDSCAPE,
|
|
65
67
|
spotlightTrackId
|
|
66
68
|
),
|
|
67
|
-
[
|
|
69
|
+
[
|
|
70
|
+
peerTrackNodes,
|
|
71
|
+
screenshareTilesOrWhiteboardAcive,
|
|
72
|
+
spotlightTrackId,
|
|
73
|
+
isPortrait,
|
|
74
|
+
]
|
|
68
75
|
);
|
|
69
76
|
|
|
70
77
|
const showWelcomeBanner = useSelector(
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Platform, View } from 'react-native';
|
|
3
|
+
import { useSelector } from 'react-redux';
|
|
4
|
+
import { WebView } from 'react-native-webview';
|
|
5
|
+
import type { WebViewProps } from 'react-native-webview';
|
|
6
|
+
|
|
7
|
+
import type { RootState } from '../redux';
|
|
8
|
+
import { PipModes } from '../utils/types';
|
|
9
|
+
import { useIsLandscapeOrientation } from '../utils/dimension';
|
|
10
|
+
import { WhiteboardFullScreenButton } from './WhiteboardFullScreenButton';
|
|
11
|
+
import type {
|
|
12
|
+
WebViewError,
|
|
13
|
+
WebViewErrorEvent,
|
|
14
|
+
} from 'react-native-webview/lib/WebViewTypes';
|
|
15
|
+
|
|
16
|
+
export type WhiteboardProps = {};
|
|
17
|
+
|
|
18
|
+
export const _Whiteboard = React.forwardRef<
|
|
19
|
+
React.Ref<React.ElementRef<typeof WebView> | null>,
|
|
20
|
+
WhiteboardProps
|
|
21
|
+
>((_props, webviewRef) => {
|
|
22
|
+
const localWebviewRef = React.useRef<null | React.ElementRef<typeof WebView>>(
|
|
23
|
+
null
|
|
24
|
+
);
|
|
25
|
+
React.useImperativeHandle(webviewRef, () => localWebviewRef, []);
|
|
26
|
+
|
|
27
|
+
const whiteboardUrl = useSelector(
|
|
28
|
+
(state: RootState) => state.hmsStates.whiteboard?.url
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
//#region reconnection handling
|
|
32
|
+
let webviewError = React.useRef<WebViewError | null>(null);
|
|
33
|
+
const webviewErrorHandler = React.useCallback((e: WebViewErrorEvent) => {
|
|
34
|
+
webviewError.current = e.nativeEvent;
|
|
35
|
+
}, []);
|
|
36
|
+
|
|
37
|
+
if (Platform.OS === 'ios') {
|
|
38
|
+
const prevReconnecting = React.useRef<boolean | null>(null);
|
|
39
|
+
const reconnecting = useSelector(
|
|
40
|
+
(state: RootState) => state.hmsStates.reconnecting
|
|
41
|
+
);
|
|
42
|
+
if (
|
|
43
|
+
whiteboardUrl &&
|
|
44
|
+
localWebviewRef.current !== null &&
|
|
45
|
+
webviewError.current !== null &&
|
|
46
|
+
prevReconnecting.current === true &&
|
|
47
|
+
reconnecting === false
|
|
48
|
+
) {
|
|
49
|
+
localWebviewRef.current.reload();
|
|
50
|
+
}
|
|
51
|
+
prevReconnecting.current = reconnecting;
|
|
52
|
+
}
|
|
53
|
+
//#endregion reconnection handling
|
|
54
|
+
|
|
55
|
+
const isPipModeActive = useSelector(
|
|
56
|
+
(state: RootState) => state.app.pipModeStatus === PipModes.ACTIVE
|
|
57
|
+
);
|
|
58
|
+
const isLandscapeOrientation = useIsLandscapeOrientation();
|
|
59
|
+
|
|
60
|
+
if (!whiteboardUrl) return null;
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<View style={{ flex: 1, position: 'relative' }}>
|
|
64
|
+
<HMSWebView
|
|
65
|
+
ref={localWebviewRef}
|
|
66
|
+
url={whiteboardUrl}
|
|
67
|
+
onError={webviewErrorHandler}
|
|
68
|
+
/>
|
|
69
|
+
|
|
70
|
+
{isPipModeActive || isLandscapeOrientation ? null : (
|
|
71
|
+
<WhiteboardFullScreenButton />
|
|
72
|
+
)}
|
|
73
|
+
</View>
|
|
74
|
+
);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
export const Whiteboard = React.memo(_Whiteboard);
|
|
78
|
+
|
|
79
|
+
//# Memoized Webview
|
|
80
|
+
|
|
81
|
+
interface HMSWebViewProps extends WebViewProps {
|
|
82
|
+
url: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const _HMSWebView = React.forwardRef<
|
|
86
|
+
React.ElementRef<typeof WebView>,
|
|
87
|
+
HMSWebViewProps
|
|
88
|
+
>((props, webviewRef) => {
|
|
89
|
+
return (
|
|
90
|
+
<WebView
|
|
91
|
+
ref={webviewRef}
|
|
92
|
+
source={{ uri: props.url }}
|
|
93
|
+
style={{ flex: 1 }}
|
|
94
|
+
javaScriptEnabled={true}
|
|
95
|
+
domStorageEnabled={true}
|
|
96
|
+
{...props}
|
|
97
|
+
/>
|
|
98
|
+
);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
const HMSWebView = React.memo(_HMSWebView);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Platform, View } from 'react-native';
|
|
3
|
+
import { useSelector } from 'react-redux';
|
|
4
|
+
import { WebView } from 'react-native-webview';
|
|
5
|
+
import { GestureDetector, Gesture } from 'react-native-gesture-handler';
|
|
6
|
+
|
|
7
|
+
import type { RootState } from '../redux';
|
|
8
|
+
import { Whiteboard } from './Whiteboard';
|
|
9
|
+
|
|
10
|
+
export type WhiteboardContainerProps = {};
|
|
11
|
+
|
|
12
|
+
export const _WhiteboardContainer = React.forwardRef<
|
|
13
|
+
React.RefObject<React.ElementRef<typeof WebView> | null>,
|
|
14
|
+
WhiteboardContainerProps
|
|
15
|
+
>((_props, webviewRef) => {
|
|
16
|
+
const fullScreenWhiteboard = useSelector(
|
|
17
|
+
(state: RootState) => state.app.fullScreenWhiteboard
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<View style={{ flex: 1, marginBottom: 4 }}>
|
|
22
|
+
{fullScreenWhiteboard ? null : Platform.OS === 'ios' ? (
|
|
23
|
+
<GestureDetector gesture={Gesture.Tap()}>
|
|
24
|
+
<View collapsable={false} style={{ flex: 1 }}>
|
|
25
|
+
<Whiteboard ref={webviewRef} />
|
|
26
|
+
</View>
|
|
27
|
+
</GestureDetector>
|
|
28
|
+
) : (
|
|
29
|
+
<Whiteboard ref={webviewRef} />
|
|
30
|
+
)}
|
|
31
|
+
</View>
|
|
32
|
+
);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export const WhiteboardContainer = React.memo(_WhiteboardContainer);
|