@100mslive/roomkit-react 0.1.4-alpha.1 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{HLSView-F2K5VSTS.js → HLSView-P57IRMAR.js} +7 -11
- package/dist/{HLSView-F2K5VSTS.js.map → HLSView-P57IRMAR.js.map} +1 -1
- package/dist/PinnedTrackView-4FYJEBTB.js +102 -0
- package/dist/PinnedTrackView-4FYJEBTB.js.map +7 -0
- package/dist/Popover/index.d.ts +1 -0
- package/dist/Prebuilt/App.d.ts +25 -0
- package/dist/Prebuilt/index.d.ts +1 -0
- package/dist/Prebuilt/provider/roomLayoutProvider/index.d.ts +1 -1
- package/dist/Sheet/Sheet.d.ts +3093 -0
- package/dist/Sheet/index.d.ts +1 -0
- package/dist/Theme/ThemeProvider.d.ts +4 -286
- package/dist/Theme/stitches.config.d.ts +1 -1
- package/dist/{VirtualBackground-S3XEPZ2T.js → VirtualBackground-GGCQJ5JM.js} +31 -7
- package/dist/VirtualBackground-GGCQJ5JM.js.map +7 -0
- package/dist/chunk-IVTWKQI3.js +827 -0
- package/dist/chunk-IVTWKQI3.js.map +7 -0
- package/dist/{chunk-42SWPN2C.js → chunk-OSM4QEQG.js} +3020 -2189
- package/dist/chunk-OSM4QEQG.js.map +7 -0
- package/dist/chunk-P5X32KOD.js +67 -0
- package/dist/chunk-P5X32KOD.js.map +7 -0
- package/dist/chunk-RVCZPPTL.js +1100 -0
- package/dist/chunk-RVCZPPTL.js.map +7 -0
- package/dist/{chunk-ESUJK7AT.js → conference-P6I6ESVF.js} +3136 -653
- package/dist/conference-P6I6ESVF.js.map +7 -0
- package/dist/index.cjs.js +15733 -15498
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.js +4 -8
- package/dist/meta.cjs.json +3355 -3017
- package/dist/meta.esbuild.json +3534 -3329
- package/dist/utils/animations.d.ts +16 -0
- package/package.json +8 -10
- package/src/Button/Button.tsx +4 -4
- package/src/Dropdown/Dropdown.tsx +2 -2
- package/src/IconButton/IconButton.tsx +4 -2
- package/src/Pagination/StyledPagination.tsx +1 -0
- package/src/Popover/index.tsx +2 -1
- package/src/Prebuilt/{App.jsx → App.tsx} +95 -48
- package/src/Prebuilt/Prebuilt.stories.tsx +22 -8
- package/src/Prebuilt/common/constants.js +1 -2
- package/src/Prebuilt/common/hooks.js +8 -0
- package/src/Prebuilt/common/utils.js +15 -0
- package/src/Prebuilt/components/AppData/AppData.jsx +1 -2
- package/src/Prebuilt/components/AppData/useUISettings.js +0 -5
- package/src/Prebuilt/components/AudioVideoToggle.jsx +69 -26
- package/src/Prebuilt/components/AuthToken.jsx +3 -2
- package/src/Prebuilt/components/Chat/ChatSelector.jsx +1 -1
- package/src/Prebuilt/components/Connection/TileConnection.jsx +0 -1
- package/src/Prebuilt/components/EmojiReaction.jsx +23 -73
- package/src/Prebuilt/components/EndSessionContent.jsx +57 -0
- package/src/Prebuilt/components/EqualProminence.jsx +180 -0
- package/src/Prebuilt/components/ErrorBoundary.jsx +4 -10
- package/src/Prebuilt/components/Footer/EmojiCard.jsx +34 -0
- package/src/Prebuilt/components/Footer/Footer.jsx +73 -0
- package/src/Prebuilt/components/{Header → Footer}/ParticipantList.jsx +5 -5
- package/src/Prebuilt/components/Header/ConferencingHeader.jsx +27 -7
- package/src/Prebuilt/components/Header/HeaderComponents.jsx +16 -14
- package/src/Prebuilt/components/Header/StreamActions.jsx +101 -36
- package/src/Prebuilt/components/Header/StreamingHeader.jsx +1 -1
- package/src/Prebuilt/components/Header/common.jsx +164 -0
- package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.jsx +1 -2
- package/src/Prebuilt/components/LeaveCard.jsx +19 -0
- package/src/Prebuilt/components/LeaveRoom.jsx +35 -143
- package/src/Prebuilt/components/LeaveSessionContent.jsx +45 -0
- package/src/Prebuilt/components/MoreSettings/ActionTile.jsx +55 -0
- package/src/Prebuilt/components/MoreSettings/ChangeNameContent.jsx +96 -0
- package/src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx +31 -54
- package/src/Prebuilt/components/MoreSettings/EmbedUrl.jsx +48 -73
- package/src/Prebuilt/components/MoreSettings/MoreSettings.jsx +5 -221
- package/src/Prebuilt/components/MoreSettings/MuteAllContent.jsx +61 -0
- package/src/Prebuilt/components/MoreSettings/MuteAllModal.jsx +32 -49
- package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopLeaveRoom.jsx +129 -0
- package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.jsx +219 -0
- package/src/Prebuilt/components/MoreSettings/SplitComponents/MwebLeaveRoom.jsx +100 -0
- package/src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.jsx +259 -0
- package/src/Prebuilt/components/Notifications/Notifications.jsx +0 -2
- package/src/Prebuilt/components/Notifications/ReconnectNotifications.jsx +0 -4
- package/src/Prebuilt/components/PIP/PIPComponent.jsx +30 -26
- package/src/Prebuilt/components/PIP/PIPManager.js +13 -0
- package/src/Prebuilt/components/PIP/index.jsx +2 -7
- package/src/Prebuilt/components/Pagination.jsx +4 -4
- package/src/Prebuilt/components/Preview/PreviewContainer.jsx +5 -13
- package/src/Prebuilt/components/Preview/PreviewForm.jsx +9 -5
- package/src/Prebuilt/components/Preview/PreviewJoin.jsx +20 -27
- package/src/Prebuilt/components/RaiseHand.jsx +27 -0
- package/src/Prebuilt/components/ScreenShare.jsx +1 -1
- package/src/Prebuilt/components/ScreenshareDisplay.jsx +2 -2
- package/src/Prebuilt/components/ScreenshareTile.jsx +2 -2
- package/src/Prebuilt/components/Settings/DeviceSettings.jsx +2 -1
- package/src/Prebuilt/components/Settings/LayoutSettings.jsx +1 -24
- package/src/Prebuilt/components/Settings/SettingsModal.jsx +152 -17
- package/src/Prebuilt/components/ShareMenuIcon.jsx +1 -0
- package/src/Prebuilt/components/TileMenu/TileMenu.jsx +133 -0
- package/src/Prebuilt/components/TileMenu/TileMenuContent.jsx +313 -0
- package/src/Prebuilt/components/VideoList.jsx +5 -33
- package/src/Prebuilt/components/VideoTile.jsx +30 -8
- package/src/Prebuilt/components/conference.jsx +14 -1
- package/src/Prebuilt/components/init/Init.jsx +0 -27
- package/src/Prebuilt/components/init/initUtils.js +0 -23
- package/src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx +2 -1
- package/src/Prebuilt/components/pdfAnnotator/pdfInfo.jsx +1 -1
- package/src/Prebuilt/components/pdfAnnotator/shareScreenOptions.jsx +19 -8
- package/src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx +1 -0
- package/src/Prebuilt/images/pdf-share.png +0 -0
- package/src/Prebuilt/images/screen-share.png +0 -0
- package/src/Prebuilt/index.ts +1 -0
- package/src/Prebuilt/layouts/EmbedView.jsx +0 -1
- package/src/Prebuilt/layouts/InsetView.jsx +65 -24
- package/src/Prebuilt/layouts/PDFView.jsx +0 -1
- package/src/Prebuilt/layouts/SidePane.jsx +8 -7
- package/src/Prebuilt/layouts/mainView.jsx +22 -31
- package/src/Prebuilt/layouts/screenShareView.jsx +0 -2
- package/src/Prebuilt/plugins/VirtualBackground/VirtualBackground.jsx +25 -1
- package/src/Prebuilt/primitives/DialogContent.jsx +1 -1
- package/src/Prebuilt/provider/roomLayoutProvider/index.tsx +1 -1
- package/src/Sheet/Sheet.mdx +19 -0
- package/src/Sheet/Sheet.stories.tsx +103 -0
- package/src/Sheet/Sheet.tsx +118 -0
- package/src/Sheet/index.ts +1 -0
- package/src/Theme/ThemeProvider.tsx +10 -13
- package/src/Theme/base.config.ts +1 -1
- package/src/Theme/stitches.config.ts +1 -1
- package/src/TileMenu/StyledMenuTile.tsx +2 -2
- package/src/TileMenu/TileMenu.tsx +2 -0
- package/src/VideoTile/StyledVideoTile.tsx +5 -0
- package/src/utils/animations.ts +18 -0
- package/dist/ActiveSpeakerView-V6O4K3BV.js +0 -39
- package/dist/ActiveSpeakerView-V6O4K3BV.js.map +0 -7
- package/dist/PinnedTrackView-7YQG4QKC.js +0 -70
- package/dist/PinnedTrackView-7YQG4QKC.js.map +0 -7
- package/dist/VirtualBackground-S3XEPZ2T.js.map +0 -7
- package/dist/chunk-42SWPN2C.js.map +0 -7
- package/dist/chunk-4NEZLVVH.js +0 -811
- package/dist/chunk-4NEZLVVH.js.map +0 -7
- package/dist/chunk-4ZBEFSRC.js +0 -58
- package/dist/chunk-4ZBEFSRC.js.map +0 -7
- package/dist/chunk-ESUJK7AT.js.map +0 -7
- package/dist/chunk-R6PDR5WZ.js +0 -243
- package/dist/chunk-R6PDR5WZ.js.map +0 -7
- package/dist/conference-7QKOMJPP.js +0 -3697
- package/dist/conference-7QKOMJPP.js.map +0 -7
- package/dist/transcription-RJA4V6PC.js +0 -356
- package/dist/transcription-RJA4V6PC.js.map +0 -7
- package/src/Prebuilt/common/useSortedPeers.js +0 -28
- package/src/Prebuilt/components/BottomActionSheet/BottomActionSheet.jsx +0 -96
- package/src/Prebuilt/components/BottomActionSheet/BottomActionSheet.stories.tsx +0 -46
- package/src/Prebuilt/components/Footer/ConferencingFooter.jsx +0 -101
- package/src/Prebuilt/components/Footer/StreamingFooter.jsx +0 -71
- package/src/Prebuilt/components/Footer.jsx +0 -8
- package/src/Prebuilt/components/MoreSettings/ChangeSelfRole.jsx +0 -67
- package/src/Prebuilt/components/TileMenu.jsx +0 -268
- package/src/Prebuilt/index.d.ts +0 -20
- package/src/Prebuilt/index.js +0 -2
@@ -2,17 +2,17 @@ import React, { useCallback, useEffect, useState } from 'react';
|
|
2
2
|
import {
|
3
3
|
selectLocalPeerRoleName,
|
4
4
|
selectPeers,
|
5
|
-
selectRemotePeers,
|
6
5
|
selectTracksMap,
|
7
6
|
useHMSActions,
|
8
7
|
useHMSStore,
|
9
8
|
useHMSVanillaStore,
|
10
9
|
} from '@100mslive/react-sdk';
|
11
10
|
import { PipIcon } from '@100mslive/react-icons';
|
12
|
-
import { Tooltip } from '../../../';
|
11
|
+
import { Flex, Tooltip } from '../../../';
|
13
12
|
import IconButton from '../../IconButton';
|
14
13
|
import { PictureInPicture } from './PIPManager';
|
15
14
|
import { MediaSession } from './SetupMediaSession';
|
15
|
+
import { usePinnedTrack } from '../AppData/useUISettings';
|
16
16
|
import { useIsFeatureEnabled } from '../hooks/useFeatures';
|
17
17
|
import { DEFAULT_HLS_VIEWER_ROLE, FEATURE_LIST } from '../../common/constants';
|
18
18
|
|
@@ -20,7 +20,7 @@ import { DEFAULT_HLS_VIEWER_ROLE, FEATURE_LIST } from '../../common/constants';
|
|
20
20
|
* shows a button which when clicked shows some videos in PIP, clicking
|
21
21
|
* again turns it off.
|
22
22
|
*/
|
23
|
-
const PIPComponent = ({
|
23
|
+
const PIPComponent = ({ content = null }) => {
|
24
24
|
const localPeerRole = useHMSStore(selectLocalPeerRoleName);
|
25
25
|
const [isPipOn, setIsPipOn] = useState(PictureInPicture.isOn());
|
26
26
|
const hmsActions = useHMSActions();
|
@@ -36,24 +36,22 @@ const PIPComponent = ({ peers, showLocalPeer }) => {
|
|
36
36
|
}
|
37
37
|
}, [hmsActions, isPipOn, store]);
|
38
38
|
|
39
|
-
// stop pip on unmount
|
40
|
-
useEffect(() => {
|
41
|
-
return () => {
|
42
|
-
PictureInPicture.stop().catch(err => console.error('error in stopping pip on unmount', err));
|
43
|
-
};
|
44
|
-
}, []);
|
45
|
-
|
46
39
|
if (!PictureInPicture.isSupported() || localPeerRole === DEFAULT_HLS_VIEWER_ROLE || !isFeatureEnabled) {
|
47
40
|
return null;
|
48
41
|
}
|
49
42
|
return (
|
50
43
|
<>
|
51
|
-
|
52
|
-
<
|
53
|
-
|
54
|
-
</
|
55
|
-
|
56
|
-
|
44
|
+
{content ? (
|
45
|
+
<Flex css={{ w: '100%' }} onClick={() => onPipToggle()} data-testid="pip_btn">
|
46
|
+
{content}
|
47
|
+
</Flex>
|
48
|
+
) : (
|
49
|
+
<Tooltip title={`${isPipOn ? 'Deactivate' : 'Activate'} picture in picture view`}>
|
50
|
+
<IconButton active={!isPipOn} key="pip" onClick={() => onPipToggle()} data-testid="pip_btn">
|
51
|
+
<PipIcon />
|
52
|
+
</IconButton>
|
53
|
+
</Tooltip>
|
54
|
+
)}
|
57
55
|
</>
|
58
56
|
);
|
59
57
|
};
|
@@ -62,21 +60,27 @@ const PIPComponent = ({ peers, showLocalPeer }) => {
|
|
62
60
|
* this is a separate component so it can be conditionally rendered and
|
63
61
|
* the subscriptions to store are done only if required.
|
64
62
|
*/
|
65
|
-
const ActivatedPIP = (
|
63
|
+
export const ActivatedPIP = () => {
|
66
64
|
const tracksMap = useHMSStore(selectTracksMap);
|
67
|
-
const storePeers = useHMSStore(
|
65
|
+
const storePeers = useHMSStore(selectPeers);
|
66
|
+
const pinnedTrack = usePinnedTrack();
|
68
67
|
|
69
68
|
useEffect(() => {
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
69
|
+
PictureInPicture.listenToStateChange(isPipOn => {
|
70
|
+
if (!isPipOn) {
|
71
|
+
return;
|
72
|
+
}
|
73
|
+
let pipPeers = storePeers;
|
74
|
+
if (pinnedTrack) {
|
75
|
+
pipPeers = storePeers.filter(peer => pinnedTrack.peerId === peer.id);
|
76
|
+
}
|
77
|
+
PictureInPicture.updatePeersAndTracks(pipPeers, tracksMap).catch(err => {
|
78
|
+
console.error('error in updating pip', err);
|
79
|
+
});
|
76
80
|
});
|
77
|
-
}, [
|
81
|
+
}, [storePeers, tracksMap, pinnedTrack]);
|
78
82
|
|
79
|
-
return
|
83
|
+
return <></>;
|
80
84
|
};
|
81
85
|
|
82
86
|
export default PIPComponent;
|
@@ -24,10 +24,15 @@ const PIPStates = {
|
|
24
24
|
* tracks which should be shown.
|
25
25
|
*/
|
26
26
|
class PipManager {
|
27
|
+
listeners = new Set();
|
27
28
|
constructor() {
|
28
29
|
this.reset();
|
29
30
|
}
|
30
31
|
|
32
|
+
listenToStateChange(cb) {
|
33
|
+
this.listeners.add(cb);
|
34
|
+
}
|
35
|
+
|
31
36
|
/**
|
32
37
|
* @private
|
33
38
|
*/
|
@@ -87,6 +92,7 @@ class PipManager {
|
|
87
92
|
console.debug('pip started');
|
88
93
|
this.state = PIPStates.started;
|
89
94
|
this.onStateChange(true);
|
95
|
+
this.callListeners(true);
|
90
96
|
} catch (err) {
|
91
97
|
console.error('error in request pip', err);
|
92
98
|
this.state = PIPStates.stopped;
|
@@ -108,6 +114,7 @@ class PipManager {
|
|
108
114
|
// detach all to avoid bandwidth consumption
|
109
115
|
await this.detachOldAttachNewTracks(this.tracksToShow, []);
|
110
116
|
this.onStateChange(false); // notify parent about this
|
117
|
+
this.callListeners(false);
|
111
118
|
this.reset(); // cleanup
|
112
119
|
this.state = PIPStates.stopped;
|
113
120
|
};
|
@@ -131,6 +138,12 @@ class PipManager {
|
|
131
138
|
}
|
132
139
|
|
133
140
|
// ------- Private function --------------
|
141
|
+
/**
|
142
|
+
* @private {boolean} on - whether pip is on/off
|
143
|
+
*/
|
144
|
+
callListeners = on => {
|
145
|
+
this.listeners.forEach(listener => listener?.(on));
|
146
|
+
};
|
134
147
|
|
135
148
|
/**
|
136
149
|
* @private
|
@@ -1,11 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import PIPComponent from './PIPComponent';
|
3
|
-
import { usePinnedTrack } from '../AppData/useUISettings';
|
4
3
|
|
5
|
-
export const PIP = () => {
|
6
|
-
|
7
|
-
|
8
|
-
return (
|
9
|
-
<PIPComponent peers={pinnedTrack && pinnedTrack.enabled ? [pinnedTrack.peerId] : undefined} showLocalPeer={true} />
|
10
|
-
);
|
4
|
+
export const PIP = ({ content = null }) => {
|
5
|
+
return <PIPComponent content={content} />;
|
11
6
|
};
|
@@ -2,14 +2,14 @@ import React from 'react';
|
|
2
2
|
import { ChevronLeftIcon, ChevronRightIcon } from '@100mslive/react-icons';
|
3
3
|
import { StyledPagination } from '../../Pagination';
|
4
4
|
|
5
|
-
export const Pagination = ({ page,
|
5
|
+
export const Pagination = ({ page, onPageChange, numPages }) => {
|
6
6
|
const disableLeft = page === 0;
|
7
7
|
const disableRight = page === numPages - 1;
|
8
8
|
const nextPage = () => {
|
9
|
-
|
9
|
+
onPageChange(Math.min(page + 1, numPages - 1));
|
10
10
|
};
|
11
11
|
const prevPage = () => {
|
12
|
-
|
12
|
+
onPageChange(Math.max(page - 1, 0));
|
13
13
|
};
|
14
14
|
return (
|
15
15
|
<StyledPagination.Root>
|
@@ -18,7 +18,7 @@ export const Pagination = ({ page, setPage, numPages }) => {
|
|
18
18
|
</StyledPagination.Chevron>
|
19
19
|
<StyledPagination.Dots>
|
20
20
|
{[...Array(numPages)].map((_, i) => (
|
21
|
-
<StyledPagination.Dot key={i} active={page === i} onClick={() =>
|
21
|
+
<StyledPagination.Dot key={i} active={page === i} onClick={() => onPageChange(i)} />
|
22
22
|
))}
|
23
23
|
</StyledPagination.Dots>
|
24
24
|
<StyledPagination.Chevron disabled={disableRight} onClick={nextPage}>
|
@@ -1,31 +1,28 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { useParams } from 'react-router-dom';
|
3
3
|
import { useSearchParam } from 'react-use';
|
4
|
-
import {
|
5
|
-
import {
|
4
|
+
import { Flex } from '../../../';
|
5
|
+
import { useHMSPrebuiltContext } from '../../AppContext';
|
6
6
|
import SidePane from '../../layouts/SidePane';
|
7
7
|
import { useRoomLayout } from '../../provider/roomLayoutProvider';
|
8
8
|
import FullPageProgress from '../FullPageProgress';
|
9
|
-
import { Header } from '../Header';
|
10
9
|
import PreviewJoin from './PreviewJoin';
|
11
10
|
import { useAuthToken } from '../AppData/useUISettings';
|
12
11
|
import { useNavigation } from '../hooks/useNavigation';
|
13
12
|
import { useSkipPreview } from '../hooks/useSkipPreview';
|
14
|
-
import {
|
13
|
+
import { QUERY_PARAM_PREVIEW_AS_ROLE } from '../../common/constants';
|
15
14
|
|
16
15
|
const PreviewContainer = () => {
|
17
16
|
const navigate = useNavigation();
|
18
17
|
const skipPreview = useSkipPreview();
|
19
18
|
const previewAsRole = useSearchParam(QUERY_PARAM_PREVIEW_AS_ROLE);
|
20
|
-
const
|
19
|
+
const { userName } = useHMSPrebuiltContext();
|
20
|
+
const initialName = userName || (skipPreview ? 'Beam' : '');
|
21
21
|
const { roomId: urlRoomId, role: userRole } = useParams(); // from the url
|
22
22
|
const authToken = useAuthToken();
|
23
23
|
const roomLayout = useRoomLayout();
|
24
24
|
const { preview_header: previewHeader = {} } = roomLayout?.screens?.preview?.default?.elements || {};
|
25
25
|
|
26
|
-
const roomState = useHMSStore(selectRoomState);
|
27
|
-
const isPreview = roomState === HMSRoomState.Preview;
|
28
|
-
|
29
26
|
const onJoin = () => {
|
30
27
|
let meetingURL = `/meeting/${urlRoomId}`;
|
31
28
|
if (userRole) {
|
@@ -35,11 +32,6 @@ const PreviewContainer = () => {
|
|
35
32
|
};
|
36
33
|
return (
|
37
34
|
<Flex direction="column" css={{ size: '100%' }}>
|
38
|
-
{isPreview ? null : (
|
39
|
-
<Box css={{ h: '$18', '@md': { h: '$17', flexShrink: 0 } }} data-testid="header">
|
40
|
-
<Header />
|
41
|
-
</Box>
|
42
|
-
)}
|
43
35
|
<Flex
|
44
36
|
css={{ flex: '1 1 0', position: 'relative', overflowY: 'auto', color: '$primary_default' }}
|
45
37
|
justify="center"
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { useMedia } from 'react-use';
|
3
|
-
import { JoinForm_JoinBtnType } from '@100mslive/types-prebuilt/elements/join_form';
|
4
3
|
import { selectPermissions, useHMSStore, useRecordingStreaming } from '@100mslive/react-sdk';
|
5
4
|
import { RadioIcon } from '@100mslive/react-icons';
|
6
5
|
import { Button, config as cssConfig, Flex, Input, styled } from '../../..';
|
7
6
|
import { useRoomLayout } from '../../provider/roomLayoutProvider';
|
8
7
|
import { PreviewSettings } from './PreviewJoin';
|
8
|
+
import { useShowStreamingUI } from '../../common/hooks';
|
9
9
|
|
10
10
|
const PreviewForm = ({
|
11
11
|
name,
|
@@ -24,10 +24,8 @@ const PreviewForm = ({
|
|
24
24
|
const permissions = useHMSStore(selectPermissions);
|
25
25
|
const layout = useRoomLayout();
|
26
26
|
const { join_form: joinForm = {} } = layout?.screens?.preview?.default?.elements || {};
|
27
|
-
const
|
28
|
-
|
29
|
-
!isHLSRunning &&
|
30
|
-
permissions?.hlsStreaming;
|
27
|
+
const showStreamingUI = useShowStreamingUI();
|
28
|
+
const showGoLive = showStreamingUI && !isHLSRunning && permissions?.hlsStreaming;
|
31
29
|
|
32
30
|
return (
|
33
31
|
<Form
|
@@ -44,6 +42,12 @@ const PreviewForm = ({
|
|
44
42
|
placeholder="Enter name"
|
45
43
|
autoFocus
|
46
44
|
autoComplete="name"
|
45
|
+
onKeyDown={e => {
|
46
|
+
if (e.key === 'Enter' && name.trim().length > 0) {
|
47
|
+
e.preventDefault();
|
48
|
+
onJoin();
|
49
|
+
}
|
50
|
+
}}
|
47
51
|
/>
|
48
52
|
{cannotPublishAudio && cannotPublishVideo && !isMobile ? <PreviewSettings /> : null}
|
49
53
|
</Flex>
|
@@ -12,18 +12,7 @@ import {
|
|
12
12
|
useRecordingStreaming,
|
13
13
|
} from '@100mslive/react-sdk';
|
14
14
|
import { MicOffIcon, SettingsIcon } from '@100mslive/react-icons';
|
15
|
-
import {
|
16
|
-
Avatar,
|
17
|
-
Box,
|
18
|
-
Flex,
|
19
|
-
flexCenter,
|
20
|
-
styled,
|
21
|
-
StyledVideoTile,
|
22
|
-
Text,
|
23
|
-
useBorderAudioLevel,
|
24
|
-
useTheme,
|
25
|
-
Video,
|
26
|
-
} from '../../../';
|
15
|
+
import { Avatar, Box, Flex, flexCenter, styled, StyledVideoTile, Text, useBorderAudioLevel, Video } from '../../../';
|
27
16
|
import { useHMSPrebuiltContext } from '../../AppContext';
|
28
17
|
import IconButton from '../../IconButton';
|
29
18
|
import { useRoomLayout } from '../../provider/roomLayoutProvider';
|
@@ -36,6 +25,7 @@ import SettingsModal from '../Settings/SettingsModal';
|
|
36
25
|
import PreviewForm from './PreviewForm';
|
37
26
|
import { useAuthToken, useUISettings } from '../AppData/useUISettings';
|
38
27
|
import { defaultPreviewPreference, UserPreferencesKeys, useUserPreferences } from '../hooks/useUserPreferences';
|
28
|
+
import { getFormattedCount } from '../../common/utils';
|
39
29
|
import { UI_SETTINGS } from '../../common/constants';
|
40
30
|
|
41
31
|
const VirtualBackground = React.lazy(() => import('../../plugins/VirtualBackground/VirtualBackground'));
|
@@ -44,8 +34,7 @@ const getParticipantChipContent = (peerCount = 0) => {
|
|
44
34
|
if (peerCount === 0) {
|
45
35
|
return 'You are the first to join';
|
46
36
|
}
|
47
|
-
const
|
48
|
-
const formattedNum = formatter.format(peerCount);
|
37
|
+
const formattedNum = getFormattedCount(peerCount);
|
49
38
|
return `${formattedNum} other${parseInt(formattedNum) === 1 ? '' : 's'} in the session`;
|
50
39
|
};
|
51
40
|
|
@@ -104,10 +93,16 @@ const PreviewJoin = ({ onJoin, skipPreview, initialName, asRole }) => {
|
|
104
93
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
105
94
|
}, [authToken, skipPreview]);
|
106
95
|
|
96
|
+
useEffect(() => {
|
97
|
+
if (initialName) {
|
98
|
+
setName(initialName);
|
99
|
+
}
|
100
|
+
}, [initialName]);
|
101
|
+
|
107
102
|
return roomState === HMSRoomState.Preview ? (
|
108
103
|
<Container css={{ h: '100%', pt: '$10', '@md': { justifyContent: 'space-between' } }}>
|
109
104
|
{toggleVideo ? null : <Box />}
|
110
|
-
<Flex direction="column" justify="center" css={{ w: '100%', maxWidth: '
|
105
|
+
<Flex direction="column" justify="center" css={{ w: '100%', maxWidth: '640px' }}>
|
111
106
|
<Logo />
|
112
107
|
<Text
|
113
108
|
variant="h4"
|
@@ -121,7 +116,7 @@ const PreviewJoin = ({ onJoin, skipPreview, initialName, asRole }) => {
|
|
121
116
|
>
|
122
117
|
{previewHeader.sub_title}
|
123
118
|
</Text>
|
124
|
-
<Flex justify="center" css={{ mt: '$14',
|
119
|
+
<Flex justify="center" css={{ mt: '$14', '@md': { mt: '$8', mb: '0' }, gap: '$4' }}>
|
125
120
|
{isStreamingOn ? (
|
126
121
|
<Chip
|
127
122
|
content="LIVE"
|
@@ -138,6 +133,8 @@ const PreviewJoin = ({ onJoin, skipPreview, initialName, asRole }) => {
|
|
138
133
|
align="center"
|
139
134
|
justify="center"
|
140
135
|
css={{
|
136
|
+
mt: '$14',
|
137
|
+
'@md': { mt: 0 },
|
141
138
|
'@sm': { width: '100%' },
|
142
139
|
flexDirection: 'column',
|
143
140
|
}}
|
@@ -145,7 +142,7 @@ const PreviewJoin = ({ onJoin, skipPreview, initialName, asRole }) => {
|
|
145
142
|
<PreviewTile name={name} error={previewError} />
|
146
143
|
</Flex>
|
147
144
|
) : null}
|
148
|
-
<Box css={{ w: '100%', maxWidth: '
|
145
|
+
<Box css={{ w: '100%', maxWidth: '640px' }}>
|
149
146
|
<PreviewControls
|
150
147
|
enableJoin={enableJoin}
|
151
148
|
savePreferenceAndJoin={savePreferenceAndJoin}
|
@@ -183,19 +180,16 @@ const PreviewTile = ({ name, error }) => {
|
|
183
180
|
const track = useHMSStore(trackSelector);
|
184
181
|
const showMuteIcon = !isLocalAudioEnabled || !toggleAudio;
|
185
182
|
|
186
|
-
const {
|
187
|
-
aspectRatio: { width, height },
|
188
|
-
} = useTheme();
|
189
183
|
return (
|
190
184
|
<StyledVideoTile.Container
|
191
185
|
css={{
|
192
186
|
bg: '$surface_default',
|
193
|
-
aspectRatio:
|
194
|
-
width: '
|
195
|
-
|
196
|
-
'@
|
197
|
-
|
198
|
-
width: 'min(
|
187
|
+
aspectRatio: 16 / 9,
|
188
|
+
width: 'min(640px, 80vw)',
|
189
|
+
overflow: 'clip',
|
190
|
+
'@md': {
|
191
|
+
aspectRatio: 9 / 16,
|
192
|
+
width: 'min(275px, 70vw)',
|
199
193
|
maxWidth: '100%',
|
200
194
|
},
|
201
195
|
}}
|
@@ -246,7 +240,6 @@ const PreviewControls = ({ hideSettings }) => {
|
|
246
240
|
);
|
247
241
|
};
|
248
242
|
|
249
|
-
// Bottom action sheet goes here, if isMobile
|
250
243
|
export const PreviewSettings = React.memo(() => {
|
251
244
|
const [open, setOpen] = useState(false);
|
252
245
|
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { selectLocalPeer, selectPeerMetadata, useHMSStore } from '@100mslive/react-sdk';
|
3
|
+
import { HandIcon } from '@100mslive/react-icons';
|
4
|
+
import { Tooltip } from '../../Tooltip';
|
5
|
+
import IconButton from '../IconButton';
|
6
|
+
import { useIsFeatureEnabled } from './hooks/useFeatures';
|
7
|
+
import { useMyMetadata } from './hooks/useMetadata';
|
8
|
+
import { FEATURE_LIST } from '../common/constants';
|
9
|
+
|
10
|
+
export const RaiseHand = () => {
|
11
|
+
const isHandRaiseEnabled = useIsFeatureEnabled(FEATURE_LIST.HAND_RAISE);
|
12
|
+
const { toggleHandRaise } = useMyMetadata();
|
13
|
+
const localPeer = useHMSStore(selectLocalPeer);
|
14
|
+
const isHandRaised = useHMSStore(selectPeerMetadata(localPeer.id))?.isHandRaised || false;
|
15
|
+
|
16
|
+
if (!isHandRaiseEnabled) {
|
17
|
+
return null;
|
18
|
+
}
|
19
|
+
|
20
|
+
return (
|
21
|
+
<Tooltip title={isHandRaised ? 'Lower hand' : 'Raise hand'}>
|
22
|
+
<IconButton active={!isHandRaised} onClick={toggleHandRaise}>
|
23
|
+
<HandIcon />
|
24
|
+
</IconButton>
|
25
|
+
</Tooltip>
|
26
|
+
);
|
27
|
+
};
|
@@ -22,12 +22,12 @@ export const ScreenshareDisplay = () => {
|
|
22
22
|
r: '$3',
|
23
23
|
m: '0 auto',
|
24
24
|
color: '$on_surface_high',
|
25
|
-
bg: '$
|
25
|
+
bg: '$background_default',
|
26
26
|
textAlign: 'center',
|
27
27
|
}}
|
28
28
|
>
|
29
29
|
<ShareScreenIcon width={48} height={48} />
|
30
|
-
<Text variant="h5" css={{ m: '$8 0' }}>
|
30
|
+
<Text variant="h5" css={{ m: '$8 0', color: '$on_surface_high' }}>
|
31
31
|
You are sharing your screen
|
32
32
|
</Text>
|
33
33
|
<Button
|
@@ -9,11 +9,11 @@ import {
|
|
9
9
|
useHMSStore,
|
10
10
|
} from '@100mslive/react-sdk';
|
11
11
|
import { ExpandIcon, ShrinkIcon } from '@100mslive/react-icons';
|
12
|
+
import TileMenu from './TileMenu/TileMenu';
|
12
13
|
import { VideoTileStats } from '../../Stats';
|
13
14
|
import { Video } from '../../Video';
|
14
15
|
import { StyledVideoTile } from '../../VideoTile';
|
15
16
|
import { getVideoTileLabel } from './peerTileUtils';
|
16
|
-
import TileMenu from './TileMenu';
|
17
17
|
import { useIsHeadless, useUISettings } from './AppData/useUISettings';
|
18
18
|
import { UI_SETTINGS } from '../common/constants';
|
19
19
|
|
@@ -49,7 +49,7 @@ const Tile = ({ peerId, width = '100%', height = '100%' }) => {
|
|
49
49
|
const isFullScreenSupported = screenfull.isEnabled;
|
50
50
|
const audioTrack = useHMSStore(selectScreenShareAudioByPeerID(peer?.id));
|
51
51
|
return (
|
52
|
-
<StyledVideoTile.Root css={{ width, height }} data-testid="screenshare_tile">
|
52
|
+
<StyledVideoTile.Root css={{ width, height, p: 0 }} data-testid="screenshare_tile">
|
53
53
|
{peer ? (
|
54
54
|
<StyledVideoTile.Container
|
55
55
|
transparentBg
|
@@ -131,6 +131,7 @@ const DeviceSelector = ({ title, devices, selection, onChange, icon, children =
|
|
131
131
|
position: 'relative',
|
132
132
|
flex: '1 1 0',
|
133
133
|
minWidth: 0,
|
134
|
+
w: '100%',
|
134
135
|
maxWidth: '100%',
|
135
136
|
'@md': {
|
136
137
|
mb: children ? '$8' : 0,
|
@@ -145,7 +146,7 @@ const DeviceSelector = ({ title, devices, selection, onChange, icon, children =
|
|
145
146
|
open={open}
|
146
147
|
/>
|
147
148
|
<Dropdown.Portal>
|
148
|
-
<Dropdown.Content align="start" sideOffset={8} css={{ w: ref.current?.clientWidth, zIndex:
|
149
|
+
<Dropdown.Content align="start" sideOffset={8} css={{ w: ref.current?.clientWidth, zIndex: 1001 }}>
|
149
150
|
{devices.map(device => {
|
150
151
|
return (
|
151
152
|
<Dropdown.Item
|
@@ -10,10 +10,7 @@ export const LayoutSettings = () => {
|
|
10
10
|
const hmsActions = useHMSActions();
|
11
11
|
const isLocalVideoEnabled = useHMSStore(selectIsLocalVideoEnabled);
|
12
12
|
const isLocalScreenShared = useHMSStore(selectIsLocalScreenShared);
|
13
|
-
const [
|
14
|
-
{ isAudioOnly, uiViewMode, maxTileCount, mirrorLocalVideo, activeSpeakerSorting, hideLocalVideo },
|
15
|
-
setUISettings,
|
16
|
-
] = useSetUiSettings();
|
13
|
+
const [{ isAudioOnly, uiViewMode, maxTileCount, mirrorLocalVideo }, setUISettings] = useSetUiSettings();
|
17
14
|
const toggleIsAudioOnly = useCallback(
|
18
15
|
async isAudioOnlyModeOn => {
|
19
16
|
if (isAudioOnlyModeOn) {
|
@@ -38,16 +35,6 @@ export const LayoutSettings = () => {
|
|
38
35
|
id="activeSpeakerMode"
|
39
36
|
label="Active Speaker Mode"
|
40
37
|
/>
|
41
|
-
<SwitchWithLabel
|
42
|
-
label="Active Speaker Sorting"
|
43
|
-
id="activeSpeakerSortingMode"
|
44
|
-
checked={activeSpeakerSorting}
|
45
|
-
onChange={value => {
|
46
|
-
setUISettings({
|
47
|
-
[UI_SETTINGS.activeSpeakerSorting]: value,
|
48
|
-
});
|
49
|
-
}}
|
50
|
-
/>
|
51
38
|
<SwitchWithLabel label="Audio Only Mode" id="audioOnlyMode" checked={isAudioOnly} onChange={toggleIsAudioOnly} />
|
52
39
|
<SwitchWithLabel
|
53
40
|
label="Mirror Local Video"
|
@@ -59,16 +46,6 @@ export const LayoutSettings = () => {
|
|
59
46
|
});
|
60
47
|
}}
|
61
48
|
/>
|
62
|
-
<SwitchWithLabel
|
63
|
-
label="Hide Local Video"
|
64
|
-
id="hideLocalVideo"
|
65
|
-
checked={hideLocalVideo}
|
66
|
-
onChange={value => {
|
67
|
-
setUISettings({
|
68
|
-
[UI_SETTINGS.hideLocalVideo]: value,
|
69
|
-
});
|
70
|
-
}}
|
71
|
-
/>
|
72
49
|
<Flex align="center" css={{ w: '100%', my: '$2', py: '$8', '@md': { display: 'none' } }}>
|
73
50
|
<Text variant="md" css={{ fontWeight: '$semiBold' }}>
|
74
51
|
Tiles In View({maxTileCount})
|