@100mslive/roomkit-react 0.2.3-alpha.3 → 0.2.4-alpha.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{HLSView-IUF7RGVF.js → HLSView-5I6UAYPZ.js} +6 -6
- package/dist/HLSView-5I6UAYPZ.js.map +7 -0
- package/dist/Prebuilt/common/constants.d.ts +1 -0
- package/dist/Prebuilt/components/Connection/TileConnection.d.ts +2 -3
- package/dist/Prebuilt/components/InsetTile.d.ts +3 -1
- package/dist/Prebuilt/components/LayoutModeSelector.d.ts +2 -0
- package/dist/Prebuilt/components/MoreSettings/ChangeNameContent.d.ts +10 -0
- package/dist/Prebuilt/components/MoreSettings/ChangeNameModal.d.ts +5 -0
- package/dist/Prebuilt/components/Polls/CreatePollQuiz/PollsQuizMenu.d.ts +2 -0
- package/dist/Prebuilt/components/Polls/CreateQuestions/SavedQuestion.d.ts +1 -2
- package/dist/Prebuilt/components/Polls/common/StatusIndicator.d.ts +4 -3
- package/dist/Prebuilt/components/Polls/common/constants.d.ts +5 -0
- package/dist/Prebuilt/components/ScreenshareDisplay.d.ts +2 -0
- package/dist/Prebuilt/components/ScreenshareTile.d.ts +7 -0
- package/dist/Prebuilt/components/SecondaryTiles.d.ts +1 -1
- package/dist/Prebuilt/components/Settings/LayoutSettings.d.ts +11 -0
- package/dist/Prebuilt/components/Settings/NotificationSettings.d.ts +2 -0
- package/dist/Prebuilt/components/Settings/SwitchWithLabel.d.ts +10 -0
- package/dist/Prebuilt/components/Settings/common.d.ts +878 -0
- package/dist/Prebuilt/components/TileMenu/TileMenu.d.ts +14 -0
- package/dist/Prebuilt/components/TileMenu/TileMenuContent.d.ts +7 -7
- package/dist/Prebuilt/components/VideoLayouts/ProminenceLayout.d.ts +4 -2
- package/dist/Prebuilt/components/VideoLayouts/interface.d.ts +1 -0
- package/dist/Prebuilt/components/VideoTile.d.ts +19 -0
- package/dist/Prebuilt/components/hooks/useDropdownList.d.ts +4 -0
- package/dist/{chunk-2UXI3OG5.js → chunk-OGCNZHHH.js} +1328 -1097
- package/dist/chunk-OGCNZHHH.js.map +7 -0
- package/dist/index.cjs.js +1826 -1575
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.js +1 -1
- package/dist/meta.cjs.json +458 -293
- package/dist/meta.esbuild.json +470 -305
- package/package.json +6 -6
- package/src/Pagination/StyledPagination.tsx +1 -0
- package/src/Popover/index.tsx +8 -1
- package/src/Prebuilt/common/constants.ts +1 -0
- package/src/Prebuilt/components/AppData/AppData.tsx +2 -0
- package/src/Prebuilt/components/AppData/useUISettings.js +1 -1
- package/src/Prebuilt/components/Connection/TileConnection.tsx +13 -6
- package/src/Prebuilt/components/HlsStatsOverlay.jsx +2 -2
- package/src/Prebuilt/components/InsetTile.tsx +13 -6
- package/src/Prebuilt/components/LayoutModeSelector.tsx +106 -0
- package/src/Prebuilt/components/MoreSettings/{ChangeNameContent.jsx → ChangeNameContent.tsx} +10 -2
- package/src/Prebuilt/components/MoreSettings/{ChangeNameModal.jsx → ChangeNameModal.tsx} +14 -5
- package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.tsx +2 -2
- package/src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.tsx +2 -2
- package/src/Prebuilt/components/Notifications/Notifications.tsx +0 -1
- package/src/Prebuilt/components/Playlist/VideoPlayer.jsx +1 -1
- package/src/Prebuilt/components/Polls/CreatePollQuiz/{PollsQuizMenu.jsx → PollsQuizMenu.tsx} +54 -26
- package/src/Prebuilt/components/Polls/CreateQuestions/CreateQuestions.jsx +21 -31
- package/src/Prebuilt/components/Polls/CreateQuestions/SavedQuestion.tsx +3 -17
- package/src/Prebuilt/components/Polls/Voting/LeaderboardSummary.tsx +1 -1
- package/src/Prebuilt/components/Polls/Voting/QuestionCard.jsx +1 -10
- package/src/Prebuilt/components/Polls/Voting/Voting.tsx +1 -3
- package/src/Prebuilt/components/Polls/common/StatusIndicator.tsx +12 -3
- package/src/Prebuilt/components/Polls/common/constants.ts +5 -0
- package/src/Prebuilt/components/Preview/PreviewForm.tsx +2 -2
- package/src/Prebuilt/components/PreviousRoleInMetadata.tsx +1 -1
- package/src/Prebuilt/components/{ScreenshareTile.jsx → ScreenshareTile.tsx} +39 -6
- package/src/Prebuilt/components/SecondaryTiles.tsx +36 -4
- package/src/Prebuilt/components/Settings/DeviceSettings.jsx +1 -1
- package/src/Prebuilt/components/Settings/{LayoutSettings.jsx → LayoutSettings.tsx} +58 -14
- package/src/Prebuilt/components/Settings/{NotificationSettings.jsx → NotificationSettings.tsx} +14 -3
- package/src/Prebuilt/components/Settings/SettingsModal.jsx +32 -6
- package/src/Prebuilt/components/Settings/{SwitchWithLabel.jsx → SwitchWithLabel.tsx} +15 -1
- package/src/Prebuilt/components/Settings/common.ts +16 -0
- package/src/Prebuilt/components/TileMenu/{TileMenu.jsx → TileMenu.tsx} +12 -4
- package/src/Prebuilt/components/TileMenu/TileMenuContent.tsx +12 -10
- package/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +29 -14
- package/src/Prebuilt/components/VideoLayouts/RoleProminence.tsx +12 -2
- package/src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx +20 -5
- package/src/Prebuilt/components/VideoLayouts/interface.ts +1 -0
- package/src/Prebuilt/components/{VideoTile.jsx → VideoTile.tsx} +57 -44
- package/src/Prebuilt/components/VirtualBackground/VBPicker.tsx +2 -2
- package/src/Prebuilt/components/hooks/{useDropdownList.jsx → useDropdownList.ts} +2 -1
- package/src/Prebuilt/components/pdfAnnotator/shareScreenOptions.jsx +1 -1
- package/src/Prebuilt/layouts/HLSView.jsx +2 -2
- package/src/Prebuilt/layouts/SidePane.tsx +8 -4
- package/src/Prebuilt/layouts/VideoStreamingSection.tsx +1 -1
- package/src/VideoTile/StyledVideoTile.tsx +4 -4
- package/dist/HLSView-IUF7RGVF.js.map +0 -7
- package/dist/chunk-2UXI3OG5.js.map +0 -7
- package/src/Prebuilt/components/Settings/common.js +0 -41
- /package/src/Prebuilt/components/{ScreenshareDisplay.jsx → ScreenshareDisplay.tsx} +0 -0
@@ -1,6 +1,7 @@
|
|
1
1
|
import React, { useState } from 'react';
|
2
2
|
import { useMedia } from 'react-use';
|
3
3
|
import {
|
4
|
+
HMSVideoTrack,
|
4
5
|
selectLocalPeerID,
|
5
6
|
selectPeerByID,
|
6
7
|
selectPermissions,
|
@@ -30,20 +31,27 @@ const TileMenu = ({
|
|
30
31
|
isScreenshare = false,
|
31
32
|
canMinimise,
|
32
33
|
enableSpotlightingPeer = true,
|
34
|
+
}: {
|
35
|
+
audioTrackID: string;
|
36
|
+
videoTrackID: string;
|
37
|
+
peerID: string;
|
38
|
+
isScreenshare?: boolean;
|
39
|
+
canMinimise?: boolean;
|
40
|
+
enableSpotlightingPeer?: boolean;
|
33
41
|
}) => {
|
34
42
|
const [open, setOpen] = useState(false);
|
35
43
|
const { theme } = useTheme();
|
36
44
|
|
37
45
|
const localPeerID = useHMSStore(selectLocalPeerID);
|
38
46
|
const isLocal = localPeerID === peerID;
|
39
|
-
const { removeOthers } = useHMSStore(selectPermissions);
|
47
|
+
const { removeOthers } = useHMSStore(selectPermissions) || {};
|
40
48
|
const { setVolume, toggleAudio, toggleVideo } = useRemoteAVToggle(audioTrackID, videoTrackID);
|
41
49
|
const showSpotlight = enableSpotlightingPeer;
|
42
50
|
|
43
51
|
const isPrimaryVideoTrack = useHMSStore(selectVideoTrackByPeerID(peerID))?.id === videoTrackID;
|
44
|
-
const showPinAction = audioTrackID || (videoTrackID && isPrimaryVideoTrack);
|
52
|
+
const showPinAction = !!(audioTrackID || (videoTrackID && isPrimaryVideoTrack));
|
45
53
|
|
46
|
-
const track = useHMSStore(selectTrackByID(videoTrackID));
|
54
|
+
const track = useHMSStore(selectTrackByID(videoTrackID)) as HMSVideoTrack;
|
47
55
|
const hideSimulcastLayers = !track?.layerDefinitions?.length || track.degraded || !track.enabled;
|
48
56
|
const isMobile = useMedia(cssConfig.media.md);
|
49
57
|
const peer = useHMSStore(selectPeerByID(peerID));
|
@@ -99,7 +107,7 @@ const TileMenu = ({
|
|
99
107
|
>
|
100
108
|
<Box>
|
101
109
|
<Text css={{ color: '$on_surface_high', fontWeight: '$semiBold' }}>
|
102
|
-
{peer
|
110
|
+
{peer?.name}
|
103
111
|
{isLocal ? ` (You)` : null}
|
104
112
|
</Text>
|
105
113
|
{peer?.roleName ? (
|
@@ -47,9 +47,9 @@ export const isSameTile = ({
|
|
47
47
|
audioTrackID,
|
48
48
|
}: {
|
49
49
|
trackId: HMSTrackID;
|
50
|
-
videoTrackID
|
51
|
-
audioTrackID
|
52
|
-
}) => trackId && ((videoTrackID && videoTrackID === trackId) || (audioTrackID && audioTrackID === trackId));
|
50
|
+
videoTrackID?: string;
|
51
|
+
audioTrackID?: string;
|
52
|
+
}) => !!trackId && ((!!videoTrackID && videoTrackID === trackId) || (!!audioTrackID && audioTrackID === trackId));
|
53
53
|
|
54
54
|
const spacingCSS = { '@md': { my: '$8', fontWeight: '$semiBold', fontSize: 'sm' } };
|
55
55
|
|
@@ -232,9 +232,9 @@ export const TileMenuContent = ({
|
|
232
232
|
showSpotlight: boolean;
|
233
233
|
showPinAction: boolean;
|
234
234
|
peerID: string;
|
235
|
-
canMinimise
|
236
|
-
closeSheetOnClick
|
237
|
-
openNameChangeModal
|
235
|
+
canMinimise?: boolean;
|
236
|
+
closeSheetOnClick?: () => void;
|
237
|
+
openNameChangeModal?: () => void;
|
238
238
|
}) => {
|
239
239
|
const actions = useHMSActions();
|
240
240
|
const dragClassName = getDragClassName();
|
@@ -252,8 +252,8 @@ export const TileMenuContent = ({
|
|
252
252
|
|
253
253
|
const isMobile = useMedia(cssConfig.media.md);
|
254
254
|
|
255
|
-
|
256
|
-
|
255
|
+
if (isLocal) {
|
256
|
+
return showPinAction || canMinimise || !userName || showSpotlight ? (
|
257
257
|
<>
|
258
258
|
{showPinAction && <PinActions audioTrackID={audioTrackID} videoTrackID={videoTrackID} />}
|
259
259
|
{showSpotlight && <SpotlightActions peerId={peerID} onSpotLightClick={() => closeSheetOnClick()} />}
|
@@ -273,8 +273,10 @@ export const TileMenuContent = ({
|
|
273
273
|
</StyledMenuTile.ItemButton>
|
274
274
|
)}
|
275
275
|
</>
|
276
|
-
)
|
277
|
-
|
276
|
+
) : null;
|
277
|
+
}
|
278
|
+
|
279
|
+
return (
|
278
280
|
<>
|
279
281
|
{toggleVideo ? (
|
280
282
|
<StyledMenuTile.ItemButton
|
@@ -6,14 +6,20 @@ import { CSS } from '../../../Theme';
|
|
6
6
|
import VideoTile from '../VideoTile';
|
7
7
|
import { useVideoTileContext } from '../hooks/useVideoTileLayout';
|
8
8
|
|
9
|
-
const Root = ({
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
9
|
+
const Root = ({
|
10
|
+
children,
|
11
|
+
edgeToEdge,
|
12
|
+
hasSidebar,
|
13
|
+
}: React.PropsWithChildren<{ edgeToEdge?: boolean; hasSidebar?: boolean }>) => {
|
14
|
+
return (
|
15
|
+
<Flex
|
16
|
+
direction={hasSidebar ? 'row' : 'column'}
|
17
|
+
css={{ h: '100%', flex: '1 1 0', minWidth: 0, gap: '$6', '@md': { gap: edgeToEdge ? 0 : '$6' } }}
|
18
|
+
>
|
19
|
+
{children}
|
20
|
+
</Flex>
|
21
|
+
);
|
22
|
+
};
|
17
23
|
|
18
24
|
const ProminentSection = ({ children, css = {} }: React.PropsWithChildren<{ css?: CSS }>) => {
|
19
25
|
return (
|
@@ -27,20 +33,29 @@ const SecondarySection = ({
|
|
27
33
|
tiles,
|
28
34
|
children,
|
29
35
|
edgeToEdge,
|
30
|
-
|
36
|
+
hasSidebar,
|
37
|
+
}: React.PropsWithChildren<{ tiles: TrackWithPeerAndDimensions[]; edgeToEdge?: boolean; hasSidebar?: boolean }>) => {
|
31
38
|
const tileLayoutProps = useVideoTileContext();
|
32
39
|
if (!tiles?.length) {
|
33
40
|
return null;
|
34
41
|
}
|
42
|
+
const gridStyles = hasSidebar
|
43
|
+
? {
|
44
|
+
gridTemplateColumns: '1fr',
|
45
|
+
gridTemplateRows: `repeat(${tiles.length}, minmax(0, 135px))`,
|
46
|
+
}
|
47
|
+
: {
|
48
|
+
gridTemplateRows: React.Children.count(children) > 0 ? '136px auto' : '154px',
|
49
|
+
gridTemplateColumns: `repeat(${tiles.length}, minmax(0, 1fr))`,
|
50
|
+
};
|
35
51
|
return (
|
36
52
|
<Box
|
37
53
|
css={{
|
38
54
|
display: 'grid',
|
39
|
-
|
40
|
-
|
41
|
-
margin: '0 auto',
|
42
|
-
gap: '$2 $4',
|
55
|
+
margin: 'auto',
|
56
|
+
gap: hasSidebar ? '$8' : '$2 $4',
|
43
57
|
placeItems: 'center',
|
58
|
+
...gridStyles,
|
44
59
|
'@md': { gap: edgeToEdge ? 0 : '$4' },
|
45
60
|
}}
|
46
61
|
>
|
@@ -62,7 +77,7 @@ const SecondarySection = ({
|
|
62
77
|
/>
|
63
78
|
);
|
64
79
|
})}
|
65
|
-
<Box css={{ gridColumn: `1/span ${tiles.length}` }}>{children}</Box>
|
80
|
+
{children && <Box css={{ gridColumn: hasSidebar ? 1 : `1/span ${tiles.length}` }}>{children}</Box>}
|
66
81
|
</Box>
|
67
82
|
);
|
68
83
|
};
|
@@ -3,11 +3,15 @@ import { selectLocalPeer, useHMSStore } from '@100mslive/react-sdk';
|
|
3
3
|
import { InsetTile } from '../InsetTile';
|
4
4
|
import { Pagination } from '../Pagination';
|
5
5
|
import { SecondaryTiles } from '../SecondaryTiles';
|
6
|
+
import { LayoutMode } from '../Settings/LayoutSettings';
|
6
7
|
import { Grid } from './Grid';
|
7
8
|
import { LayoutProps } from './interface';
|
8
9
|
import { ProminenceLayout } from './ProminenceLayout';
|
10
|
+
// @ts-ignore: No implicit Any
|
11
|
+
import { useUISettings } from '../AppData/useUISettings';
|
9
12
|
import { useRoleProminencePeers } from '../hooks/useRoleProminencePeers';
|
10
13
|
import { usePagesWithTiles, useTileLayout } from '../hooks/useTileLayout';
|
14
|
+
import { UI_SETTINGS } from '../../common/constants';
|
11
15
|
|
12
16
|
export function RoleProminence({
|
13
17
|
isInsetEnabled = false,
|
@@ -19,6 +23,7 @@ export function RoleProminence({
|
|
19
23
|
}: LayoutProps) {
|
20
24
|
const { prominentPeers, secondaryPeers } = useRoleProminencePeers(prominentRoles, peers, isInsetEnabled);
|
21
25
|
const localPeer = useHMSStore(selectLocalPeer);
|
26
|
+
const layoutMode = useUISettings(UI_SETTINGS.layoutMode);
|
22
27
|
const maxTileCount = 4;
|
23
28
|
const pageList = usePagesWithTiles({
|
24
29
|
peers: prominentPeers,
|
@@ -38,7 +43,7 @@ export function RoleProminence({
|
|
38
43
|
}, [pageSize, onPageSize]);
|
39
44
|
|
40
45
|
return (
|
41
|
-
<ProminenceLayout.Root>
|
46
|
+
<ProminenceLayout.Root hasSidebar={layoutMode === LayoutMode.SIDEBAR}>
|
42
47
|
<ProminenceLayout.ProminentSection>
|
43
48
|
<Grid ref={ref} tiles={pagesWithTiles[page]} />
|
44
49
|
</ProminenceLayout.ProminentSection>
|
@@ -52,7 +57,12 @@ export function RoleProminence({
|
|
52
57
|
numPages={pagesWithTiles.length}
|
53
58
|
/>
|
54
59
|
)}
|
55
|
-
<SecondaryTiles
|
60
|
+
<SecondaryTiles
|
61
|
+
peers={layoutMode === LayoutMode.SPOTLIGHT ? [] : secondaryPeers}
|
62
|
+
isInsetEnabled={isInsetEnabled}
|
63
|
+
edgeToEdge={edgeToEdge}
|
64
|
+
hasSidebar={layoutMode === LayoutMode.SIDEBAR}
|
65
|
+
/>
|
56
66
|
{isInsetEnabled && localPeer && !prominentPeers.includes(localPeer) && <InsetTile />}
|
57
67
|
</ProminenceLayout.Root>
|
58
68
|
);
|
@@ -2,30 +2,43 @@ import React, { useEffect, useMemo, useState } from 'react';
|
|
2
2
|
import { useMedia } from 'react-use';
|
3
3
|
import { selectPeersScreenSharing, useHMSStore } from '@100mslive/react-sdk';
|
4
4
|
import { config as cssConfig } from '../../../Theme';
|
5
|
+
import { InsetTile } from '../InsetTile';
|
5
6
|
import { Pagination } from '../Pagination';
|
6
7
|
// @ts-ignore: No implicit Any
|
7
8
|
import ScreenshareTile from '../ScreenshareTile';
|
8
9
|
import { SecondaryTiles } from '../SecondaryTiles';
|
10
|
+
import { LayoutMode } from '../Settings/LayoutSettings';
|
9
11
|
import { LayoutProps } from './interface';
|
10
12
|
import { ProminenceLayout } from './ProminenceLayout';
|
11
13
|
// @ts-ignore: No implicit Any
|
12
|
-
import { useSetAppDataByKey } from '../AppData/useUISettings';
|
13
|
-
import { APP_DATA } from '../../common/constants';
|
14
|
+
import { useSetAppDataByKey, useSetUiSettings } from '../AppData/useUISettings';
|
15
|
+
import { APP_DATA, UI_SETTINGS } from '../../common/constants';
|
14
16
|
|
15
17
|
export const ScreenshareLayout = ({ peers, onPageChange, onPageSize, edgeToEdge }: LayoutProps) => {
|
16
18
|
const peersSharing = useHMSStore(selectPeersScreenSharing);
|
17
19
|
const [, setActiveScreenSharePeer] = useSetAppDataByKey(APP_DATA.activeScreensharePeerId);
|
18
20
|
const [page, setPage] = useState(0);
|
21
|
+
const [layoutMode, setLayoutMode] = useSetUiSettings(UI_SETTINGS.layoutMode);
|
19
22
|
const activeSharePeer = peersSharing[page];
|
20
23
|
const isMobile = useMedia(cssConfig.media.md);
|
24
|
+
const hasSidebar = !isMobile && layoutMode === LayoutMode.SIDEBAR;
|
21
25
|
const secondaryPeers = useMemo(() => {
|
22
|
-
if (
|
26
|
+
if (layoutMode === LayoutMode.SPOTLIGHT) {
|
27
|
+
return [];
|
28
|
+
}
|
29
|
+
if (isMobile || layoutMode === LayoutMode.SIDEBAR) {
|
23
30
|
return activeSharePeer
|
24
31
|
? [activeSharePeer, ...peers.filter(p => p.id !== activeSharePeer?.id)] //keep active sharing peer as first tile
|
25
32
|
: peers;
|
26
33
|
}
|
27
34
|
return peers.filter(p => p.id !== activeSharePeer?.id);
|
28
|
-
}, [activeSharePeer, peers, isMobile]);
|
35
|
+
}, [activeSharePeer, peers, isMobile, layoutMode]);
|
36
|
+
|
37
|
+
useEffect(() => {
|
38
|
+
if (layoutMode !== LayoutMode.SIDEBAR) {
|
39
|
+
setLayoutMode(LayoutMode.SIDEBAR);
|
40
|
+
}
|
41
|
+
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
29
42
|
useEffect(() => {
|
30
43
|
setActiveScreenSharePeer(isMobile ? '' : activeSharePeer?.id);
|
31
44
|
return () => {
|
@@ -34,7 +47,7 @@ export const ScreenshareLayout = ({ peers, onPageChange, onPageSize, edgeToEdge
|
|
34
47
|
}, [activeSharePeer?.id, isMobile, setActiveScreenSharePeer]);
|
35
48
|
|
36
49
|
return (
|
37
|
-
<ProminenceLayout.Root edgeToEdge={edgeToEdge}>
|
50
|
+
<ProminenceLayout.Root edgeToEdge={edgeToEdge} hasSidebar={hasSidebar}>
|
38
51
|
<ProminenceLayout.ProminentSection>
|
39
52
|
<ScreenshareTile peerId={peersSharing[page]?.id} />
|
40
53
|
{!edgeToEdge && <Pagination page={page} onPageChange={setPage} numPages={peersSharing.length} />}
|
@@ -44,7 +57,9 @@ export const ScreenshareLayout = ({ peers, onPageChange, onPageSize, edgeToEdge
|
|
44
57
|
onPageChange={onPageChange}
|
45
58
|
onPageSize={onPageSize}
|
46
59
|
edgeToEdge={edgeToEdge}
|
60
|
+
hasSidebar={hasSidebar}
|
47
61
|
/>
|
62
|
+
{layoutMode === LayoutMode.SPOTLIGHT && activeSharePeer && <InsetTile peerId={activeSharePeer?.id} />}
|
48
63
|
</ProminenceLayout.Root>
|
49
64
|
);
|
50
65
|
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, {
|
1
|
+
import React, { useCallback, useMemo, useState } from 'react';
|
2
2
|
import { useMeasure } from 'react-use';
|
3
3
|
import {
|
4
4
|
selectAudioTrackByPeerID,
|
@@ -7,7 +7,6 @@ import {
|
|
7
7
|
selectLocalPeerID,
|
8
8
|
selectPeerMetadata,
|
9
9
|
selectPeerNameByID,
|
10
|
-
selectSessionStore,
|
11
10
|
selectVideoTrackByID,
|
12
11
|
selectVideoTrackByPeerID,
|
13
12
|
useHMSStore,
|
@@ -18,16 +17,41 @@ import TileMenu, { isSameTile } from './TileMenu/TileMenu';
|
|
18
17
|
import { AudioLevel } from '../../AudioLevel';
|
19
18
|
import { Avatar } from '../../Avatar';
|
20
19
|
import { VideoTileStats } from '../../Stats';
|
20
|
+
import { CSS } from '../../Theme';
|
21
21
|
import { Video } from '../../Video';
|
22
22
|
import { StyledVideoTile } from '../../VideoTile';
|
23
|
+
// @ts-ignore: No implicit Any
|
23
24
|
import { getVideoTileLabel } from './peerTileUtils';
|
25
|
+
// @ts-ignore: No implicit Any
|
24
26
|
import { useSetAppDataByKey, useUISettings } from './AppData/useUISettings';
|
27
|
+
// @ts-ignore: No implicit Any
|
25
28
|
import { calculateAvatarAndAttribBoxSize } from '../common/utils';
|
26
|
-
import { APP_DATA,
|
29
|
+
import { APP_DATA, UI_SETTINGS } from '../common/constants';
|
30
|
+
|
31
|
+
const PeerMetadata = ({ peerId, size }: { peerId: string; size?: 'medium' | 'small' }) => {
|
32
|
+
const metaData = useHMSStore(selectPeerMetadata(peerId));
|
33
|
+
const isBRB = metaData?.isBRBOn || false;
|
34
|
+
const isHandRaised = useHMSStore(selectHasPeerHandRaised(peerId));
|
35
|
+
|
36
|
+
return (
|
37
|
+
<>
|
38
|
+
{isHandRaised ? (
|
39
|
+
<StyledVideoTile.AttributeBox size={size} data-testid="raiseHand_icon_onTile">
|
40
|
+
<HandIcon width={24} height={24} />
|
41
|
+
</StyledVideoTile.AttributeBox>
|
42
|
+
) : null}
|
43
|
+
{isBRB ? (
|
44
|
+
<StyledVideoTile.AttributeBox size={size} data-testid="brb_icon_onTile">
|
45
|
+
<BrbTileIcon width={22} height={22} />
|
46
|
+
</StyledVideoTile.AttributeBox>
|
47
|
+
) : null}
|
48
|
+
</>
|
49
|
+
);
|
50
|
+
};
|
27
51
|
|
28
52
|
const Tile = ({
|
29
|
-
peerId,
|
30
|
-
trackId,
|
53
|
+
peerId = '',
|
54
|
+
trackId = '',
|
31
55
|
width,
|
32
56
|
height,
|
33
57
|
objectFit = 'cover',
|
@@ -40,6 +64,21 @@ const Tile = ({
|
|
40
64
|
roundedVideoTile = true,
|
41
65
|
hideAudioMuteOnTile = false,
|
42
66
|
hideMetadataOnTile = false,
|
67
|
+
}: {
|
68
|
+
peerId?: string;
|
69
|
+
trackId?: string;
|
70
|
+
width?: string | number;
|
71
|
+
height?: string | number;
|
72
|
+
objectFit?: string;
|
73
|
+
canMinimise?: boolean;
|
74
|
+
isDragabble?: boolean;
|
75
|
+
rootCSS?: CSS;
|
76
|
+
containerCSS?: CSS;
|
77
|
+
enableSpotlightingPeer?: boolean;
|
78
|
+
hideParticipantNameOnTile?: boolean;
|
79
|
+
roundedVideoTile?: boolean;
|
80
|
+
hideAudioMuteOnTile?: boolean;
|
81
|
+
hideMetadataOnTile?: boolean;
|
43
82
|
}) => {
|
44
83
|
const trackSelector = trackId ? selectVideoTrackByID(trackId) : selectVideoTrackByPeerID(peerId);
|
45
84
|
const track = useHMSStore(trackSelector);
|
@@ -60,17 +99,16 @@ const Tile = ({
|
|
60
99
|
videoTrackID: track?.id,
|
61
100
|
audioTrackID: audioTrack?.id,
|
62
101
|
});
|
63
|
-
const spotlighted = useHMSStore(selectSessionStore(SESSION_STORE_KEY.SPOTLIGHT)) === peerId;
|
64
102
|
const label = getVideoTileLabel({
|
65
103
|
peerName,
|
66
104
|
track,
|
67
105
|
isLocal,
|
68
106
|
});
|
69
|
-
const onHoverHandler = useCallback(event => {
|
107
|
+
const onHoverHandler = useCallback((event: React.MouseEvent) => {
|
70
108
|
setIsMouseHovered(event.type === 'mouseenter');
|
71
109
|
}, []);
|
72
110
|
|
73
|
-
const [ref, { width: calculatedWidth, height: calculatedHeight }] = useMeasure();
|
111
|
+
const [ref, { width: calculatedWidth, height: calculatedHeight }] = useMeasure<HTMLDivElement>();
|
74
112
|
|
75
113
|
const isTileBigEnoughToShowStats = calculatedHeight >= 180 && calculatedWidth >= 180;
|
76
114
|
|
@@ -124,17 +162,15 @@ const Tile = ({
|
|
124
162
|
<Avatar name={peerName || ''} data-testid="participant_avatar_icon" size={avatarSize} />
|
125
163
|
</StyledVideoTile.AvatarContainer>
|
126
164
|
) : null}
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
<
|
135
|
-
|
136
|
-
</StyledVideoTile.AudioIndicator>
|
137
|
-
)
|
165
|
+
{!hideAudioMuteOnTile && isAudioMuted ? (
|
166
|
+
<StyledVideoTile.AudioIndicator data-testid="participant_audio_mute_icon" size={attribBoxSize}>
|
167
|
+
<MicOffIcon />
|
168
|
+
</StyledVideoTile.AudioIndicator>
|
169
|
+
) : null}
|
170
|
+
{!hideAudioMuteOnTile && !isAudioMuted ? (
|
171
|
+
<StyledVideoTile.AudioIndicator size={attribBoxSize}>
|
172
|
+
<AudioLevel trackId={audioTrack?.id} size={attribBoxSize} />
|
173
|
+
</StyledVideoTile.AudioIndicator>
|
138
174
|
) : null}
|
139
175
|
{!hideMetadataOnTile && <PeerMetadata peerId={peerId} size={attribBoxSize} />}
|
140
176
|
</>
|
@@ -142,8 +178,8 @@ const Tile = ({
|
|
142
178
|
{isMouseHovered || (isDragabble && navigator.maxTouchPoints > 0) ? (
|
143
179
|
<TileMenu
|
144
180
|
peerID={peerId}
|
145
|
-
audioTrackID={audioTrack?.id}
|
146
|
-
videoTrackID={track?.id}
|
181
|
+
audioTrackID={audioTrack?.id || ''}
|
182
|
+
videoTrackID={track?.id || ''}
|
147
183
|
canMinimise={canMinimise}
|
148
184
|
enableSpotlightingPeer={enableSpotlightingPeer}
|
149
185
|
/>
|
@@ -152,11 +188,9 @@ const Tile = ({
|
|
152
188
|
<TileConnection
|
153
189
|
hideLabel={hideParticipantNameOnTile}
|
154
190
|
name={label}
|
155
|
-
isTile
|
156
191
|
peerId={peerId}
|
157
192
|
width={width}
|
158
193
|
pinned={pinned}
|
159
|
-
spotlighted={spotlighted}
|
160
194
|
/>
|
161
195
|
</StyledVideoTile.Container>
|
162
196
|
) : null}
|
@@ -164,27 +198,6 @@ const Tile = ({
|
|
164
198
|
);
|
165
199
|
};
|
166
200
|
|
167
|
-
const PeerMetadata = ({ peerId, size }) => {
|
168
|
-
const metaData = useHMSStore(selectPeerMetadata(peerId));
|
169
|
-
const isBRB = metaData?.isBRBOn || false;
|
170
|
-
const isHandRaised = useHMSStore(selectHasPeerHandRaised(peerId));
|
171
|
-
|
172
|
-
return (
|
173
|
-
<Fragment>
|
174
|
-
{isHandRaised ? (
|
175
|
-
<StyledVideoTile.AttributeBox size={size} data-testid="raiseHand_icon_onTile">
|
176
|
-
<HandIcon width={24} height={24} />
|
177
|
-
</StyledVideoTile.AttributeBox>
|
178
|
-
) : null}
|
179
|
-
{isBRB ? (
|
180
|
-
<StyledVideoTile.AttributeBox size={size} data-testid="brb_icon_onTile">
|
181
|
-
<BrbTileIcon width={22} height={22} />
|
182
|
-
</StyledVideoTile.AttributeBox>
|
183
|
-
) : null}
|
184
|
-
</Fragment>
|
185
|
-
);
|
186
|
-
};
|
187
|
-
|
188
201
|
const VideoTile = React.memo(Tile);
|
189
202
|
|
190
203
|
export default VideoTile;
|
@@ -13,7 +13,7 @@ import {
|
|
13
13
|
useHMSActions,
|
14
14
|
useHMSStore,
|
15
15
|
} from '@100mslive/react-sdk';
|
16
|
-
import { BlurPersonHighIcon,
|
16
|
+
import { BlurPersonHighIcon, CrossCircleIcon, CrossIcon } from '@100mslive/react-icons';
|
17
17
|
import { Box, Flex, Slider, Video } from '../../../index';
|
18
18
|
import { Text } from '../../../Text';
|
19
19
|
import { VBCollection } from './VBCollection';
|
@@ -90,7 +90,7 @@ export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBac
|
|
90
90
|
css={{ color: '$on_surface_high', '&:hover': { color: '$on_surface_medium' }, cursor: 'pointer' }}
|
91
91
|
onClick={toggleVB}
|
92
92
|
>
|
93
|
-
<
|
93
|
+
<CrossIcon />
|
94
94
|
</Box>
|
95
95
|
</Flex>
|
96
96
|
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import { useEffect } from 'react';
|
2
|
+
// @ts-ignore: No implicit Any
|
2
3
|
import { useSetAppDataByKey } from '../AppData/useUISettings';
|
3
4
|
import { APP_DATA } from '../../common/constants';
|
4
5
|
|
5
|
-
export const useDropdownList = ({ name, open }) => {
|
6
|
+
export const useDropdownList = ({ name, open }: { name: string; open: boolean }) => {
|
6
7
|
const [dropdownList = [], setDropdownList] = useSetAppDataByKey(APP_DATA.dropdownList);
|
7
8
|
|
8
9
|
useEffect(() => {
|
@@ -13,7 +13,7 @@ import {
|
|
13
13
|
useHMSStore,
|
14
14
|
useHMSVanillaStore,
|
15
15
|
} from '@100mslive/react-sdk';
|
16
|
-
import { ColoredHandIcon, ExpandIcon,
|
16
|
+
import { ColoredHandIcon, ExpandIcon, GoLiveIcon, PlayIcon, ShrinkIcon } from '@100mslive/react-icons';
|
17
17
|
import { HlsStatsOverlay } from '../components/HlsStatsOverlay';
|
18
18
|
import { HMSVideoPlayer } from '../components/HMSVideo';
|
19
19
|
import { FullScreenButton } from '../components/HMSVideo/FullscreenButton';
|
@@ -449,7 +449,7 @@ const HLSView = () => {
|
|
449
449
|
) : (
|
450
450
|
<Flex align="center" justify="center" direction="column" css={{ size: '100%', px: '$10' }}>
|
451
451
|
<Flex css={{ c: '$on_surface_high', r: '$round', bg: '$surface_default', p: '$2' }}>
|
452
|
-
{streamEnded ? <ColoredHandIcon height={56} width={56} /> : <
|
452
|
+
{streamEnded ? <ColoredHandIcon height={56} width={56} /> : <GoLiveIcon height={56} width={56} />}
|
453
453
|
</Flex>
|
454
454
|
<Text variant="h5" css={{ c: '$on_surface_high', mt: '$10', mb: 0, textAlign: 'center' }}>
|
455
455
|
{streamEnded ? 'Stream has ended' : 'Stream yet to start'}
|
@@ -2,6 +2,7 @@ import React, { useEffect } from 'react';
|
|
2
2
|
import { useMedia } from 'react-use';
|
3
3
|
import { selectAppData, selectVideoTrackByPeerID, useHMSStore } from '@100mslive/react-sdk';
|
4
4
|
import { Polls } from '../components/Polls/Polls';
|
5
|
+
import { LayoutMode } from '../components/Settings/LayoutSettings';
|
5
6
|
import { SidePaneTabs } from '../components/SidePaneTabs';
|
6
7
|
import { TileCustomisationProps } from '../components/VideoLayouts/GridLayout';
|
7
8
|
// @ts-ignore: No implicit Any
|
@@ -12,12 +13,14 @@ import { Box, Flex } from '../../Layout';
|
|
12
13
|
import { config as cssConfig } from '../../Theme';
|
13
14
|
// @ts-ignore: No implicit Any
|
14
15
|
import { useSidepaneReset } from '../components/AppData/useSidepane';
|
16
|
+
// @ts-ignore: No implicit Any
|
17
|
+
import { useUISettings } from '../components/AppData/useUISettings';
|
15
18
|
import {
|
16
19
|
useRoomLayoutConferencingScreen,
|
17
20
|
useRoomLayoutPreviewScreen,
|
18
21
|
} from '../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
|
19
22
|
import { translateAcross } from '../../utils';
|
20
|
-
import { APP_DATA, SIDE_PANE_OPTIONS } from '../common/constants';
|
23
|
+
import { APP_DATA, SIDE_PANE_OPTIONS, UI_SETTINGS } from '../common/constants';
|
21
24
|
|
22
25
|
const SidePane = ({
|
23
26
|
tileProps,
|
@@ -32,6 +35,7 @@ const SidePane = ({
|
|
32
35
|
const trackId = useHMSStore(selectVideoTrackByPeerID(activeScreensharePeerId))?.id;
|
33
36
|
const { elements } = useRoomLayoutConferencingScreen();
|
34
37
|
const { elements: preview_elements } = useRoomLayoutPreviewScreen();
|
38
|
+
const layoutMode = useUISettings(UI_SETTINGS.layoutMode);
|
35
39
|
|
36
40
|
const backgroundMedia = preview_elements?.virtual_background?.background_media?.length
|
37
41
|
? preview_elements?.virtual_background?.background_media
|
@@ -55,10 +59,9 @@ const SidePane = ({
|
|
55
59
|
};
|
56
60
|
}, [resetSidePane]);
|
57
61
|
|
58
|
-
if (!ViewComponent && !trackId) {
|
62
|
+
if (!ViewComponent && (!trackId || layoutMode !== LayoutMode.GALLERY)) {
|
59
63
|
return null;
|
60
64
|
}
|
61
|
-
|
62
65
|
const tileLayout = {
|
63
66
|
hideParticipantNameOnTile: tileProps?.hide_participant_name_on_tile,
|
64
67
|
roundedVideoTile: tileProps?.rounded_video_tile,
|
@@ -82,7 +85,7 @@ const SidePane = ({
|
|
82
85
|
'@md': { position: mwebStreamingChat ? 'absolute' : '', zIndex: 12 },
|
83
86
|
}}
|
84
87
|
>
|
85
|
-
{trackId && (
|
88
|
+
{trackId && layoutMode === LayoutMode.GALLERY && (
|
86
89
|
<VideoTile
|
87
90
|
peerId={activeScreensharePeerId}
|
88
91
|
trackId={trackId}
|
@@ -118,6 +121,7 @@ const SidePane = ({
|
|
118
121
|
},
|
119
122
|
'@md': {
|
120
123
|
p: '$6 $8',
|
124
|
+
h: 'auto',
|
121
125
|
pb: mwebStreamingChat ? '$20' : '$12',
|
122
126
|
borderTopLeftRadius: sidepane === SIDE_PANE_OPTIONS.POLLS ? '$2' : '0',
|
123
127
|
borderTopRightRadius: sidepane === SIDE_PANE_OPTIONS.POLLS ? '$2' : '0',
|
@@ -106,7 +106,7 @@ export const VideoStreamingSection = ({
|
|
106
106
|
}}
|
107
107
|
>
|
108
108
|
{ViewComponent}
|
109
|
-
<Box css={{ height: '100%', maxHeight: '100%', overflowY: 'clip' }}>
|
109
|
+
<Box css={{ height: '100%', maxHeight: '100%', overflowY: 'clip', '&:empty': { display: 'none' } }}>
|
110
110
|
<SidePane
|
111
111
|
screenType={screenType}
|
112
112
|
// @ts-ignore
|
@@ -94,11 +94,11 @@ const AttributeBox = styled('div', {
|
|
94
94
|
const AudioIndicator = styled(AttributeBox, { defaultVariants: { position: 'right' } });
|
95
95
|
|
96
96
|
const FullScreenButton = styled('button', {
|
97
|
-
|
98
|
-
|
97
|
+
height: '$14',
|
98
|
+
p: '$2 $4',
|
99
99
|
color: '$on_surface_high',
|
100
|
-
borderRadius: '$
|
101
|
-
|
100
|
+
borderRadius: '$1',
|
101
|
+
border: 'none',
|
102
102
|
display: 'flex',
|
103
103
|
justifyContent: 'center',
|
104
104
|
alignItems: 'center',
|