@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
@@ -4,13 +4,13 @@ import { Box, Flex, Slider, Text } from '../../../';
|
|
4
4
|
import SwitchWithLabel from './SwitchWithLabel';
|
5
5
|
import { useSetUiSettings } from '../AppData/useUISettings';
|
6
6
|
import { settingOverflow } from './common.js';
|
7
|
-
import {
|
7
|
+
import { UI_SETTINGS } from '../../common/constants';
|
8
8
|
|
9
9
|
export const LayoutSettings = () => {
|
10
10
|
const hmsActions = useHMSActions();
|
11
11
|
const isLocalVideoEnabled = useHMSStore(selectIsLocalVideoEnabled);
|
12
12
|
const isLocalScreenShared = useHMSStore(selectIsLocalScreenShared);
|
13
|
-
const [{ isAudioOnly,
|
13
|
+
const [{ isAudioOnly, maxTileCount, mirrorLocalVideo }, setUISettings] = useSetUiSettings();
|
14
14
|
const toggleIsAudioOnly = useCallback(
|
15
15
|
async isAudioOnlyModeOn => {
|
16
16
|
if (isAudioOnlyModeOn) {
|
@@ -25,16 +25,6 @@ export const LayoutSettings = () => {
|
|
25
25
|
|
26
26
|
return (
|
27
27
|
<Box className={settingOverflow()}>
|
28
|
-
<SwitchWithLabel
|
29
|
-
checked={uiViewMode === UI_MODE_ACTIVE_SPEAKER}
|
30
|
-
onChange={value => {
|
31
|
-
setUISettings({
|
32
|
-
[UI_SETTINGS.uiViewMode]: value ? UI_MODE_ACTIVE_SPEAKER : UI_MODE_GRID,
|
33
|
-
});
|
34
|
-
}}
|
35
|
-
id="activeSpeakerMode"
|
36
|
-
label="Active Speaker Mode"
|
37
|
-
/>
|
38
28
|
<SwitchWithLabel label="Audio Only Mode" id="audioOnlyMode" checked={isAudioOnly} onChange={toggleIsAudioOnly} />
|
39
29
|
<SwitchWithLabel
|
40
30
|
label="Mirror Local Video"
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import { AlertOctagonIcon,
|
2
|
+
import { AlertOctagonIcon, HandIcon, PeopleAddIcon, PeopleRemoveIcon } from '@100mslive/react-icons';
|
3
3
|
import { Box } from '../../../';
|
4
4
|
import SwitchWithLabel from './SwitchWithLabel';
|
5
5
|
import { useSetSubscribedNotifications, useSubscribedNotifications } from '../AppData/useUISettings';
|
@@ -29,21 +29,15 @@ export const NotificationSettings = () => {
|
|
29
29
|
<NotificationItem
|
30
30
|
label="Peer Joined"
|
31
31
|
type={SUBSCRIBED_NOTIFICATIONS.PEER_JOINED}
|
32
|
-
icon={<
|
32
|
+
icon={<PeopleAddIcon />}
|
33
33
|
checked={subscribedNotifications.PEER_JOINED}
|
34
34
|
/>
|
35
35
|
<NotificationItem
|
36
36
|
label="Peer Leave"
|
37
37
|
type={SUBSCRIBED_NOTIFICATIONS.PEER_LEFT}
|
38
|
-
icon={<
|
38
|
+
icon={<PeopleRemoveIcon />}
|
39
39
|
checked={subscribedNotifications.PEER_LEFT}
|
40
40
|
/>
|
41
|
-
<NotificationItem
|
42
|
-
label="New Message"
|
43
|
-
type={SUBSCRIBED_NOTIFICATIONS.NEW_MESSAGE}
|
44
|
-
icon={<ChatIcon />}
|
45
|
-
checked={subscribedNotifications.NEW_MESSAGE}
|
46
|
-
/>
|
47
41
|
<NotificationItem
|
48
42
|
label="Hand Raised"
|
49
43
|
type={SUBSCRIBED_NOTIFICATIONS.METADATA_UPDATED}
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import React, { useCallback, useEffect, useState } from 'react';
|
2
2
|
import { useMedia } from 'react-use';
|
3
|
-
import { selectLocalPeerRoleName, useHMSStore } from '@100mslive/react-sdk';
|
4
3
|
import { ChevronLeftIcon, CrossIcon } from '@100mslive/react-icons';
|
5
4
|
import { HorizontalDivider } from '../../../Divider';
|
6
5
|
import { IconButton } from '../../../IconButton';
|
@@ -10,17 +9,12 @@ import { Sheet } from '../../../Sheet';
|
|
10
9
|
import { Tabs } from '../../../Tabs';
|
11
10
|
import { Text } from '../../../Text';
|
12
11
|
import { config as cssConfig } from '../../../Theme';
|
13
|
-
import { useHLSViewerRole } from '../AppData/useUISettings';
|
14
12
|
import { settingContent, settingsList } from './common.js';
|
15
13
|
|
16
|
-
const SettingsModal = ({ open, onOpenChange, children = <></> }) => {
|
14
|
+
const SettingsModal = ({ open, onOpenChange, screenType, children = <></> }) => {
|
17
15
|
const mediaQueryLg = cssConfig.media.md;
|
18
16
|
const isMobile = useMedia(mediaQueryLg);
|
19
17
|
|
20
|
-
const hlsViewerRole = useHLSViewerRole();
|
21
|
-
const localPeerRole = useHMSStore(selectLocalPeerRoleName);
|
22
|
-
const isHlsViewer = hlsViewerRole === localPeerRole;
|
23
|
-
|
24
18
|
const [showSetting, setShowSetting] = useState(() =>
|
25
19
|
settingsList.reduce((obj, { tabName }) => ({ ...obj, [tabName]: true }), {}),
|
26
20
|
);
|
@@ -31,10 +25,10 @@ const SettingsModal = ({ open, onOpenChange, children = <></> }) => {
|
|
31
25
|
);
|
32
26
|
|
33
27
|
useEffect(() => {
|
34
|
-
if (
|
28
|
+
if (screenType === 'hls_live_streaming') {
|
35
29
|
hideSettingByTabName('layout')(true);
|
36
30
|
}
|
37
|
-
}, [
|
31
|
+
}, [screenType, hideSettingByTabName]);
|
38
32
|
|
39
33
|
const [selection, setSelection] = useState(() => Object.keys(showSetting).find(key => showSetting[key]) ?? '');
|
40
34
|
const resetSelection = useCallback(() => {
|
@@ -76,7 +76,9 @@ export const StatsForNerds = ({ onOpenChange }) => {
|
|
76
76
|
minWidth: 0,
|
77
77
|
}}
|
78
78
|
>
|
79
|
-
<Label variant="body2"
|
79
|
+
<Label variant="body2" css={{ c: '$on_surface_high' }}>
|
80
|
+
Stats For
|
81
|
+
</Label>
|
80
82
|
<Dropdown.Root data-testid="dialog_select_Stats For" open={open} onOpenChange={setOpen}>
|
81
83
|
<DialogDropdownTrigger
|
82
84
|
title={selectedStat.label || 'Select Stats'}
|
@@ -4,7 +4,6 @@ import {
|
|
4
4
|
selectLocalPeerID,
|
5
5
|
selectPeerByID,
|
6
6
|
selectPermissions,
|
7
|
-
selectTemplateAppData,
|
8
7
|
selectTrackByID,
|
9
8
|
selectVideoTrackByPeerID,
|
10
9
|
useHMSStore,
|
@@ -19,28 +18,29 @@ import { StyledMenuTile } from '../../../TileMenu';
|
|
19
18
|
import { ChangeNameModal } from '../MoreSettings/ChangeNameModal';
|
20
19
|
import { TileMenuContent } from './TileMenuContent';
|
21
20
|
import { useDropdownList } from '../hooks/useDropdownList';
|
22
|
-
import { useIsFeatureEnabled } from '../hooks/useFeatures';
|
23
|
-
import { FEATURE_LIST } from '../../common/constants';
|
24
21
|
|
25
22
|
/**
|
26
23
|
* Taking peerID as peer won't necesarilly have tracks
|
27
24
|
*/
|
28
|
-
const TileMenu = ({
|
25
|
+
const TileMenu = ({
|
26
|
+
audioTrackID,
|
27
|
+
videoTrackID,
|
28
|
+
peerID,
|
29
|
+
isScreenshare = false,
|
30
|
+
canMinimise,
|
31
|
+
enableSpotlightingPeer = true,
|
32
|
+
}) => {
|
29
33
|
const [open, setOpen] = useState(false);
|
30
34
|
const { theme } = useTheme();
|
31
35
|
|
32
36
|
const localPeerID = useHMSStore(selectLocalPeerID);
|
33
37
|
const isLocal = localPeerID === peerID;
|
34
|
-
const { removeOthers
|
38
|
+
const { removeOthers } = useHMSStore(selectPermissions);
|
35
39
|
const { setVolume, toggleAudio, toggleVideo } = useRemoteAVToggle(audioTrackID, videoTrackID);
|
36
|
-
const showSpotlight =
|
40
|
+
const showSpotlight = enableSpotlightingPeer;
|
37
41
|
|
38
42
|
const isPrimaryVideoTrack = useHMSStore(selectVideoTrackByPeerID(peerID))?.id === videoTrackID;
|
39
|
-
const
|
40
|
-
const isInset = uiMode === 'inset';
|
41
|
-
|
42
|
-
const isPinEnabled = useIsFeatureEnabled(FEATURE_LIST.PIN_TILE);
|
43
|
-
const showPinAction = isPinEnabled && (audioTrackID || (videoTrackID && isPrimaryVideoTrack)) && !isInset;
|
43
|
+
const showPinAction = audioTrackID || (videoTrackID && isPrimaryVideoTrack);
|
44
44
|
|
45
45
|
const track = useHMSStore(selectTrackByID(videoTrackID));
|
46
46
|
const hideSimulcastLayers = !track?.layerDefinitions?.length || track.degraded || !track.enabled;
|
@@ -53,9 +53,6 @@ const TileMenu = ({ audioTrackID, videoTrackID, peerID, isScreenshare = false, c
|
|
53
53
|
return null;
|
54
54
|
}
|
55
55
|
|
56
|
-
if (isInset && isLocal) {
|
57
|
-
return null;
|
58
|
-
}
|
59
56
|
const openNameChangeModal = () => setShowNameChangeModal(true);
|
60
57
|
|
61
58
|
const props = {
|
@@ -76,7 +73,7 @@ const TileMenu = ({ audioTrackID, videoTrackID, peerID, isScreenshare = false, c
|
|
76
73
|
<StyledMenuTile.Root open={open} onOpenChange={setOpen}>
|
77
74
|
<StyledMenuTile.Trigger
|
78
75
|
data-testid="participant_menu_btn"
|
79
|
-
css={{ bg: `${theme.colors.background_dim.value}A3
|
76
|
+
css={{ bg: `${theme.colors.background_dim.value}A3`, p: '$2', w: 'unset', h: 'unset' }}
|
80
77
|
onClick={e => e.stopPropagation()}
|
81
78
|
className={isMobile ? '__cancel-drag-event' : ''}
|
82
79
|
>
|
@@ -114,13 +111,13 @@ const TileMenu = ({ audioTrackID, videoTrackID, peerID, isScreenshare = false, c
|
|
114
111
|
<CrossIcon />
|
115
112
|
</Sheet.Close>
|
116
113
|
</Flex>
|
117
|
-
<Box css={{ px: '$8', pb: '$
|
114
|
+
<Box css={{ px: '$8', pb: '$8', maxHeight: '80vh', overflowY: 'auto' }}>
|
118
115
|
<TileMenuContent {...props} closeSheetOnClick={() => setOpen(false)} />
|
119
116
|
</Box>
|
120
117
|
</Sheet.Content>
|
121
118
|
</Sheet.Root>
|
122
119
|
) : (
|
123
|
-
<StyledMenuTile.Content side="top" align="end">
|
120
|
+
<StyledMenuTile.Content side="top" align="end" css={{ maxHeight: '$80', overflowY: 'auto' }}>
|
124
121
|
<TileMenuContent {...props} />
|
125
122
|
</StyledMenuTile.Content>
|
126
123
|
)}
|
@@ -130,4 +127,6 @@ const TileMenu = ({ audioTrackID, videoTrackID, peerID, isScreenshare = false, c
|
|
130
127
|
);
|
131
128
|
};
|
132
129
|
|
130
|
+
export { isSameTile } from './TileMenuContent';
|
131
|
+
|
133
132
|
export default TileMenu;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import React, { Fragment } from 'react';
|
2
|
+
import { useMedia } from 'react-use';
|
2
3
|
import {
|
3
4
|
selectPermissions,
|
4
5
|
selectSessionStore,
|
@@ -24,14 +25,14 @@ import {
|
|
24
25
|
import { Box, Flex } from '../../../Layout';
|
25
26
|
import { Slider } from '../../../Slider';
|
26
27
|
import { Text } from '../../../Text';
|
28
|
+
import { config as cssConfig } from '../../../Theme';
|
27
29
|
import { StyledMenuTile } from '../../../TileMenu';
|
28
30
|
import { ToastManager } from '../Toast/ToastManager';
|
29
31
|
import { useSetAppDataByKey } from '../AppData/useUISettings';
|
30
32
|
import { useDropdownSelection } from '../hooks/useDropdownSelection';
|
31
|
-
import {
|
32
|
-
import { APP_DATA, FEATURE_LIST, REMOTE_STOP_SCREENSHARE_TYPE, SESSION_STORE_KEY } from '../../common/constants';
|
33
|
+
import { APP_DATA, REMOTE_STOP_SCREENSHARE_TYPE, SESSION_STORE_KEY } from '../../common/constants';
|
33
34
|
|
34
|
-
const isSameTile = ({ trackId, videoTrackID, audioTrackID }) =>
|
35
|
+
export const isSameTile = ({ trackId, videoTrackID, audioTrackID }) =>
|
35
36
|
trackId && ((videoTrackID && videoTrackID === trackId) || (audioTrackID && audioTrackID === trackId));
|
36
37
|
|
37
38
|
const spacingCSS = { '@md': { my: '$8', fontWeight: '$semiBold', fontSize: 'sm' } };
|
@@ -63,7 +64,7 @@ const SpotlightActions = ({
|
|
63
64
|
onSpotLightClick();
|
64
65
|
}}
|
65
66
|
>
|
66
|
-
<StarIcon />
|
67
|
+
<StarIcon height={20} width={20} />
|
67
68
|
<span>{isTileSpotlighted ? 'Remove from Spotlight' : 'Spotlight Tile for everyone'}</span>
|
68
69
|
</StyledMenuTile.ItemButton>
|
69
70
|
);
|
@@ -84,7 +85,7 @@ const PinActions = ({ audioTrackID, videoTrackID }) => {
|
|
84
85
|
css={spacingCSS}
|
85
86
|
onClick={() => (isTilePinned ? setPinnedTrackId() : setPinnedTrackId(videoTrackID || audioTrackID))}
|
86
87
|
>
|
87
|
-
<PinIcon />
|
88
|
+
<PinIcon height={20} width={20} />
|
88
89
|
<span>{isTilePinned ? 'Unpin' : 'Pin'} Tile for myself</span>
|
89
90
|
</StyledMenuTile.ItemButton>
|
90
91
|
</>
|
@@ -97,7 +98,7 @@ const MinimiseInset = () => {
|
|
97
98
|
return (
|
98
99
|
<>
|
99
100
|
<StyledMenuTile.ItemButton css={spacingCSS} onClick={() => setMinimised(!minimised)}>
|
100
|
-
<ShrinkIcon />
|
101
|
+
<ShrinkIcon height={20} width={20} />
|
101
102
|
<span>{minimised ? 'Show' : 'Minimise'} your video</span>
|
102
103
|
</StyledMenuTile.ItemButton>
|
103
104
|
</>
|
@@ -138,11 +139,18 @@ const SimulcastLayers = ({ trackId }) => {
|
|
138
139
|
textTransform: 'capitalize',
|
139
140
|
mr: '$2',
|
140
141
|
fontWeight: track.preferredLayer === layer.layer ? '$semiBold' : '$regular',
|
142
|
+
color: track.preferredLayer === layer.layer ? '$on_primary_high' : '$on_surface_high',
|
141
143
|
}}
|
142
144
|
>
|
143
145
|
{layer.layer}
|
144
146
|
</Text>
|
145
|
-
<Text
|
147
|
+
<Text
|
148
|
+
as="span"
|
149
|
+
variant="xs"
|
150
|
+
css={{
|
151
|
+
color: track.preferredLayer === layer.layer ? '$on_primary_high' : '$on_surface_high',
|
152
|
+
}}
|
153
|
+
>
|
146
154
|
{layer.resolution.width}x{layer.resolution.height}
|
147
155
|
</Text>
|
148
156
|
</StyledMenuTile.ItemButton>
|
@@ -204,7 +212,7 @@ export const TileMenuContent = props => {
|
|
204
212
|
type: REMOTE_STOP_SCREENSHARE_TYPE,
|
205
213
|
});
|
206
214
|
|
207
|
-
const
|
215
|
+
const isMobile = useMedia(cssConfig.media.md);
|
208
216
|
|
209
217
|
return isLocal ? (
|
210
218
|
(showPinAction || canMinimise) && (
|
@@ -212,19 +220,17 @@ export const TileMenuContent = props => {
|
|
212
220
|
{showPinAction && <PinActions audioTrackID={audioTrackID} videoTrackID={videoTrackID} />}
|
213
221
|
{showSpotlight && <SpotlightActions peerId={peerID} onSpotLightClick={() => closeSheetOnClick()} />}
|
214
222
|
{canMinimise && <MinimiseInset />}
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
</StyledMenuTile.ItemButton>
|
227
|
-
) : null}
|
223
|
+
<StyledMenuTile.ItemButton
|
224
|
+
onClick={() => {
|
225
|
+
openNameChangeModal();
|
226
|
+
closeSheetOnClick();
|
227
|
+
}}
|
228
|
+
>
|
229
|
+
<PencilIcon height={20} width={20} />
|
230
|
+
<Text variant="sm" css={{ '@md': { fontWeight: '$semiBold' }, c: '$on_surface_high' }}>
|
231
|
+
Change Name
|
232
|
+
</Text>
|
233
|
+
</StyledMenuTile.ItemButton>
|
228
234
|
</>
|
229
235
|
)
|
230
236
|
) : (
|
@@ -238,7 +244,7 @@ export const TileMenuContent = props => {
|
|
238
244
|
}}
|
239
245
|
data-testid={isVideoEnabled ? 'mute_video_participant_btn' : 'unmute_video_participant_btn'}
|
240
246
|
>
|
241
|
-
{isVideoEnabled ? <VideoOnIcon /> : <VideoOffIcon />}
|
247
|
+
{isVideoEnabled ? <VideoOnIcon height={20} width={20} /> : <VideoOffIcon height={20} width={20} />}
|
242
248
|
<span>{isVideoEnabled ? 'Mute' : 'Request Unmute'}</span>
|
243
249
|
</StyledMenuTile.ItemButton>
|
244
250
|
) : null}
|
@@ -252,7 +258,7 @@ export const TileMenuContent = props => {
|
|
252
258
|
}}
|
253
259
|
data-testid={isVideoEnabled ? 'mute_audio_participant_btn' : 'unmute_audio_participant_btn'}
|
254
260
|
>
|
255
|
-
{isAudioEnabled ? <MicOnIcon /> : <MicOffIcon />}
|
261
|
+
{isAudioEnabled ? <MicOnIcon height={20} width={20} /> : <MicOffIcon height={20} width={20} />}
|
256
262
|
<span>{isAudioEnabled ? 'Mute' : 'Request Unmute'}</span>
|
257
263
|
</StyledMenuTile.ItemButton>
|
258
264
|
) : null}
|
@@ -260,7 +266,7 @@ export const TileMenuContent = props => {
|
|
260
266
|
{audioTrackID ? (
|
261
267
|
<StyledMenuTile.VolumeItem data-testid="participant_volume_slider" css={{ ...spacingCSS, mb: '$0' }}>
|
262
268
|
<Flex align="center" gap={1}>
|
263
|
-
<SpeakerIcon />
|
269
|
+
<SpeakerIcon height={20} width={20} />
|
264
270
|
<Box as="span" css={{ ml: '$4' }}>
|
265
271
|
Volume ({volume})
|
266
272
|
</Box>
|
@@ -276,7 +282,7 @@ export const TileMenuContent = props => {
|
|
276
282
|
</>
|
277
283
|
)}
|
278
284
|
|
279
|
-
<SimulcastLayers trackId={videoTrackID} />
|
285
|
+
{isMobile ? null : <SimulcastLayers trackId={videoTrackID} />}
|
280
286
|
|
281
287
|
{removeOthers ? (
|
282
288
|
<StyledMenuTile.RemoveItem
|
@@ -291,7 +297,7 @@ export const TileMenuContent = props => {
|
|
291
297
|
}}
|
292
298
|
data-testid="remove_participant_btn"
|
293
299
|
>
|
294
|
-
<RemoveUserIcon />
|
300
|
+
<RemoveUserIcon height={20} width={20} />
|
295
301
|
<span>Remove Participant</span>
|
296
302
|
</StyledMenuTile.RemoveItem>
|
297
303
|
) : null}
|
@@ -304,7 +310,7 @@ export const TileMenuContent = props => {
|
|
304
310
|
}}
|
305
311
|
css={spacingCSS}
|
306
312
|
>
|
307
|
-
<ShareScreenIcon />
|
313
|
+
<ShareScreenIcon height={20} width={20} />
|
308
314
|
<span>Stop Screenshare</span>
|
309
315
|
</StyledMenuTile.RemoveItem>
|
310
316
|
) : null}
|
@@ -1,6 +1,15 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import {
|
1
|
+
import React, { useCallback } from 'react';
|
2
|
+
import { selectPeerByID, useHMSActions, useHMSStore } from '@100mslive/react-sdk';
|
3
|
+
import {
|
4
|
+
ChatUnreadIcon,
|
5
|
+
ConnectivityIcon,
|
6
|
+
HandIcon,
|
7
|
+
PeopleAddIcon,
|
8
|
+
PeopleRemoveIcon,
|
9
|
+
PoorConnectivityIcon,
|
10
|
+
} from '@100mslive/react-icons';
|
3
11
|
import { Button } from '../../../Button';
|
12
|
+
import { useRoomLayout } from '../../provider/roomLayoutProvider';
|
4
13
|
import { useIsSidepaneTypeOpen, useSidepaneToggle } from '../AppData/useSidepane';
|
5
14
|
import { SIDE_PANE_OPTIONS } from '../../common/constants';
|
6
15
|
|
@@ -18,26 +27,57 @@ const ChatAction = React.forwardRef((_, ref) => {
|
|
18
27
|
</Button>
|
19
28
|
);
|
20
29
|
});
|
30
|
+
|
31
|
+
const HandRaiseAction = React.forwardRef(({ id = '', isSingleHandRaise = true }, ref) => {
|
32
|
+
const hmsActions = useHMSActions();
|
33
|
+
const toggleSidepane = useSidepaneToggle(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
34
|
+
const isParticipantsOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
35
|
+
const peer = useHMSStore(selectPeerByID(id));
|
36
|
+
const layout = useRoomLayout();
|
37
|
+
const {
|
38
|
+
bring_to_stage_label,
|
39
|
+
on_stage_role,
|
40
|
+
off_stage_roles = [],
|
41
|
+
} = layout?.screens?.conferencing?.default?.elements.on_stage_exp || {};
|
42
|
+
|
43
|
+
const onClickHandler = useCallback(() => {
|
44
|
+
if (isSingleHandRaise) {
|
45
|
+
hmsActions.changeRoleOfPeer(id, on_stage_role);
|
46
|
+
} else {
|
47
|
+
!isParticipantsOpen && toggleSidepane();
|
48
|
+
}
|
49
|
+
}, [hmsActions, id, isParticipantsOpen, isSingleHandRaise, on_stage_role, toggleSidepane]);
|
50
|
+
|
51
|
+
// show nothing if handRaise is single and peer role is not hls
|
52
|
+
if (isSingleHandRaise && (!peer || !off_stage_roles.includes(peer.roleName))) {
|
53
|
+
return null;
|
54
|
+
}
|
55
|
+
return (
|
56
|
+
<Button outlined as="div" variant="standard" css={{ w: 'max-content' }} onClick={onClickHandler} ref={ref}>
|
57
|
+
{isSingleHandRaise ? bring_to_stage_label : 'View'}
|
58
|
+
</Button>
|
59
|
+
);
|
60
|
+
});
|
21
61
|
export const ToastConfig = {
|
22
62
|
PEER_LIST: {
|
23
63
|
single: function (notification) {
|
24
64
|
if (notification.data.length === 1) {
|
25
65
|
return {
|
26
66
|
title: `${notification.data[0]?.name} joined`,
|
27
|
-
icon: <
|
67
|
+
icon: <PeopleAddIcon />,
|
28
68
|
};
|
29
69
|
}
|
30
70
|
return {
|
31
71
|
title: `${notification.data[notification.data.length - 1]?.name} and ${
|
32
72
|
notification.data.length - 1
|
33
73
|
} others joined`,
|
34
|
-
icon: <
|
74
|
+
icon: <PeopleAddIcon />,
|
35
75
|
};
|
36
76
|
},
|
37
77
|
multiple: notifications => {
|
38
78
|
return {
|
39
79
|
title: `${notifications[0].data.name} and ${notifications.length - 1} others joined`,
|
40
|
-
icon: <
|
80
|
+
icon: <PeopleAddIcon />,
|
41
81
|
};
|
42
82
|
},
|
43
83
|
},
|
@@ -45,13 +85,13 @@ export const ToastConfig = {
|
|
45
85
|
single: function (notification) {
|
46
86
|
return {
|
47
87
|
title: `${notification.data?.name} joined`,
|
48
|
-
icon: <
|
88
|
+
icon: <PeopleAddIcon />,
|
49
89
|
};
|
50
90
|
},
|
51
91
|
multiple: function (notifications) {
|
52
92
|
return {
|
53
93
|
title: `${notifications[notifications.length - 1].data.name} and ${notifications.length - 1} others joined`,
|
54
|
-
icon: <
|
94
|
+
icon: <PeopleAddIcon />,
|
55
95
|
};
|
56
96
|
},
|
57
97
|
},
|
@@ -59,29 +99,32 @@ export const ToastConfig = {
|
|
59
99
|
single: function (notification) {
|
60
100
|
return {
|
61
101
|
title: `${notification.data?.name} left`,
|
62
|
-
icon: <
|
102
|
+
icon: <PeopleRemoveIcon />,
|
63
103
|
};
|
64
104
|
},
|
65
105
|
multiple: function (notifications) {
|
66
106
|
return {
|
67
107
|
title: `${notifications[notifications.length - 1].data.name} and ${notifications.length - 1} others left`,
|
68
|
-
icon: <
|
108
|
+
icon: <PeopleRemoveIcon />,
|
69
109
|
};
|
70
110
|
},
|
71
111
|
},
|
72
|
-
|
112
|
+
RAISE_HAND: {
|
73
113
|
single: notification => {
|
74
114
|
return {
|
75
115
|
title: `${notification.data?.name} raised hand`,
|
76
116
|
icon: <HandIcon />,
|
117
|
+
action: <HandRaiseAction id={notification.data?.id} />,
|
77
118
|
};
|
78
119
|
},
|
79
120
|
multiple: notifications => {
|
121
|
+
const count = new Set(notifications.map(notification => notification.data?.id)).size;
|
80
122
|
return {
|
81
|
-
title: `${notifications[notifications.length - 1].data?.name}
|
82
|
-
|
83
|
-
}
|
123
|
+
title: `${notifications[notifications.length - 1].data?.name} ${
|
124
|
+
count > 1 ? `${count} and others` : ''
|
125
|
+
} raised hand`,
|
84
126
|
icon: <HandIcon />,
|
127
|
+
action: <HandRaiseAction isSingleHandRaise={false} />,
|
85
128
|
};
|
86
129
|
},
|
87
130
|
},
|
@@ -89,14 +132,14 @@ export const ToastConfig = {
|
|
89
132
|
single: notification => {
|
90
133
|
return {
|
91
134
|
title: `New message from ${notification.data?.senderName}`,
|
92
|
-
icon: <
|
135
|
+
icon: <ChatUnreadIcon />,
|
93
136
|
action: <ChatAction />,
|
94
137
|
};
|
95
138
|
},
|
96
139
|
multiple: notifications => {
|
97
140
|
return {
|
98
141
|
title: `${notifications.length} new messages`,
|
99
|
-
icon: <
|
142
|
+
icon: <ChatUnreadIcon />,
|
100
143
|
action: <ChatAction />,
|
101
144
|
};
|
102
145
|
},
|
@@ -0,0 +1,65 @@
|
|
1
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
2
|
+
import { useMedia } from 'react-use';
|
3
|
+
import { selectLocalPeer, useHMSStore } from '@100mslive/react-sdk';
|
4
|
+
import { Flex } from '../../../Layout';
|
5
|
+
import { config as cssConfig } from '../../../Theme';
|
6
|
+
import { InsetTile } from '../InsetTile';
|
7
|
+
import { Pagination } from '../Pagination';
|
8
|
+
import { Grid } from './Grid';
|
9
|
+
import { LayoutProps } from './interface';
|
10
|
+
// @ts-ignore: No implicit Any
|
11
|
+
import { useUISettings } from '../AppData/useUISettings';
|
12
|
+
import { usePagesWithTiles, useTileLayout } from '../hooks/useTileLayout';
|
13
|
+
// @ts-ignore: No implicit Any
|
14
|
+
import { UI_SETTINGS } from '../../common/constants';
|
15
|
+
|
16
|
+
export function EqualProminence({ isInsetEnabled = false, peers, onPageChange, onPageSize, edgeToEdge }: LayoutProps) {
|
17
|
+
const localPeer = useHMSStore(selectLocalPeer);
|
18
|
+
const isMobile = useMedia(cssConfig.media.md);
|
19
|
+
let maxTileCount = useUISettings(UI_SETTINGS.maxTileCount);
|
20
|
+
maxTileCount = isMobile ? Math.min(maxTileCount, 6) : maxTileCount;
|
21
|
+
let pageList = usePagesWithTiles({
|
22
|
+
peers,
|
23
|
+
maxTileCount,
|
24
|
+
});
|
25
|
+
// useMemo is needed to prevent recursion as new array is created for localPeer
|
26
|
+
const inputPeers = useMemo(
|
27
|
+
() => (pageList.length === 0 ? (localPeer ? [localPeer] : []) : peers),
|
28
|
+
[pageList.length, peers, localPeer],
|
29
|
+
);
|
30
|
+
// Pass local peer to main grid if no other peer has tiles
|
31
|
+
pageList = usePagesWithTiles({
|
32
|
+
peers: inputPeers,
|
33
|
+
maxTileCount,
|
34
|
+
});
|
35
|
+
const { ref, pagesWithTiles } = useTileLayout({
|
36
|
+
pageList,
|
37
|
+
maxTileCount,
|
38
|
+
edgeToEdge,
|
39
|
+
});
|
40
|
+
const [page, setPage] = useState(0);
|
41
|
+
const pageSize = pagesWithTiles[0]?.length || 0;
|
42
|
+
|
43
|
+
useEffect(() => {
|
44
|
+
if (pageSize > 0) {
|
45
|
+
onPageSize?.(pageSize);
|
46
|
+
}
|
47
|
+
}, [pageSize, onPageSize]);
|
48
|
+
|
49
|
+
return (
|
50
|
+
<Flex direction="column" css={{ flex: '1 1 0', h: '100%', position: 'relative', minWidth: 0 }}>
|
51
|
+
<Grid tiles={pagesWithTiles[page]} ref={ref} edgeToEdge={edgeToEdge} />
|
52
|
+
{!edgeToEdge && (
|
53
|
+
<Pagination
|
54
|
+
page={page}
|
55
|
+
onPageChange={page => {
|
56
|
+
setPage(page);
|
57
|
+
onPageChange?.(page);
|
58
|
+
}}
|
59
|
+
numPages={pagesWithTiles.length}
|
60
|
+
/>
|
61
|
+
)}
|
62
|
+
{isInsetEnabled && pageList.length > 0 && pageList[0][0].peer.id !== localPeer?.id && <InsetTile />}
|
63
|
+
</Flex>
|
64
|
+
);
|
65
|
+
}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { TrackWithPeerAndDimensions } from '@100mslive/react-sdk';
|
3
|
+
import { Box } from '../../../Layout';
|
4
|
+
// @ts-ignore: No implicit Any
|
5
|
+
import VideoTile from '../VideoTile';
|
6
|
+
import { useVideoTileContext } from '../hooks/useVideoTileLayout';
|
7
|
+
|
8
|
+
export const Grid = React.forwardRef<HTMLDivElement, { tiles: TrackWithPeerAndDimensions[]; edgeToEdge?: boolean }>(
|
9
|
+
({ tiles, edgeToEdge }, ref) => {
|
10
|
+
const videoTileProps = useVideoTileContext();
|
11
|
+
return (
|
12
|
+
<Box
|
13
|
+
ref={ref}
|
14
|
+
css={{
|
15
|
+
flex: '1 1 0',
|
16
|
+
gap: '$4',
|
17
|
+
display: 'flex',
|
18
|
+
placeContent: 'center',
|
19
|
+
alignItems: 'center',
|
20
|
+
justifyContent: 'center',
|
21
|
+
flexFlow: 'row wrap',
|
22
|
+
minHeight: 0,
|
23
|
+
'@md': { gap: edgeToEdge ? 0 : '$4' },
|
24
|
+
}}
|
25
|
+
>
|
26
|
+
{tiles?.map(tile => {
|
27
|
+
return (
|
28
|
+
<VideoTile
|
29
|
+
key={tile.track?.id || tile.peer?.id}
|
30
|
+
width={tile.width}
|
31
|
+
height={tile.height}
|
32
|
+
peerId={tile.peer?.id}
|
33
|
+
trackId={tile.track?.id}
|
34
|
+
rootCSS={{ padding: 0 }}
|
35
|
+
objectFit="contain"
|
36
|
+
{...videoTileProps}
|
37
|
+
/>
|
38
|
+
);
|
39
|
+
})}
|
40
|
+
</Box>
|
41
|
+
);
|
42
|
+
},
|
43
|
+
);
|