@100mslive/roomkit-react 0.1.5 → 0.1.6-alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{HLSView-P57IRMAR.js → HLSView-HNVYG5VE.js} +309 -151
- package/dist/HLSView-HNVYG5VE.js.map +7 -0
- package/dist/Prebuilt/App.d.ts +3 -0
- package/dist/Prebuilt/AppContext.d.ts +13 -0
- package/dist/Prebuilt/common/PeersSorter.d.ts +21 -0
- package/dist/Prebuilt/components/Chat/ChatFooter.d.ts +7 -0
- package/dist/Prebuilt/components/Connection/ConnectionIndicator.d.ts +6 -0
- package/dist/Prebuilt/components/Connection/TileConnection.d.ts +10 -0
- package/dist/Prebuilt/components/Footer/ChatToggle.d.ts +4 -0
- package/dist/Prebuilt/components/Footer/Footer.d.ts +6 -0
- package/dist/Prebuilt/components/Footer/RoleAccordion.d.ts +14 -0
- package/dist/Prebuilt/components/Footer/RoleOptions.d.ts +6 -0
- package/dist/Prebuilt/components/Header/Header.d.ts +2 -0
- package/dist/Prebuilt/components/Header/StreamActions.d.ts +11 -0
- package/dist/Prebuilt/components/InsetTile.d.ts +2 -0
- package/dist/Prebuilt/components/Leave/DesktopLeaveRoom.d.ts +8 -0
- package/dist/Prebuilt/components/Leave/EndSessionContent.d.ts +9 -0
- package/dist/Prebuilt/components/Leave/LeaveAtoms.d.ts +2196 -0
- package/dist/Prebuilt/components/Leave/LeaveCard.d.ts +11 -0
- package/dist/Prebuilt/components/Leave/LeaveRoom.d.ts +5 -0
- package/dist/Prebuilt/components/Leave/LeaveSessionContent.d.ts +8 -0
- package/dist/Prebuilt/components/Leave/MwebLeaveRoom.d.ts +8 -0
- package/dist/Prebuilt/components/MoreSettings/MoreSettings.d.ts +6 -0
- package/dist/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.d.ts +6 -0
- package/dist/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.d.ts +6 -0
- package/dist/Prebuilt/components/Pagination.d.ts +6 -0
- package/dist/Prebuilt/components/Preview/PreviewContainer.d.ts +3 -0
- package/dist/Prebuilt/components/Preview/PreviewForm.d.ts +10 -0
- package/dist/Prebuilt/components/Preview/PreviewJoin.d.ts +16 -0
- package/dist/Prebuilt/components/RoleChangeRequestModal.d.ts +2 -0
- package/dist/Prebuilt/components/SecondaryTiles.d.ts +3 -0
- package/dist/Prebuilt/components/VideoLayouts/EqualProminence.d.ts +3 -0
- package/dist/Prebuilt/components/VideoLayouts/Grid.d.ts +6 -0
- package/dist/Prebuilt/components/VideoLayouts/GridLayout.d.ts +12 -0
- package/dist/Prebuilt/components/VideoLayouts/ProminenceLayout.d.ts +15 -0
- package/dist/Prebuilt/components/VideoLayouts/RoleProminence.d.ts +3 -0
- package/dist/Prebuilt/components/VideoLayouts/ScreenshareLayout.d.ts +3 -0
- package/dist/Prebuilt/components/VideoLayouts/interface.d.ts +9 -0
- package/dist/Prebuilt/components/hooks/useAutoStartStreaming.d.ts +1 -0
- package/dist/Prebuilt/components/hooks/useRedirectToLeave.d.ts +3 -0
- package/dist/Prebuilt/components/hooks/useRoleProminencePeers.d.ts +5 -0
- package/dist/Prebuilt/components/hooks/useTileLayout.d.ts +13 -0
- package/dist/Prebuilt/components/hooks/useVideoTileLayout.d.ts +13 -0
- package/dist/Prebuilt/layouts/SidePane.d.ts +9 -0
- package/dist/Prebuilt/layouts/VideoStreamingSection.d.ts +7 -0
- package/dist/Prebuilt/plugins/whiteboard/ToggleWhiteboard.d.ts +5 -0
- package/dist/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.d.ts +1 -0
- package/dist/Prebuilt/provider/roomLayoutProvider/hooks/useInsetEnabled.d.ts +1 -0
- package/dist/Prebuilt/provider/roomLayoutProvider/hooks/useRoomLayoutScreen.d.ts +17 -0
- package/dist/Prebuilt/provider/roomLayoutProvider/index.d.ts +6 -1
- package/dist/{VirtualBackground-GGCQJ5JM.js → VirtualBackground-UM2FOUHQ.js} +5 -11
- package/dist/VirtualBackground-UM2FOUHQ.js.map +7 -0
- package/dist/{chunk-P5X32KOD.js → chunk-364HP22I.js} +8 -5
- package/dist/chunk-364HP22I.js.map +7 -0
- package/dist/{chunk-OSM4QEQG.js → chunk-LYSAET4G.js} +3742 -5462
- package/dist/chunk-LYSAET4G.js.map +7 -0
- package/dist/chunk-POE7H4IE.js +898 -0
- package/dist/chunk-POE7H4IE.js.map +7 -0
- package/dist/conference-UWLJHMB2.js +5727 -0
- package/dist/conference-UWLJHMB2.js.map +7 -0
- package/dist/index.cjs.js +9655 -15326
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.js +2 -2
- package/dist/meta.cjs.json +2513 -3456
- package/dist/meta.esbuild.json +2807 -3838
- package/package.json +8 -7
- package/src/Button/Button.tsx +2 -2
- package/src/Prebuilt/App.tsx +58 -53
- package/src/Prebuilt/{AppContext.jsx → AppContext.tsx} +11 -3
- package/src/Prebuilt/IconButton.jsx +11 -0
- package/src/Prebuilt/Prebuilt.stories.tsx +1 -0
- package/src/Prebuilt/common/{PeersSorter.js → PeersSorter.ts} +16 -11
- package/src/Prebuilt/common/constants.js +4 -114
- package/src/Prebuilt/common/hooks.js +34 -1
- package/src/Prebuilt/common/utils.js +1 -9
- package/src/Prebuilt/components/AppData/AppData.jsx +11 -15
- package/src/Prebuilt/components/AppData/useUISettings.js +6 -10
- package/src/Prebuilt/components/AudioVideoToggle.jsx +10 -2
- package/src/Prebuilt/components/AuthToken.jsx +11 -42
- package/src/Prebuilt/components/Chat/Chat.jsx +75 -27
- package/src/Prebuilt/components/Chat/ChatBody.jsx +95 -36
- package/src/Prebuilt/components/Chat/ChatFooter.tsx +199 -0
- package/src/Prebuilt/components/Chat/ChatParticipantHeader.jsx +84 -0
- package/src/Prebuilt/components/Chat/ChatSelector.jsx +16 -17
- package/src/Prebuilt/components/Chat/ChatSelectorContainer.jsx +81 -0
- package/src/Prebuilt/components/Chat/useEmojiPickerStyles.js +5 -4
- package/src/Prebuilt/components/Connection/{ConnectionIndicator.jsx → ConnectionIndicator.tsx} +12 -4
- package/src/Prebuilt/components/Connection/TileConnection.tsx +71 -0
- package/src/Prebuilt/components/EmojiReaction.jsx +19 -22
- package/src/Prebuilt/components/Footer/{ChatToggle.jsx → ChatToggle.tsx} +13 -9
- package/src/Prebuilt/components/Footer/Footer.tsx +98 -0
- package/src/Prebuilt/components/Footer/ParticipantList.jsx +187 -179
- package/src/Prebuilt/components/Footer/RoleAccordion.tsx +94 -0
- package/src/Prebuilt/components/Footer/RoleOptions.tsx +155 -0
- package/src/Prebuilt/components/FullPageProgress.jsx +3 -3
- package/src/Prebuilt/components/HMSVideo/Controls.jsx +3 -2
- package/src/Prebuilt/components/HMSVideo/HLSQualitySelector.jsx +63 -18
- package/src/Prebuilt/components/HMSVideo/HMSVideo.jsx +2 -2
- package/src/Prebuilt/components/HMSVideo/PlayButton.jsx +1 -1
- package/src/Prebuilt/components/HMSVideo/VideoProgress.jsx +5 -6
- package/src/Prebuilt/components/HMSVideo/VideoTime.jsx +3 -3
- package/src/Prebuilt/components/HMSVideo/VolumeControl.jsx +38 -9
- package/src/Prebuilt/components/Header/{ConferencingHeader.jsx → Header.tsx} +9 -7
- package/src/Prebuilt/components/Header/HeaderComponents.jsx +13 -4
- package/src/Prebuilt/components/Header/{StreamActions.jsx → StreamActions.tsx} +54 -67
- package/src/Prebuilt/components/Header/common.jsx +5 -2
- package/src/Prebuilt/components/Header/index.tsx +1 -0
- package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.jsx +23 -4
- package/src/Prebuilt/components/InsetTile.tsx +128 -0
- package/src/Prebuilt/components/{MoreSettings/SplitComponents/DesktopLeaveRoom.jsx → Leave/DesktopLeaveRoom.tsx} +67 -25
- package/src/Prebuilt/components/{EndSessionContent.jsx → Leave/EndSessionContent.tsx} +18 -11
- package/src/Prebuilt/components/Leave/LeaveAtoms.tsx +26 -0
- package/src/Prebuilt/components/Leave/LeaveCard.tsx +36 -0
- package/src/Prebuilt/components/Leave/LeaveRoom.tsx +66 -0
- package/src/Prebuilt/components/{LeaveSessionContent.jsx → Leave/LeaveSessionContent.tsx} +20 -6
- package/src/Prebuilt/components/{MoreSettings/SplitComponents/MwebLeaveRoom.jsx → Leave/MwebLeaveRoom.tsx} +43 -18
- package/src/Prebuilt/components/MetaActions.jsx +15 -23
- package/src/Prebuilt/components/MoreSettings/ActionTile.jsx +5 -0
- package/src/Prebuilt/components/MoreSettings/ChangeNameContent.jsx +16 -7
- package/src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx +1 -1
- package/src/Prebuilt/components/MoreSettings/FullScreenItem.jsx +1 -4
- package/src/Prebuilt/components/MoreSettings/MoreSettings.tsx +27 -0
- package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.tsx +216 -0
- package/src/Prebuilt/components/MoreSettings/SplitComponents/{MwebOptions.jsx → MwebOptions.tsx} +107 -45
- package/src/Prebuilt/components/Notifications/HLSFailureModal.jsx +3 -1
- package/src/Prebuilt/components/Notifications/Notifications.jsx +46 -30
- package/src/Prebuilt/components/Notifications/PeerNotifications.jsx +14 -2
- package/src/Prebuilt/components/Notifications/PermissionErrorModal.jsx +10 -4
- package/src/Prebuilt/components/Notifications/ReconnectNotifications.jsx +5 -11
- package/src/Prebuilt/components/PIP/PIPComponent.jsx +7 -16
- package/src/Prebuilt/components/PIP/PIPManager.js +1 -0
- package/src/Prebuilt/components/Pagination.tsx +60 -0
- package/src/Prebuilt/components/Playlist/Playlist.jsx +1 -6
- package/src/Prebuilt/components/PostLeave.jsx +7 -7
- package/src/Prebuilt/components/Preview/{PreviewContainer.jsx → PreviewContainer.tsx} +16 -15
- package/src/Prebuilt/components/Preview/{PreviewForm.jsx → PreviewForm.tsx} +16 -8
- package/src/Prebuilt/components/Preview/{PreviewJoin.jsx → PreviewJoin.tsx} +48 -22
- package/src/Prebuilt/components/RaiseHand.jsx +0 -7
- package/src/Prebuilt/components/RoleChangeRequestModal.tsx +119 -0
- package/src/Prebuilt/components/ScreenshareDisplay.jsx +4 -10
- package/src/Prebuilt/components/ScreenshareTile.jsx +43 -36
- package/src/Prebuilt/components/SecondaryTiles.tsx +36 -0
- package/src/Prebuilt/components/Settings/LayoutSettings.jsx +2 -12
- package/src/Prebuilt/components/Settings/NotificationSettings.jsx +3 -9
- package/src/Prebuilt/components/Settings/SettingsModal.jsx +3 -9
- package/src/Prebuilt/components/StatsForNerds.jsx +3 -1
- package/src/Prebuilt/components/TileMenu/TileMenu.jsx +16 -17
- package/src/Prebuilt/components/TileMenu/TileMenuContent.jsx +33 -27
- package/src/Prebuilt/components/Toast/ToastConfig.jsx +58 -15
- package/src/Prebuilt/components/VideoLayouts/EqualProminence.tsx +65 -0
- package/src/Prebuilt/components/VideoLayouts/Grid.tsx +43 -0
- package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +110 -0
- package/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +74 -0
- package/src/Prebuilt/components/VideoLayouts/RoleProminence.tsx +59 -0
- package/src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx +52 -0
- package/src/Prebuilt/components/VideoLayouts/interface.ts +10 -0
- package/src/Prebuilt/components/VideoTile.jsx +116 -74
- package/src/Prebuilt/components/conference.jsx +86 -85
- package/src/Prebuilt/components/hooks/useAutoStartStreaming.tsx +57 -0
- package/src/Prebuilt/components/hooks/useMetadata.jsx +19 -3
- package/src/Prebuilt/components/hooks/useRedirectToLeave.tsx +34 -0
- package/src/Prebuilt/components/hooks/useRoleProminencePeers.tsx +38 -0
- package/src/Prebuilt/components/hooks/useTileLayout.tsx +127 -0
- package/src/Prebuilt/components/hooks/useVideoTileLayout.ts +26 -0
- package/src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx +5 -72
- package/src/Prebuilt/components/pdfAnnotator/submitPdf.jsx +4 -45
- package/src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx +2 -17
- package/src/Prebuilt/components/peerTileUtils.jsx +1 -1
- package/src/Prebuilt/images/empty-chat.svg +12 -0
- package/src/Prebuilt/layouts/EmbedView.jsx +17 -50
- package/src/Prebuilt/layouts/HLSView.jsx +138 -51
- package/src/Prebuilt/layouts/PDFView.jsx +1 -11
- package/src/Prebuilt/layouts/SidePane.tsx +108 -0
- package/src/Prebuilt/layouts/VideoStreamingSection.tsx +96 -0
- package/src/Prebuilt/layouts/WhiteboardView.jsx +10 -34
- package/src/Prebuilt/plugins/FlyingEmoji.jsx +14 -2
- package/src/Prebuilt/plugins/VirtualBackground/VirtualBackground.jsx +1 -4
- package/src/Prebuilt/plugins/whiteboard/{ToggleWhiteboard.jsx → ToggleWhiteboard.tsx} +5 -9
- package/src/Prebuilt/primitives/DialogContent.jsx +15 -11
- package/src/Prebuilt/provider/roomLayoutProvider/constants/index.ts +17 -2
- package/src/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.ts +36 -13
- package/src/Prebuilt/provider/roomLayoutProvider/hooks/useInsetEnabled.ts +10 -0
- package/src/Prebuilt/provider/roomLayoutProvider/hooks/useRoomLayoutScreen.ts +65 -0
- package/src/Prebuilt/provider/roomLayoutProvider/index.tsx +17 -6
- package/src/Prebuilt/services/FeatureFlags.jsx +0 -1
- package/src/VideoTile/StyledVideoTile.tsx +1 -0
- package/dist/HLSView-P57IRMAR.js.map +0 -7
- package/dist/PinnedTrackView-4FYJEBTB.js +0 -102
- package/dist/PinnedTrackView-4FYJEBTB.js.map +0 -7
- package/dist/VirtualBackground-GGCQJ5JM.js.map +0 -7
- package/dist/chunk-IVTWKQI3.js +0 -827
- package/dist/chunk-IVTWKQI3.js.map +0 -7
- package/dist/chunk-OSM4QEQG.js.map +0 -7
- package/dist/chunk-P5X32KOD.js.map +0 -7
- package/dist/chunk-RVCZPPTL.js +0 -1100
- package/dist/chunk-RVCZPPTL.js.map +0 -7
- package/dist/conference-P6I6ESVF.js +0 -8995
- package/dist/conference-P6I6ESVF.js.map +0 -7
- package/src/Prebuilt/components/AudioLevel/BeamSpeakerLabelsLogging.jsx +0 -16
- package/src/Prebuilt/components/Chat/ChatFooter.jsx +0 -150
- package/src/Prebuilt/components/Chat/ChatHeader.jsx +0 -67
- package/src/Prebuilt/components/Connection/TileConnection.jsx +0 -39
- package/src/Prebuilt/components/EqualProminence.jsx +0 -180
- package/src/Prebuilt/components/FirstPersonDisplay.jsx +0 -50
- package/src/Prebuilt/components/Footer/Footer.jsx +0 -73
- package/src/Prebuilt/components/Header/Header.jsx +0 -8
- package/src/Prebuilt/components/Header/StreamingHeader.jsx +0 -54
- package/src/Prebuilt/components/LeaveCard.jsx +0 -19
- package/src/Prebuilt/components/LeaveRoom.jsx +0 -94
- package/src/Prebuilt/components/MoreSettings/MoreSettings.jsx +0 -10
- package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.jsx +0 -219
- package/src/Prebuilt/components/Notifications/MessageNotifications.jsx +0 -25
- package/src/Prebuilt/components/Pagination.jsx +0 -29
- package/src/Prebuilt/components/RoleChangeRequestModal.jsx +0 -26
- package/src/Prebuilt/components/VideoList.jsx +0 -73
- package/src/Prebuilt/components/gridView.jsx +0 -85
- package/src/Prebuilt/components/hooks/useFeatures.js +0 -22
- package/src/Prebuilt/components/hooks/useNavigation.js +0 -19
- package/src/Prebuilt/components/hooks/useSkipPreview.jsx +0 -20
- package/src/Prebuilt/components/pdfAnnotator/pdfErrorView.jsx +0 -29
- package/src/Prebuilt/images/Logo.svg +0 -8
- package/src/Prebuilt/layouts/ActiveSpeakerView.jsx +0 -34
- package/src/Prebuilt/layouts/InsetView.jsx +0 -260
- package/src/Prebuilt/layouts/PinnedTrackView.jsx +0 -59
- package/src/Prebuilt/layouts/SidePane.jsx +0 -52
- package/src/Prebuilt/layouts/mainGridView.jsx +0 -98
- package/src/Prebuilt/layouts/mainView.jsx +0 -141
- package/src/Prebuilt/layouts/screenShareView.jsx +0 -183
- /package/{src/Prebuilt/components/Header/index.jsx → dist/Prebuilt/components/Header/index.d.ts} +0 -0
- /package/src/Prebuilt/components/{ScreenShare.jsx → ScreenShareToggle.jsx} +0 -0
- /package/src/{assets → Prebuilt/images}/android-perm-1.png +0 -0
- /package/src/{assets → Prebuilt/images}/ios-perm-0.png +0 -0
@@ -5,9 +5,7 @@ import { Box, Dropdown, Flex, Text, Tooltip } from '../../../';
|
|
5
5
|
import IconButton from '../../IconButton';
|
6
6
|
import { AudioPlaylistControls } from './PlaylistControls';
|
7
7
|
import { PlaylistItem } from './PlaylistItem';
|
8
|
-
import { useIsFeatureEnabled } from '../hooks/useFeatures';
|
9
8
|
import { usePlaylist } from '../hooks/usePlaylist';
|
10
|
-
import { FEATURE_LIST } from '../../common/constants';
|
11
9
|
|
12
10
|
const BrowseAndPlayFromLocal = ({ type, actions }) => {
|
13
11
|
return (
|
@@ -44,10 +42,7 @@ export const Playlist = ({ type }) => {
|
|
44
42
|
const [open, setOpen] = useState(false);
|
45
43
|
const [collapse, setCollapse] = useState(false);
|
46
44
|
const isAllowedToPublish = useHMSStore(selectIsAllowedToPublish);
|
47
|
-
|
48
|
-
isAudioPlaylist ? FEATURE_LIST.AUDIO_PLAYLIST : FEATURE_LIST.VIDEO_PLAYLIST,
|
49
|
-
);
|
50
|
-
if (!isAllowedToPublish.screen || playlist.length === 0 || !isFeatureEnabled) {
|
45
|
+
if (!isAllowedToPublish.screen || playlist.length === 0) {
|
51
46
|
return null;
|
52
47
|
}
|
53
48
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import { useParams } from 'react-router-dom';
|
2
|
+
import { useNavigate, useParams } from 'react-router-dom';
|
3
3
|
import { ExitIcon } from '@100mslive/react-icons';
|
4
4
|
import { ToastManager } from './Toast/ToastManager';
|
5
5
|
import { Button } from '../../Button';
|
@@ -7,14 +7,14 @@ import { Box, Flex } from '../../Layout';
|
|
7
7
|
import { Text } from '../../Text';
|
8
8
|
import { useHMSPrebuiltContext } from '../AppContext';
|
9
9
|
import { Header } from './Header';
|
10
|
-
import {
|
10
|
+
import { useRoomLayoutPreviewScreen } from '../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
|
11
11
|
import { defaultPreviewPreference, UserPreferencesKeys, useUserPreferences } from './hooks/useUserPreferences';
|
12
|
-
import { getRoutePrefix } from '../common/utils';
|
13
12
|
import { textEllipsis } from '../../utils';
|
14
13
|
|
15
14
|
const PostLeave = () => {
|
16
|
-
const navigate =
|
17
|
-
const {
|
15
|
+
const navigate = useNavigate();
|
16
|
+
const { isPreviewScreenEnabled } = useRoomLayoutPreviewScreen();
|
17
|
+
const { roomCode } = useHMSPrebuiltContext();
|
18
18
|
const { roomId, role } = useParams();
|
19
19
|
const [previewPreference] = useUserPreferences(UserPreferencesKeys.PREVIEW, defaultPreviewPreference);
|
20
20
|
return (
|
@@ -32,7 +32,7 @@ const PostLeave = () => {
|
|
32
32
|
👋
|
33
33
|
</Text>
|
34
34
|
<Text variant="h4" css={{ color: '$on_surface_high', fontWeight: '$semiBold', mt: '$12' }}>
|
35
|
-
You left the
|
35
|
+
You left the room
|
36
36
|
</Text>
|
37
37
|
<Text
|
38
38
|
variant="body1"
|
@@ -57,7 +57,7 @@ const PostLeave = () => {
|
|
57
57
|
</Text>
|
58
58
|
<Button
|
59
59
|
onClick={() => {
|
60
|
-
let redirectUrl = `${
|
60
|
+
let redirectUrl = `${isPreviewScreenEnabled ? '/preview/' : '/meeting/'}${roomCode || roomId}`;
|
61
61
|
if (role && roomId) redirectUrl += '/' + role;
|
62
62
|
navigate(redirectUrl);
|
63
63
|
ToastManager.clearAllToast();
|
@@ -1,20 +1,23 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import { useParams } from 'react-router-dom';
|
2
|
+
import { useNavigate, useParams } from 'react-router-dom';
|
3
3
|
import { useSearchParam } from 'react-use';
|
4
|
-
import { Flex } from '
|
4
|
+
import { Flex } from '../../..';
|
5
5
|
import { useHMSPrebuiltContext } from '../../AppContext';
|
6
|
-
import SidePane from '../../layouts/SidePane';
|
7
6
|
import { useRoomLayout } from '../../provider/roomLayoutProvider';
|
7
|
+
// @ts-ignore: No implicit Any
|
8
8
|
import FullPageProgress from '../FullPageProgress';
|
9
|
+
// @ts-ignore: No implicit Any
|
9
10
|
import PreviewJoin from './PreviewJoin';
|
11
|
+
import { useRoomLayoutPreviewScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
|
12
|
+
// @ts-ignore: No implicit Any
|
10
13
|
import { useAuthToken } from '../AppData/useUISettings';
|
11
|
-
|
12
|
-
import { useSkipPreview } from '../hooks/useSkipPreview';
|
14
|
+
// @ts-ignore: No implicit Any
|
13
15
|
import { QUERY_PARAM_PREVIEW_AS_ROLE } from '../../common/constants';
|
14
16
|
|
15
17
|
const PreviewContainer = () => {
|
16
|
-
const navigate =
|
17
|
-
const
|
18
|
+
const navigate = useNavigate();
|
19
|
+
const { isPreviewScreenEnabled } = useRoomLayoutPreviewScreen();
|
20
|
+
const skipPreview = !isPreviewScreenEnabled;
|
18
21
|
const previewAsRole = useSearchParam(QUERY_PARAM_PREVIEW_AS_ROLE);
|
19
22
|
const { userName } = useHMSPrebuiltContext();
|
20
23
|
const initialName = userName || (skipPreview ? 'Beam' : '');
|
@@ -38,17 +41,15 @@ const PreviewContainer = () => {
|
|
38
41
|
align="center"
|
39
42
|
>
|
40
43
|
{authToken && Object.keys(previewHeader).length > 0 ? (
|
41
|
-
<PreviewJoin
|
44
|
+
<PreviewJoin
|
45
|
+
initialName={initialName}
|
46
|
+
skipPreview={skipPreview}
|
47
|
+
asRole={previewAsRole ?? undefined}
|
48
|
+
onJoin={onJoin}
|
49
|
+
/>
|
42
50
|
) : (
|
43
51
|
<FullPageProgress />
|
44
52
|
)}
|
45
|
-
<SidePane
|
46
|
-
css={{
|
47
|
-
position: 'unset',
|
48
|
-
mr: '$10',
|
49
|
-
'@lg': { position: 'fixed', mr: '$0' },
|
50
|
-
}}
|
51
|
-
/>
|
52
53
|
</Flex>
|
53
54
|
</Flex>
|
54
55
|
);
|
@@ -1,11 +1,12 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { useMedia } from 'react-use';
|
3
|
-
import {
|
3
|
+
import { JoinForm_JoinBtnType } from '@100mslive/types-prebuilt/elements/join_form';
|
4
|
+
import { useRecordingStreaming } from '@100mslive/react-sdk';
|
4
5
|
import { RadioIcon } from '@100mslive/react-icons';
|
5
6
|
import { Button, config as cssConfig, Flex, Input, styled } from '../../..';
|
6
7
|
import { useRoomLayout } from '../../provider/roomLayoutProvider';
|
8
|
+
// @ts-ignore: No implicit Any
|
7
9
|
import { PreviewSettings } from './PreviewJoin';
|
8
|
-
import { useShowStreamingUI } from '../../common/hooks';
|
9
10
|
|
10
11
|
const PreviewForm = ({
|
11
12
|
name,
|
@@ -14,18 +15,22 @@ const PreviewForm = ({
|
|
14
15
|
enableJoin,
|
15
16
|
cannotPublishVideo = false,
|
16
17
|
cannotPublishAudio = false,
|
18
|
+
}: {
|
19
|
+
name: string;
|
20
|
+
onChange: (name: string) => void;
|
21
|
+
onJoin: () => void;
|
22
|
+
enableJoin: boolean;
|
23
|
+
cannotPublishVideo: boolean;
|
24
|
+
cannotPublishAudio: boolean;
|
17
25
|
}) => {
|
18
|
-
const formSubmit = e => {
|
26
|
+
const formSubmit = (e: React.SyntheticEvent) => {
|
19
27
|
e.preventDefault();
|
20
28
|
};
|
21
|
-
const
|
22
|
-
const isMobile = useMedia(mediaQueryLg);
|
29
|
+
const isMobile = useMedia(cssConfig.media.md);
|
23
30
|
const { isHLSRunning } = useRecordingStreaming();
|
24
|
-
const permissions = useHMSStore(selectPermissions);
|
25
31
|
const layout = useRoomLayout();
|
26
32
|
const { join_form: joinForm = {} } = layout?.screens?.preview?.default?.elements || {};
|
27
|
-
const
|
28
|
-
const showGoLive = showStreamingUI && !isHLSRunning && permissions?.hlsStreaming;
|
33
|
+
const showGoLive = joinForm?.join_btn_type === JoinForm_JoinBtnType.JOIN_BTN_TYPE_JOIN_AND_GO_LIVE && !isHLSRunning;
|
29
34
|
|
30
35
|
return (
|
31
36
|
<Form
|
@@ -45,6 +50,9 @@ const PreviewForm = ({
|
|
45
50
|
onKeyDown={e => {
|
46
51
|
if (e.key === 'Enter' && name.trim().length > 0) {
|
47
52
|
e.preventDefault();
|
53
|
+
if (isMobile) {
|
54
|
+
return;
|
55
|
+
}
|
48
56
|
onJoin();
|
49
57
|
}
|
50
58
|
}}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import React, { Fragment, Suspense, useCallback, useEffect, useState } from 'react';
|
2
|
+
import { useMedia } from 'react-use';
|
2
3
|
import {
|
3
4
|
HMSRoomState,
|
4
5
|
selectIsLocalVideoEnabled,
|
@@ -12,22 +13,37 @@ import {
|
|
12
13
|
useRecordingStreaming,
|
13
14
|
} from '@100mslive/react-sdk';
|
14
15
|
import { MicOffIcon, SettingsIcon } from '@100mslive/react-icons';
|
15
|
-
import { Avatar, Box, Flex, flexCenter, styled, StyledVideoTile, Text,
|
16
|
+
import { Avatar, Box, config as cssConfig, Flex, flexCenter, styled, StyledVideoTile, Text, Video } from '../../..';
|
16
17
|
import { useHMSPrebuiltContext } from '../../AppContext';
|
18
|
+
// @ts-ignore: No implicit Any
|
17
19
|
import IconButton from '../../IconButton';
|
18
20
|
import { useRoomLayout } from '../../provider/roomLayoutProvider';
|
21
|
+
// @ts-ignore: No implicit Any
|
19
22
|
import { AudioVideoToggle } from '../AudioVideoToggle';
|
23
|
+
// @ts-ignore: No implicit Any
|
20
24
|
import Chip from '../Chip';
|
25
|
+
// @ts-ignore: No implicit Any
|
21
26
|
import TileConnection from '../Connection/TileConnection';
|
27
|
+
// @ts-ignore: No implicit Any
|
22
28
|
import FullPageProgress from '../FullPageProgress';
|
29
|
+
// @ts-ignore: No implicit Any
|
23
30
|
import { Logo } from '../Header/HeaderComponents';
|
31
|
+
// @ts-ignore: No implicit Any
|
24
32
|
import SettingsModal from '../Settings/SettingsModal';
|
33
|
+
// @ts-ignore: No implicit Any
|
34
|
+
import { AudioLevel } from '../VideoTile';
|
35
|
+
// @ts-ignore: No implicit Any
|
25
36
|
import PreviewForm from './PreviewForm';
|
37
|
+
// @ts-ignore: No implicit Any
|
26
38
|
import { useAuthToken, useUISettings } from '../AppData/useUISettings';
|
39
|
+
// @ts-ignore: No implicit Any
|
27
40
|
import { defaultPreviewPreference, UserPreferencesKeys, useUserPreferences } from '../hooks/useUserPreferences';
|
41
|
+
// @ts-ignore: No implicit Any
|
28
42
|
import { getFormattedCount } from '../../common/utils';
|
43
|
+
// @ts-ignore: No implicit Any
|
29
44
|
import { UI_SETTINGS } from '../../common/constants';
|
30
45
|
|
46
|
+
// @ts-ignore: No implicit Any
|
31
47
|
const VirtualBackground = React.lazy(() => import('../../plugins/VirtualBackground/VirtualBackground'));
|
32
48
|
|
33
49
|
const getParticipantChipContent = (peerCount = 0) => {
|
@@ -38,7 +54,17 @@ const getParticipantChipContent = (peerCount = 0) => {
|
|
38
54
|
return `${formattedNum} other${parseInt(formattedNum) === 1 ? '' : 's'} in the session`;
|
39
55
|
};
|
40
56
|
|
41
|
-
const PreviewJoin = ({
|
57
|
+
const PreviewJoin = ({
|
58
|
+
onJoin,
|
59
|
+
skipPreview,
|
60
|
+
initialName,
|
61
|
+
asRole,
|
62
|
+
}: {
|
63
|
+
onJoin: () => void;
|
64
|
+
skipPreview?: boolean;
|
65
|
+
initialName?: string;
|
66
|
+
asRole?: string;
|
67
|
+
}) => {
|
42
68
|
const [previewPreference, setPreviewPreference] = useUserPreferences(
|
43
69
|
UserPreferencesKeys.PREVIEW,
|
44
70
|
defaultPreviewPreference,
|
@@ -46,7 +72,7 @@ const PreviewJoin = ({ onJoin, skipPreview, initialName, asRole }) => {
|
|
46
72
|
const { isStreamingOn } = useRecordingStreaming();
|
47
73
|
const authToken = useAuthToken();
|
48
74
|
const [name, setName] = useState(initialName || previewPreference.name);
|
49
|
-
const {
|
75
|
+
const { toggleAudio, toggleVideo } = useAVToggle();
|
50
76
|
const [previewError, setPreviewError] = useState(false);
|
51
77
|
const { endpoints } = useHMSPrebuiltContext();
|
52
78
|
const { peerCount } = useParticipants();
|
@@ -72,12 +98,10 @@ const PreviewJoin = ({ onJoin, skipPreview, initialName, asRole }) => {
|
|
72
98
|
const savePreferenceAndJoin = useCallback(() => {
|
73
99
|
setPreviewPreference({
|
74
100
|
name,
|
75
|
-
isAudioMuted: !isLocalAudioEnabled,
|
76
|
-
isVideoMuted: !isLocalVideoEnabled,
|
77
101
|
});
|
78
102
|
join();
|
79
103
|
onJoin && onJoin();
|
80
|
-
}, [join,
|
104
|
+
}, [join, name, setPreviewPreference, onJoin]);
|
81
105
|
const roomLayout = useRoomLayout();
|
82
106
|
|
83
107
|
const { preview_header: previewHeader = {} } = roomLayout?.screens?.preview?.default?.elements || {};
|
@@ -143,11 +167,7 @@ const PreviewJoin = ({ onJoin, skipPreview, initialName, asRole }) => {
|
|
143
167
|
</Flex>
|
144
168
|
) : null}
|
145
169
|
<Box css={{ w: '100%', maxWidth: '640px' }}>
|
146
|
-
<PreviewControls
|
147
|
-
enableJoin={enableJoin}
|
148
|
-
savePreferenceAndJoin={savePreferenceAndJoin}
|
149
|
-
hideSettings={!toggleVideo && !toggleAudio}
|
150
|
-
/>
|
170
|
+
<PreviewControls hideSettings={!toggleVideo && !toggleAudio} />
|
151
171
|
<PreviewForm
|
152
172
|
name={name}
|
153
173
|
onChange={setName}
|
@@ -170,30 +190,32 @@ const Container = styled('div', {
|
|
170
190
|
px: '$10',
|
171
191
|
});
|
172
192
|
|
173
|
-
const PreviewTile = ({ name, error }) => {
|
193
|
+
export const PreviewTile = ({ name, error }: { name: string; error?: boolean }) => {
|
174
194
|
const localPeer = useHMSStore(selectLocalPeer);
|
175
|
-
const borderAudioRef = useBorderAudioLevel(localPeer?.audioTrack);
|
176
195
|
const { isLocalAudioEnabled, toggleAudio } = useAVToggle();
|
177
196
|
const isVideoOn = useHMSStore(selectIsLocalVideoEnabled);
|
178
197
|
const mirrorLocalVideo = useUISettings(UI_SETTINGS.mirrorLocalVideo);
|
179
198
|
const trackSelector = selectVideoTrackByID(localPeer?.videoTrack);
|
180
199
|
const track = useHMSStore(trackSelector);
|
181
200
|
const showMuteIcon = !isLocalAudioEnabled || !toggleAudio;
|
182
|
-
|
201
|
+
const videoTrack = useHMSStore(selectVideoTrackByID(localPeer?.videoTrack));
|
202
|
+
const isMobile = useMedia(cssConfig.media.md);
|
203
|
+
const aspectRatio =
|
204
|
+
videoTrack?.width && videoTrack?.height ? videoTrack.width / videoTrack.height : isMobile ? 9 / 16 : 16 / 9;
|
183
205
|
return (
|
184
206
|
<StyledVideoTile.Container
|
185
207
|
css={{
|
186
208
|
bg: '$surface_default',
|
187
|
-
aspectRatio
|
188
|
-
|
209
|
+
aspectRatio,
|
210
|
+
height: 'min(640px, 40vh)',
|
211
|
+
maxWidth: '640px',
|
189
212
|
overflow: 'clip',
|
190
213
|
'@md': {
|
191
|
-
|
192
|
-
width: 'min(275px, 70vw)',
|
214
|
+
width: 'min(220px, 70vw)',
|
193
215
|
maxWidth: '100%',
|
216
|
+
my: '$4',
|
194
217
|
},
|
195
218
|
}}
|
196
|
-
ref={borderAudioRef}
|
197
219
|
>
|
198
220
|
{localPeer ? (
|
199
221
|
<>
|
@@ -216,13 +238,17 @@ const PreviewTile = ({ name, error }) => {
|
|
216
238
|
<StyledVideoTile.AudioIndicator size="medium">
|
217
239
|
<MicOffIcon />
|
218
240
|
</StyledVideoTile.AudioIndicator>
|
219
|
-
) :
|
241
|
+
) : (
|
242
|
+
<AudioLevel trackId={localPeer?.audioTrack} />
|
243
|
+
)}
|
220
244
|
</StyledVideoTile.Container>
|
221
245
|
);
|
222
246
|
};
|
223
247
|
|
224
|
-
const PreviewControls = ({ hideSettings }) => {
|
248
|
+
export const PreviewControls = ({ hideSettings }: { hideSettings: boolean }) => {
|
225
249
|
const isVideoOn = useHMSStore(selectIsLocalVideoEnabled);
|
250
|
+
const isMobile = useMedia(cssConfig.media.md);
|
251
|
+
|
226
252
|
return (
|
227
253
|
<Flex
|
228
254
|
justify="between"
|
@@ -233,7 +259,7 @@ const PreviewControls = ({ hideSettings }) => {
|
|
233
259
|
>
|
234
260
|
<Flex css={{ gap: '$4' }}>
|
235
261
|
<AudioVideoToggle compact />
|
236
|
-
<Suspense fallback="">{isVideoOn ? <VirtualBackground /> : null}</Suspense>
|
262
|
+
<Suspense fallback="">{isVideoOn && !isMobile ? <VirtualBackground /> : null}</Suspense>
|
237
263
|
</Flex>
|
238
264
|
{!hideSettings ? <PreviewSettings /> : null}
|
239
265
|
</Flex>
|
@@ -3,20 +3,13 @@ import { selectLocalPeer, selectPeerMetadata, useHMSStore } from '@100mslive/rea
|
|
3
3
|
import { HandIcon } from '@100mslive/react-icons';
|
4
4
|
import { Tooltip } from '../../Tooltip';
|
5
5
|
import IconButton from '../IconButton';
|
6
|
-
import { useIsFeatureEnabled } from './hooks/useFeatures';
|
7
6
|
import { useMyMetadata } from './hooks/useMetadata';
|
8
|
-
import { FEATURE_LIST } from '../common/constants';
|
9
7
|
|
10
8
|
export const RaiseHand = () => {
|
11
|
-
const isHandRaiseEnabled = useIsFeatureEnabled(FEATURE_LIST.HAND_RAISE);
|
12
9
|
const { toggleHandRaise } = useMyMetadata();
|
13
10
|
const localPeer = useHMSStore(selectLocalPeer);
|
14
11
|
const isHandRaised = useHMSStore(selectPeerMetadata(localPeer.id))?.isHandRaised || false;
|
15
12
|
|
16
|
-
if (!isHandRaiseEnabled) {
|
17
|
-
return null;
|
18
|
-
}
|
19
|
-
|
20
13
|
return (
|
21
14
|
<Tooltip title={isHandRaised ? 'Lower hand' : 'Raise hand'}>
|
22
15
|
<IconButton active={!isHandRaised} onClick={toggleHandRaise}>
|
@@ -0,0 +1,119 @@
|
|
1
|
+
import React, { useEffect } from 'react';
|
2
|
+
import {
|
3
|
+
selectLocalPeerName,
|
4
|
+
selectLocalPeerRoleName,
|
5
|
+
selectRoleChangeRequest,
|
6
|
+
useCustomEvent,
|
7
|
+
useHMSActions,
|
8
|
+
useHMSStore,
|
9
|
+
} from '@100mslive/react-sdk';
|
10
|
+
// @ts-ignore: No implicit Any
|
11
|
+
import { PreviewControls, PreviewTile } from './Preview/PreviewJoin';
|
12
|
+
import { Box, Button, Dialog, Flex, Text } from '../..';
|
13
|
+
// @ts-ignore: No implicit Any
|
14
|
+
import { useMyMetadata } from './hooks/useMetadata';
|
15
|
+
// @ts-ignore: No implicit Any
|
16
|
+
import { ROLE_CHANGE_DECLINED } from '../common/constants';
|
17
|
+
|
18
|
+
export const RoleChangeRequestModal = () => {
|
19
|
+
const hmsActions = useHMSActions();
|
20
|
+
const { updateMetaData } = useMyMetadata();
|
21
|
+
const currentRole = useHMSStore(selectLocalPeerRoleName);
|
22
|
+
const roleChangeRequest = useHMSStore(selectRoleChangeRequest);
|
23
|
+
const name = useHMSStore(selectLocalPeerName);
|
24
|
+
const { sendEvent } = useCustomEvent({ type: ROLE_CHANGE_DECLINED });
|
25
|
+
|
26
|
+
useEffect(() => {
|
27
|
+
if (!roleChangeRequest?.role) {
|
28
|
+
return;
|
29
|
+
}
|
30
|
+
|
31
|
+
hmsActions.preview({ asRole: roleChangeRequest.role.name });
|
32
|
+
}, [hmsActions, roleChangeRequest]);
|
33
|
+
|
34
|
+
if (!roleChangeRequest?.role) {
|
35
|
+
return null;
|
36
|
+
}
|
37
|
+
|
38
|
+
const body = (
|
39
|
+
<>
|
40
|
+
<Text css={{ fontWeight: 400, c: '$on_surface_medium', textAlign: 'center' }}>
|
41
|
+
Setup your audio and video before joining
|
42
|
+
</Text>
|
43
|
+
<Flex
|
44
|
+
align="center"
|
45
|
+
justify="center"
|
46
|
+
css={{
|
47
|
+
'@sm': { width: '100%' },
|
48
|
+
flexDirection: 'column',
|
49
|
+
mt: '$6',
|
50
|
+
}}
|
51
|
+
>
|
52
|
+
<PreviewTile name={name || ''} />
|
53
|
+
<PreviewControls hideSettings={true} />
|
54
|
+
</Flex>
|
55
|
+
</>
|
56
|
+
);
|
57
|
+
|
58
|
+
return (
|
59
|
+
<RequestDialog
|
60
|
+
title={`You're invited to join the ${roleChangeRequest.role.name} role`}
|
61
|
+
onOpenChange={async value => {
|
62
|
+
if (!value) {
|
63
|
+
await hmsActions.rejectChangeRole(roleChangeRequest);
|
64
|
+
sendEvent({ ...roleChangeRequest, peerName: name }, { peerId: roleChangeRequest.requestedBy?.id });
|
65
|
+
await hmsActions.cancelMidCallPreview();
|
66
|
+
await updateMetaData({ isHandRaised: false });
|
67
|
+
}
|
68
|
+
}}
|
69
|
+
body={body}
|
70
|
+
onAction={async () => {
|
71
|
+
await hmsActions.acceptChangeRole(roleChangeRequest);
|
72
|
+
await updateMetaData({ isHandRaised: false, prevRole: currentRole });
|
73
|
+
}}
|
74
|
+
actionText="Accept"
|
75
|
+
/>
|
76
|
+
);
|
77
|
+
};
|
78
|
+
|
79
|
+
const RequestDialog = ({
|
80
|
+
open = true,
|
81
|
+
onOpenChange,
|
82
|
+
title,
|
83
|
+
body,
|
84
|
+
actionText = 'Accept',
|
85
|
+
onAction,
|
86
|
+
}: {
|
87
|
+
open?: boolean;
|
88
|
+
onOpenChange: (value: boolean) => void;
|
89
|
+
title: string;
|
90
|
+
body: React.ReactNode;
|
91
|
+
actionText?: string;
|
92
|
+
onAction: () => void;
|
93
|
+
}) => (
|
94
|
+
<Dialog.Root open={open} onOpenChange={onOpenChange}>
|
95
|
+
<Dialog.Portal>
|
96
|
+
<Dialog.Overlay />
|
97
|
+
<Dialog.Content css={{ p: '$10' }}>
|
98
|
+
<Dialog.Title css={{ p: 0, display: 'flex', flexDirection: 'row', gap: '$md', justifyContent: 'center' }}>
|
99
|
+
<Text variant="h6">{title}</Text>
|
100
|
+
</Dialog.Title>
|
101
|
+
<Box css={{ mt: '$4', mb: '$10' }}>{body}</Box>
|
102
|
+
<Flex justify="center" align="center" css={{ width: '100%', gap: '$md' }}>
|
103
|
+
<Box css={{ width: '50%' }}>
|
104
|
+
<Dialog.Close css={{ width: '100%' }}>
|
105
|
+
<Button variant="standard" outlined css={{ width: '100%' }}>
|
106
|
+
Cancel
|
107
|
+
</Button>
|
108
|
+
</Dialog.Close>
|
109
|
+
</Box>
|
110
|
+
<Box css={{ width: '50%' }}>
|
111
|
+
<Button variant="primary" css={{ width: '100%' }} onClick={onAction}>
|
112
|
+
{actionText}
|
113
|
+
</Button>
|
114
|
+
</Box>
|
115
|
+
</Flex>
|
116
|
+
</Dialog.Content>
|
117
|
+
</Dialog.Portal>
|
118
|
+
</Dialog.Root>
|
119
|
+
);
|
@@ -14,24 +14,18 @@ export const ScreenshareDisplay = () => {
|
|
14
14
|
align="center"
|
15
15
|
justify="center"
|
16
16
|
css={{
|
17
|
-
|
18
|
-
overflow: 'hidden',
|
19
|
-
w: '37.5rem',
|
20
|
-
maxWidth: '80%',
|
21
|
-
h: '100%',
|
22
|
-
r: '$3',
|
23
|
-
m: '0 auto',
|
24
|
-
color: '$on_surface_high',
|
17
|
+
size: '100%',
|
25
18
|
bg: '$background_default',
|
26
|
-
|
19
|
+
color: '$on_surface_high',
|
27
20
|
}}
|
28
21
|
>
|
29
22
|
<ShareScreenIcon width={48} height={48} />
|
30
|
-
<Text variant="h5" css={{ m: '$8 0'
|
23
|
+
<Text variant="h5" css={{ m: '$8 0' }}>
|
31
24
|
You are sharing your screen
|
32
25
|
</Text>
|
33
26
|
<Button
|
34
27
|
variant="danger"
|
28
|
+
css={{ fontWeight: '$semiBold' }}
|
35
29
|
onClick={async () => {
|
36
30
|
await hmsActions.setScreenShareEnabled(false);
|
37
31
|
}}
|
@@ -14,15 +14,16 @@ import { VideoTileStats } from '../../Stats';
|
|
14
14
|
import { Video } from '../../Video';
|
15
15
|
import { StyledVideoTile } from '../../VideoTile';
|
16
16
|
import { getVideoTileLabel } from './peerTileUtils';
|
17
|
-
import {
|
17
|
+
import { ScreenshareDisplay } from './ScreenshareDisplay';
|
18
|
+
import { useUISettings } from './AppData/useUISettings';
|
18
19
|
import { UI_SETTINGS } from '../common/constants';
|
19
20
|
|
20
21
|
const labelStyles = {
|
21
22
|
position: 'unset',
|
22
23
|
width: '100%',
|
23
24
|
textAlign: 'center',
|
25
|
+
c: '$on_surface_high',
|
24
26
|
transform: 'none',
|
25
|
-
mt: '$2',
|
26
27
|
flexShrink: 0,
|
27
28
|
};
|
28
29
|
|
@@ -31,7 +32,6 @@ const Tile = ({ peerId, width = '100%', height = '100%' }) => {
|
|
31
32
|
const track = useHMSStore(selectScreenShareByPeerID(peerId));
|
32
33
|
const peer = useHMSStore(selectPeerByID(peerId));
|
33
34
|
const isAudioOnly = useUISettings(UI_SETTINGS.isAudioOnly);
|
34
|
-
const isHeadless = useIsHeadless();
|
35
35
|
const [isMouseHovered, setIsMouseHovered] = useState(false);
|
36
36
|
const showStatsOnTiles = useUISettings(UI_SETTINGS.showStatsOnTiles);
|
37
37
|
const label = getVideoTileLabel({
|
@@ -48,40 +48,47 @@ const Tile = ({ peerId, width = '100%', height = '100%' }) => {
|
|
48
48
|
});
|
49
49
|
const isFullScreenSupported = screenfull.isEnabled;
|
50
50
|
const audioTrack = useHMSStore(selectScreenShareAudioByPeerID(peer?.id));
|
51
|
+
|
52
|
+
if (isLocal && !['browser', 'window', 'application'].includes(track?.displaySurface)) {
|
53
|
+
return <ScreenshareDisplay />;
|
54
|
+
}
|
55
|
+
|
56
|
+
if (!peer) {
|
57
|
+
return null;
|
58
|
+
}
|
51
59
|
return (
|
52
|
-
<StyledVideoTile.Root css={{ width, height, p: 0 }} data-testid="screenshare_tile">
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
{
|
64
|
-
|
65
|
-
|
66
|
-
{
|
67
|
-
<
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
) : null}
|
60
|
+
<StyledVideoTile.Root css={{ width, height, p: 0, minHeight: 0 }} data-testid="screenshare_tile">
|
61
|
+
<StyledVideoTile.Container
|
62
|
+
transparentBg
|
63
|
+
ref={fullscreenRef}
|
64
|
+
css={{ flexDirection: 'column', gap: '$2' }}
|
65
|
+
onMouseEnter={() => setIsMouseHovered(true)}
|
66
|
+
onMouseLeave={() => {
|
67
|
+
setIsMouseHovered(false);
|
68
|
+
}}
|
69
|
+
>
|
70
|
+
{showStatsOnTiles ? (
|
71
|
+
<VideoTileStats audioTrackID={audioTrack?.id} videoTrackID={track?.id} peerID={peerId} isLocal={isLocal} />
|
72
|
+
) : null}
|
73
|
+
{isFullScreenSupported && isMouseHovered ? (
|
74
|
+
<StyledVideoTile.FullScreenButton onClick={() => setFullscreen(!fullscreen)}>
|
75
|
+
{isFullscreen ? <ShrinkIcon /> : <ExpandIcon />}
|
76
|
+
</StyledVideoTile.FullScreenButton>
|
77
|
+
) : null}
|
78
|
+
{track ? (
|
79
|
+
<Video
|
80
|
+
screenShare={true}
|
81
|
+
mirror={peer.isLocal && track?.source === 'regular'}
|
82
|
+
attach={!isAudioOnly}
|
83
|
+
trackId={track.id}
|
84
|
+
css={{ minHeight: 0 }}
|
85
|
+
/>
|
86
|
+
) : null}
|
87
|
+
<StyledVideoTile.Info css={labelStyles}>{label}</StyledVideoTile.Info>
|
88
|
+
{isMouseHovered && !peer?.isLocal ? (
|
89
|
+
<TileMenu isScreenshare peerID={peer?.id} audioTrackID={audioTrack?.id} videoTrackID={track?.id} />
|
90
|
+
) : null}
|
91
|
+
</StyledVideoTile.Container>
|
85
92
|
</StyledVideoTile.Root>
|
86
93
|
);
|
87
94
|
};
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
2
|
+
import { useMedia } from 'react-use';
|
3
|
+
import { LayoutProps } from './VideoLayouts/interface';
|
4
|
+
import { ProminenceLayout } from './VideoLayouts/ProminenceLayout';
|
5
|
+
import { config as cssConfig } from '../../Theme';
|
6
|
+
import { Pagination } from './Pagination';
|
7
|
+
import { usePagesWithTiles } from './hooks/useTileLayout';
|
8
|
+
|
9
|
+
export const SecondaryTiles = ({ peers, onPageChange, onPageSize, edgeToEdge }: LayoutProps) => {
|
10
|
+
const isMobile = useMedia(cssConfig.media.md);
|
11
|
+
const maxTileCount = isMobile ? 2 : 4;
|
12
|
+
const pagesWithTiles = usePagesWithTiles({ peers, maxTileCount });
|
13
|
+
const [page, setPage] = useState(0);
|
14
|
+
const pageSize = pagesWithTiles[0]?.length || 0;
|
15
|
+
|
16
|
+
useEffect(() => {
|
17
|
+
if (pageSize > 0) {
|
18
|
+
onPageSize?.(pageSize);
|
19
|
+
}
|
20
|
+
}, [pageSize, onPageSize]);
|
21
|
+
|
22
|
+
return (
|
23
|
+
<ProminenceLayout.SecondarySection tiles={pagesWithTiles[page]} edgeToEdge={edgeToEdge}>
|
24
|
+
{!edgeToEdge && (
|
25
|
+
<Pagination
|
26
|
+
page={page}
|
27
|
+
onPageChange={page => {
|
28
|
+
setPage(page);
|
29
|
+
onPageChange?.(page);
|
30
|
+
}}
|
31
|
+
numPages={pagesWithTiles.length}
|
32
|
+
/>
|
33
|
+
)}
|
34
|
+
</ProminenceLayout.SecondarySection>
|
35
|
+
);
|
36
|
+
};
|