@100mslive/roomkit-react 0.3.23 → 0.3.24-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Accordion/Accordion.d.ts +134 -322
- package/dist/Accordion/index.d.ts +134 -322
- package/dist/Avatar/Avatar.d.ts +47 -141
- package/dist/Button/Button.d.ts +47 -141
- package/dist/Checkbox/Checkbox.d.ts +134 -322
- package/dist/Collapsible/Collapsible.d.ts +201 -483
- package/dist/Divider/Divider.d.ts +134 -322
- package/dist/Dropdown/Dropdown.d.ts +804 -1932
- package/dist/Fieldset/Fieldset.d.ts +47 -141
- package/dist/Footer/Footer.d.ts +536 -1288
- package/dist/IconButton/IconButton.d.ts +47 -141
- package/dist/Input/Input.d.ts +362 -926
- package/dist/Label/Label.d.ts +47 -141
- package/dist/Layout/Box.d.ts +47 -141
- package/dist/Layout/Flex.d.ts +47 -141
- package/dist/Link/Link.d.ts +47 -141
- package/dist/Modal/Dialog.d.ts +329 -987
- package/dist/Modal/DialogContent.d.ts +469 -1127
- package/dist/Pagination/StyledPagination.d.ts +268 -644
- package/dist/Popover/index.d.ts +201 -483
- package/dist/Prebuilt/IconButton.d.ts +134 -322
- package/dist/Prebuilt/components/Chat/ChatBody.d.ts +134 -322
- package/dist/Prebuilt/components/Leave/LeaveAtoms.d.ts +335 -805
- package/dist/Prebuilt/components/Notifications/DeviceChangeNotifications.d.ts +1 -0
- package/dist/Prebuilt/components/Notifications/ErrorNotifications.d.ts +1 -0
- package/dist/Prebuilt/components/Notifications/MessageNotifications.d.ts +1 -0
- package/dist/Prebuilt/components/Notifications/PollNotificationModal.d.ts +1 -0
- package/dist/Prebuilt/components/Notifications/RoleChangeNotification.d.ts +1 -0
- package/dist/Prebuilt/components/Settings/common.d.ts +134 -322
- package/dist/Progress/index.d.ts +134 -322
- package/dist/RadioGroup/RadioGroup.d.ts +201 -483
- package/dist/ReactSelect/ReactSelect.d.ts +670 -1610
- package/dist/Select/Select.d.ts +201 -483
- package/dist/Sheet/Sheet.d.ts +329 -987
- package/dist/Slider/Slider.d.ts +47 -141
- package/dist/Stats/StyledStats.d.ts +402 -966
- package/dist/Switch/Switch.d.ts +47 -141
- package/dist/Tabs/Tabs.d.ts +268 -644
- package/dist/Text/Text.d.ts +47 -141
- package/dist/TextArea/TextArea.d.ts +47 -141
- package/dist/Theme/base.config.d.ts +26 -78
- package/dist/Theme/stitches.config.d.ts +1046 -1493
- package/dist/TileMenu/StyledMenuTile.d.ts +469 -1127
- package/dist/Toast/Toast.d.ts +382 -946
- package/dist/Video/Video.d.ts +47 -141
- package/dist/VideoList/StyledVideoList.d.ts +201 -483
- package/dist/VideoTile/StyledVideoTile.d.ts +670 -1610
- package/dist/android-perm-1.png +0 -0
- package/dist/audio-level.png +0 -0
- package/dist/empty-chat.svg +12 -0
- package/dist/index.cjs.css +2 -2
- package/dist/index.cjs.css.map +1 -1
- package/dist/index.cjs.js +34062 -37242
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/index.js +36387 -67
- package/dist/index.js.map +4 -4
- package/dist/ios-perm-0.png +0 -0
- package/dist/meta.cjs.json +1531 -1218
- package/dist/meta.esbuild.json +942 -794
- package/dist/pdf-share.png +0 -0
- package/dist/screen-share.png +0 -0
- package/dist/transaction_error.svg +12 -0
- package/package.json +8 -8
- package/src/Avatar/Avatar.tsx +1 -1
- package/src/Popover/Popover.stories.tsx +1 -1
- package/src/Prebuilt/components/Chat/Chat.tsx +1 -1
- package/src/Prebuilt/components/Chat/ChatFooter.tsx +1 -1
- package/src/Prebuilt/components/Footer/WhiteboardToggle.tsx +11 -4
- package/src/Prebuilt/components/HMSVideo/HMSVideo.jsx +3 -3
- package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.tsx +3 -0
- package/src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.tsx +14 -1
- package/src/Prebuilt/components/Notifications/DeviceChangeNotifications.tsx +18 -0
- package/src/Prebuilt/components/Notifications/ErrorNotifications.tsx +56 -0
- package/src/Prebuilt/components/Notifications/MessageNotifications.tsx +24 -0
- package/src/Prebuilt/components/Notifications/Notifications.tsx +13 -171
- package/src/Prebuilt/components/Notifications/PeerNotifications.tsx +9 -2
- package/src/Prebuilt/components/Notifications/PollNotificationModal.tsx +71 -0
- package/src/Prebuilt/components/Notifications/ReconnectNotifications.tsx +1 -5
- package/src/Prebuilt/components/Notifications/RoleChangeNotification.tsx +24 -0
- package/src/Prebuilt/components/Notifications/TrackBulkUnmuteModal.tsx +7 -5
- package/src/Prebuilt/components/Notifications/TrackNotifications.tsx +23 -1
- package/src/Prebuilt/components/Notifications/TrackUnmuteModal.tsx +13 -5
- package/src/Prebuilt/components/Preview/PreviewJoin.tsx +3 -2
- package/src/Prebuilt/components/StatsForNerds.jsx +122 -9
- package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +0 -1
- package/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +2 -2
- package/src/Prebuilt/components/VirtualBackground/VBOption.tsx +3 -1
- package/src/Prebuilt/components/VirtualBackground/VBPicker.tsx +6 -0
- package/src/Prebuilt/layouts/HLSView.jsx +3 -3
- package/src/Prebuilt/layouts/PDFView.jsx +1 -0
- package/src/Prebuilt/layouts/VideoStreamingSection.tsx +82 -86
- package/src/Prebuilt/layouts/WaitingView.tsx +2 -2
- package/dist/HLSView-HYI6LLL6.js +0 -1652
- package/dist/HLSView-HYI6LLL6.js.map +0 -7
- package/dist/HLSView-S4NJF7Q2.css +0 -2780
- package/dist/HLSView-S4NJF7Q2.css.map +0 -7
- package/dist/chunk-LRJSQMZ4.js +0 -34759
- package/dist/chunk-LRJSQMZ4.js.map +0 -7
|
@@ -5,11 +5,7 @@ import { ToastConfig } from '../Toast/ToastConfig';
|
|
|
5
5
|
// @ts-ignore: No implicit Any
|
|
6
6
|
import { ToastManager } from '../Toast/ToastManager';
|
|
7
7
|
|
|
8
|
-
const notificationTypes = [
|
|
9
|
-
HMSNotificationTypes.RECONNECTED,
|
|
10
|
-
HMSNotificationTypes.RECONNECTING,
|
|
11
|
-
HMSNotificationTypes.ERROR,
|
|
12
|
-
];
|
|
8
|
+
const notificationTypes = [HMSNotificationTypes.RECONNECTED, HMSNotificationTypes.RECONNECTING];
|
|
13
9
|
let notificationId: string | null = null;
|
|
14
10
|
|
|
15
11
|
export const ReconnectNotifications = () => {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { HMSNotificationTypes, useHMSNotifications } from '@100mslive/react-sdk';
|
|
3
|
+
import { useUpdateRoomLayout } from '../../provider/roomLayoutProvider';
|
|
4
|
+
// @ts-ignore: No implicit Any
|
|
5
|
+
import { ToastManager } from '../Toast/ToastManager';
|
|
6
|
+
|
|
7
|
+
export const RoleChangeNotification = () => {
|
|
8
|
+
const notification = useHMSNotifications(HMSNotificationTypes.ROLE_UPDATED);
|
|
9
|
+
const updateRoomLayoutForRole = useUpdateRoomLayout();
|
|
10
|
+
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (!notification?.data) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (notification.data?.isLocal && notification.data?.roleName) {
|
|
16
|
+
ToastManager.addToast({
|
|
17
|
+
title: `You are now a ${notification.data.roleName}`,
|
|
18
|
+
});
|
|
19
|
+
updateRoomLayoutForRole?.(notification.data.roleName);
|
|
20
|
+
}
|
|
21
|
+
}, [notification]);
|
|
22
|
+
|
|
23
|
+
return null;
|
|
24
|
+
};
|
|
@@ -9,14 +9,16 @@ import { MicOnIcon } from '@100mslive/react-icons';
|
|
|
9
9
|
// @ts-ignore: No implicit Any
|
|
10
10
|
import { RequestDialog } from '../../primitives/DialogContent';
|
|
11
11
|
|
|
12
|
+
const notificationTypes = [
|
|
13
|
+
HMSNotificationTypes.CHANGE_MULTI_TRACK_STATE_REQUEST,
|
|
14
|
+
HMSNotificationTypes.ROOM_ENDED,
|
|
15
|
+
HMSNotificationTypes.REMOVED_FROM_ROOM,
|
|
16
|
+
];
|
|
17
|
+
|
|
12
18
|
export const TrackBulkUnmuteModal = () => {
|
|
13
19
|
const hmsActions = useHMSActions();
|
|
14
20
|
const [muteNotification, setMuteNotification] = useState<HMSChangeMultiTrackStateRequest | null>(null);
|
|
15
|
-
const notification = useHMSNotifications(
|
|
16
|
-
HMSNotificationTypes.CHANGE_MULTI_TRACK_STATE_REQUEST,
|
|
17
|
-
HMSNotificationTypes.ROOM_ENDED,
|
|
18
|
-
HMSNotificationTypes.REMOVED_FROM_ROOM,
|
|
19
|
-
]);
|
|
21
|
+
const notification = useHMSNotifications(notificationTypes);
|
|
20
22
|
|
|
21
23
|
useEffect(() => {
|
|
22
24
|
switch (notification?.type) {
|
|
@@ -1,17 +1,39 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
2
|
import { HMSNotificationTypes, useHMSNotifications } from '@100mslive/react-sdk';
|
|
3
|
+
// @ts-ignore: No implicit Any
|
|
4
|
+
import { ToastManager } from '../Toast/ToastManager';
|
|
3
5
|
|
|
4
6
|
const notificationTypes = [
|
|
5
7
|
HMSNotificationTypes.TRACK_ADDED,
|
|
6
8
|
HMSNotificationTypes.TRACK_REMOVED,
|
|
7
9
|
HMSNotificationTypes.TRACK_MUTED,
|
|
8
10
|
HMSNotificationTypes.TRACK_UNMUTED,
|
|
11
|
+
HMSNotificationTypes.CHANGE_TRACK_STATE_REQUEST,
|
|
9
12
|
];
|
|
13
|
+
|
|
10
14
|
export const TrackNotifications = () => {
|
|
11
15
|
const notification = useHMSNotifications(notificationTypes);
|
|
12
16
|
useEffect(() => {
|
|
13
17
|
if (notification) {
|
|
14
|
-
|
|
18
|
+
switch (notification.type) {
|
|
19
|
+
case HMSNotificationTypes.TRACK_ADDED:
|
|
20
|
+
case HMSNotificationTypes.TRACK_REMOVED:
|
|
21
|
+
case HMSNotificationTypes.TRACK_MUTED:
|
|
22
|
+
case HMSNotificationTypes.TRACK_UNMUTED:
|
|
23
|
+
console.debug(`[${notification.type}]`, notification);
|
|
24
|
+
break;
|
|
25
|
+
case HMSNotificationTypes.CHANGE_TRACK_STATE_REQUEST:
|
|
26
|
+
{
|
|
27
|
+
const track = notification.data?.track;
|
|
28
|
+
if (!notification.data.enabled) {
|
|
29
|
+
ToastManager.addToast({
|
|
30
|
+
title: `Your ${track.source} ${track.type} was muted by
|
|
31
|
+
${notification.data.requestedBy?.name}.`,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
15
37
|
}
|
|
16
38
|
}, [notification]);
|
|
17
39
|
|
|
@@ -8,20 +8,28 @@ import {
|
|
|
8
8
|
import { MicOnIcon } from '@100mslive/react-icons';
|
|
9
9
|
// @ts-ignore: No implicit Any
|
|
10
10
|
import { RequestDialog } from '../../primitives/DialogContent';
|
|
11
|
+
// @ts-ignore: No implicit Any
|
|
12
|
+
import { ToastManager } from '../Toast/ToastManager';
|
|
13
|
+
|
|
14
|
+
const notificationTypes = [
|
|
15
|
+
HMSNotificationTypes.CHANGE_TRACK_STATE_REQUEST,
|
|
16
|
+
HMSNotificationTypes.ROOM_ENDED,
|
|
17
|
+
HMSNotificationTypes.REMOVED_FROM_ROOM,
|
|
18
|
+
];
|
|
11
19
|
|
|
12
20
|
export const TrackUnmuteModal = () => {
|
|
13
21
|
const hmsActions = useHMSActions();
|
|
14
|
-
const notification = useHMSNotifications(
|
|
15
|
-
HMSNotificationTypes.CHANGE_TRACK_STATE_REQUEST,
|
|
16
|
-
HMSNotificationTypes.ROOM_ENDED,
|
|
17
|
-
HMSNotificationTypes.REMOVED_FROM_ROOM,
|
|
18
|
-
]);
|
|
22
|
+
const notification = useHMSNotifications(notificationTypes);
|
|
19
23
|
const [muteNotification, setMuteNotification] = useState<HMSChangeTrackStateRequest | null>(null);
|
|
20
24
|
|
|
21
25
|
useEffect(() => {
|
|
22
26
|
switch (notification?.type) {
|
|
23
27
|
case HMSNotificationTypes.REMOVED_FROM_ROOM:
|
|
24
28
|
case HMSNotificationTypes.ROOM_ENDED:
|
|
29
|
+
ToastManager.addToast({
|
|
30
|
+
title: `${notification.message}.
|
|
31
|
+
${notification.data.reason && `Reason: ${notification.data.reason}`}`,
|
|
32
|
+
});
|
|
25
33
|
setMuteNotification(null);
|
|
26
34
|
break;
|
|
27
35
|
case HMSNotificationTypes.CHANGE_TRACK_STATE_REQUEST:
|
|
@@ -61,7 +61,7 @@ const useLocalTileAspectRatio = () => {
|
|
|
61
61
|
} else {
|
|
62
62
|
aspectRatio = isMobile ? 9 / 16 : 16 / 9;
|
|
63
63
|
}
|
|
64
|
-
return aspectRatio;
|
|
64
|
+
return aspectRatio.toString();
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
const PreviewJoin = ({
|
|
@@ -113,6 +113,7 @@ const PreviewJoin = ({
|
|
|
113
113
|
const { elements = {} } = useRoomLayoutPreviewScreen();
|
|
114
114
|
const { preview_header: previewHeader = {}, virtual_background } = elements || {};
|
|
115
115
|
const aspectRatio = useLocalTileAspectRatio();
|
|
116
|
+
|
|
116
117
|
useEffect(() => {
|
|
117
118
|
if (authToken) {
|
|
118
119
|
if (skipPreview) {
|
|
@@ -158,7 +159,7 @@ const PreviewJoin = ({
|
|
|
158
159
|
</Flex>
|
|
159
160
|
</Flex>
|
|
160
161
|
{toggleVideo ? <PreviewTile name={name} error={previewError} /> : null}
|
|
161
|
-
<Box css={{ w: '100%', maxWidth: `${Math.max(aspectRatio, 1) * 340}px` }}>
|
|
162
|
+
<Box css={{ w: '100%', maxWidth: `${Math.max(parseFloat(aspectRatio), 1) * 340}px` }}>
|
|
162
163
|
<PreviewControls hideSettings={!toggleVideo && !toggleAudio} vbEnabled={!!virtual_background} />
|
|
163
164
|
<PreviewForm
|
|
164
165
|
name={name}
|
|
@@ -1,35 +1,45 @@
|
|
|
1
1
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
+
import { useMedia } from 'react-use';
|
|
2
3
|
import { match, P } from 'ts-pattern';
|
|
3
4
|
import {
|
|
4
5
|
selectHMSStats,
|
|
5
6
|
selectLocalPeerID,
|
|
6
7
|
selectPeersMap,
|
|
7
8
|
selectTracksMap,
|
|
9
|
+
useHMSActions,
|
|
8
10
|
useHMSStatsStore,
|
|
9
11
|
useHMSStore,
|
|
10
12
|
} from '@100mslive/react-sdk';
|
|
13
|
+
import { Accordion } from '../../Accordion';
|
|
11
14
|
import { HorizontalDivider } from '../../Divider';
|
|
12
15
|
import { Dropdown } from '../../Dropdown';
|
|
13
16
|
import { Label } from '../../Label';
|
|
14
17
|
import { Box, Flex } from '../../Layout';
|
|
15
18
|
import { Dialog } from '../../Modal';
|
|
19
|
+
import { Sheet } from '../../Sheet';
|
|
16
20
|
import { formatBytes } from '../../Stats';
|
|
17
21
|
import { Switch } from '../../Switch';
|
|
18
22
|
import { Text } from '../../Text';
|
|
23
|
+
import { config as cssConfig } from '../../Theme';
|
|
19
24
|
import { DialogDropdownTrigger } from '../primitives/DropdownTrigger';
|
|
20
25
|
import { useSetUiSettings } from './AppData/useUISettings';
|
|
21
26
|
import { useDropdownSelection } from './hooks/useDropdownSelection';
|
|
22
27
|
import { UI_SETTINGS } from '../common/constants';
|
|
23
28
|
|
|
24
|
-
export const StatsForNerds = ({ onOpenChange }) => {
|
|
29
|
+
export const StatsForNerds = ({ open, onOpenChange }) => {
|
|
30
|
+
const mediaQueryLg = cssConfig.media.md;
|
|
31
|
+
const isMobile = useMedia(mediaQueryLg);
|
|
32
|
+
|
|
25
33
|
const tracksWithLabels = useTracksWithLabel();
|
|
26
34
|
const statsOptions = useMemo(
|
|
27
35
|
() => [{ id: 'local-peer', label: 'Local Peer Stats' }, ...tracksWithLabels],
|
|
28
36
|
[tracksWithLabels],
|
|
29
37
|
);
|
|
38
|
+
const hmsActions = useHMSActions();
|
|
39
|
+
const details = hmsActions.getDebugInfo();
|
|
30
40
|
const [selectedStat, setSelectedStat] = useState(statsOptions[0]);
|
|
31
41
|
const [showStatsOnTiles, setShowStatsOnTiles] = useSetUiSettings(UI_SETTINGS.showStatsOnTiles);
|
|
32
|
-
const [
|
|
42
|
+
const [openDropdown, setOpenDropdown] = useState(false);
|
|
33
43
|
const ref = useRef();
|
|
34
44
|
const selectionBg = useDropdownSelection();
|
|
35
45
|
|
|
@@ -39,14 +49,92 @@ export const StatsForNerds = ({ onOpenChange }) => {
|
|
|
39
49
|
}
|
|
40
50
|
}, [tracksWithLabels, selectedStat]);
|
|
41
51
|
|
|
42
|
-
return (
|
|
43
|
-
<
|
|
52
|
+
return isMobile ? (
|
|
53
|
+
<Sheet.Root open={open} onOpenChange={onOpenChange}>
|
|
54
|
+
<Sheet.Content
|
|
55
|
+
css={{
|
|
56
|
+
bg: '$surface_dim',
|
|
57
|
+
overflowY: 'auto',
|
|
58
|
+
px: '$4',
|
|
59
|
+
}}
|
|
60
|
+
>
|
|
61
|
+
<Sheet.Title css={{ py: '$10', px: '$8', alignItems: 'center' }}>
|
|
62
|
+
<Flex justify="between">
|
|
63
|
+
<Flex align="center" css={{ mb: '$1' }}>
|
|
64
|
+
<Text variant="h6" inline>
|
|
65
|
+
Stats For Nerds
|
|
66
|
+
</Text>
|
|
67
|
+
</Flex>
|
|
68
|
+
<Dialog.DefaultClose data-testid="stats_dialog_close_icon" />
|
|
69
|
+
</Flex>
|
|
70
|
+
</Sheet.Title>
|
|
71
|
+
<HorizontalDivider />
|
|
72
|
+
<Flex justify="start" gap={4} css={{ m: '$10 0' }}>
|
|
73
|
+
<Switch checked={showStatsOnTiles} onCheckedChange={setShowStatsOnTiles} />
|
|
74
|
+
<Text variant="body2" css={{ fontWeight: '$semiBold' }}>
|
|
75
|
+
Show Stats on Tiles
|
|
76
|
+
</Text>
|
|
77
|
+
</Flex>
|
|
78
|
+
{/* Select */}
|
|
79
|
+
<Flex
|
|
80
|
+
direction="column"
|
|
81
|
+
css={{
|
|
82
|
+
mb: '$12',
|
|
83
|
+
position: 'relative',
|
|
84
|
+
minWidth: 0,
|
|
85
|
+
}}
|
|
86
|
+
>
|
|
87
|
+
<Label variant="body2" css={{ c: '$on_surface_high' }}>
|
|
88
|
+
Stats For
|
|
89
|
+
</Label>
|
|
90
|
+
<Dropdown.Root data-testid="dialog_select_Stats For" open={openDropdown} onOpenChange={setOpenDropdown}>
|
|
91
|
+
<DialogDropdownTrigger
|
|
92
|
+
title={selectedStat.label || 'Select Stats'}
|
|
93
|
+
css={{ mt: '$4' }}
|
|
94
|
+
titleCSS={{ mx: 0 }}
|
|
95
|
+
open={openDropdown}
|
|
96
|
+
ref={ref}
|
|
97
|
+
/>
|
|
98
|
+
<Dropdown.Portal>
|
|
99
|
+
<Dropdown.Content align="start" sideOffset={8} css={{ w: ref.current?.clientWidth, zIndex: 1000 }}>
|
|
100
|
+
{statsOptions.map(option => {
|
|
101
|
+
const isSelected = option.id === selectedStat.id && option.layer === selectedStat.layer;
|
|
102
|
+
return (
|
|
103
|
+
<Dropdown.Item
|
|
104
|
+
key={`${option.id}-${option.layer || ''}`}
|
|
105
|
+
onClick={() => {
|
|
106
|
+
setSelectedStat(option);
|
|
107
|
+
}}
|
|
108
|
+
css={{
|
|
109
|
+
px: '$9',
|
|
110
|
+
bg: isSelected ? selectionBg : undefined,
|
|
111
|
+
c: isSelected ? '$on_primary_high' : '$on_primary_high',
|
|
112
|
+
}}
|
|
113
|
+
>
|
|
114
|
+
{option.label}
|
|
115
|
+
</Dropdown.Item>
|
|
116
|
+
);
|
|
117
|
+
})}
|
|
118
|
+
</Dropdown.Content>
|
|
119
|
+
</Dropdown.Portal>
|
|
120
|
+
</Dropdown.Root>
|
|
121
|
+
</Flex>
|
|
122
|
+
{/* Stats */}
|
|
123
|
+
{selectedStat.id === 'local-peer' ? (
|
|
124
|
+
<LocalPeerStats />
|
|
125
|
+
) : (
|
|
126
|
+
<TrackStats trackID={selectedStat.id} layer={selectedStat.layer} local={selectedStat.local} />
|
|
127
|
+
)}
|
|
128
|
+
</Sheet.Content>
|
|
129
|
+
</Sheet.Root>
|
|
130
|
+
) : (
|
|
131
|
+
<Dialog.Root open={open} onOpenChange={onOpenChange}>
|
|
44
132
|
<Dialog.Portal>
|
|
45
133
|
<Dialog.Overlay />
|
|
46
134
|
<Dialog.Content
|
|
47
135
|
css={{
|
|
48
136
|
width: 'min(500px, 95%)',
|
|
49
|
-
|
|
137
|
+
height: 'min(656px, 90%)',
|
|
50
138
|
overflowY: 'auto',
|
|
51
139
|
}}
|
|
52
140
|
>
|
|
@@ -70,6 +158,7 @@ export const StatsForNerds = ({ onOpenChange }) => {
|
|
|
70
158
|
</Text>
|
|
71
159
|
</Flex>
|
|
72
160
|
{/* Select */}
|
|
161
|
+
|
|
73
162
|
<Flex
|
|
74
163
|
direction="column"
|
|
75
164
|
css={{
|
|
@@ -81,12 +170,12 @@ export const StatsForNerds = ({ onOpenChange }) => {
|
|
|
81
170
|
<Label variant="body2" css={{ c: '$on_surface_high' }}>
|
|
82
171
|
Stats For
|
|
83
172
|
</Label>
|
|
84
|
-
<Dropdown.Root data-testid="dialog_select_Stats For" open={
|
|
173
|
+
<Dropdown.Root data-testid="dialog_select_Stats For" open={openDropdown} onOpenChange={setOpenDropdown}>
|
|
85
174
|
<DialogDropdownTrigger
|
|
86
175
|
title={selectedStat.label || 'Select Stats'}
|
|
87
176
|
css={{ mt: '$4' }}
|
|
88
177
|
titleCSS={{ mx: 0 }}
|
|
89
|
-
open={
|
|
178
|
+
open={openDropdown}
|
|
90
179
|
ref={ref}
|
|
91
180
|
/>
|
|
92
181
|
<Dropdown.Portal>
|
|
@@ -119,6 +208,9 @@ export const StatsForNerds = ({ onOpenChange }) => {
|
|
|
119
208
|
) : (
|
|
120
209
|
<TrackStats trackID={selectedStat.id} layer={selectedStat.layer} local={selectedStat.local} />
|
|
121
210
|
)}
|
|
211
|
+
<Flex justify="start" gap={4} css={{ m: '$10 0', w: '100%' }}>
|
|
212
|
+
<DebugInfo details={details} />
|
|
213
|
+
</Flex>
|
|
122
214
|
</Dialog.Content>
|
|
123
215
|
</Dialog.Portal>
|
|
124
216
|
</Dialog.Root>
|
|
@@ -229,8 +321,29 @@ const TrackStats = ({ trackID, layer, local }) => {
|
|
|
229
321
|
);
|
|
230
322
|
};
|
|
231
323
|
|
|
232
|
-
const
|
|
233
|
-
|
|
324
|
+
const DebugInfo = ({ details }) => {
|
|
325
|
+
return (
|
|
326
|
+
<Accordion.Root type="single" collapsible css={{ w: '100%' }}>
|
|
327
|
+
<Accordion.Item value="Debug Info">
|
|
328
|
+
<Accordion.Header>
|
|
329
|
+
<Label variant="body2" css={{ c: '$on_surface_high' }}>
|
|
330
|
+
Debug Info
|
|
331
|
+
</Label>
|
|
332
|
+
</Accordion.Header>
|
|
333
|
+
<Accordion.Content>
|
|
334
|
+
<Flex css={{ flexWrap: 'wrap', mt: '$10', gap: '$10' }}>
|
|
335
|
+
<StatsRow css={{ w: '100%' }} label="Websocket URL" value={details?.websocketURL} />
|
|
336
|
+
<StatsRow css={{ w: '100%' }} label="Init Endpoint" value={details?.initEndpoint} />
|
|
337
|
+
<StatsRow css={{ w: '100%' }} label="Enabled flags" value={details?.enabledFlags?.join(', ')} />
|
|
338
|
+
</Flex>
|
|
339
|
+
</Accordion.Content>
|
|
340
|
+
</Accordion.Item>
|
|
341
|
+
</Accordion.Root>
|
|
342
|
+
);
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
const StatsRow = React.memo(({ label, value, css }) => (
|
|
346
|
+
<Box css={{ bg: '$surface_bright', w: 'calc(50% - $6)', p: '$8', r: '$3', ...css }}>
|
|
234
347
|
<Text
|
|
235
348
|
variant="overline"
|
|
236
349
|
css={{
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
useHMSStore,
|
|
10
10
|
useHMSVanillaStore,
|
|
11
11
|
} from '@100mslive/react-sdk';
|
|
12
|
-
// @ts-ignore: No implicit Any
|
|
13
12
|
import { EqualProminence } from './EqualProminence';
|
|
14
13
|
import { RoleProminence } from './RoleProminence';
|
|
15
14
|
import { ScreenshareLayout } from './ScreenshareLayout';
|
|
@@ -70,9 +70,9 @@ const SecondarySection = ({
|
|
|
70
70
|
rootCSS={{
|
|
71
71
|
padding: 0,
|
|
72
72
|
maxWidth: 240,
|
|
73
|
-
aspectRatio: 16 / 9,
|
|
73
|
+
aspectRatio: '16 / 9',
|
|
74
74
|
...(hasSidebar ? { w: '100%' } : { h: '100%' }),
|
|
75
|
-
'@md': { aspectRatio: 1 },
|
|
75
|
+
'@md': { aspectRatio: '1' },
|
|
76
76
|
}}
|
|
77
77
|
objectFit="contain"
|
|
78
78
|
{...tileLayoutProps}
|
|
@@ -25,7 +25,9 @@ const Root = ({
|
|
|
25
25
|
bg: '$surface_bright',
|
|
26
26
|
border: `4px solid ${isActive ? '$primary_default' : '$surface_dim'}`,
|
|
27
27
|
cursor: 'pointer',
|
|
28
|
-
'
|
|
28
|
+
'@media (hover:hover)': {
|
|
29
|
+
'&:hover': { border: '4px solid $primary_dim' },
|
|
30
|
+
},
|
|
29
31
|
...(mediaURL ? { height: '$20', backgroundImage: `url("${mediaURL}")`, backgroundSize: 'cover' } : {}),
|
|
30
32
|
}}
|
|
31
33
|
onClick={async () => {
|
|
@@ -180,6 +180,9 @@ export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBac
|
|
|
180
180
|
onClick: async () => {
|
|
181
181
|
await VBHandler.removeEffects();
|
|
182
182
|
hmsActions.setAppData(APP_DATA.background, HMSVirtualBackgroundTypes.NONE);
|
|
183
|
+
if (isMobile) {
|
|
184
|
+
toggleVB();
|
|
185
|
+
}
|
|
183
186
|
},
|
|
184
187
|
supported: true,
|
|
185
188
|
},
|
|
@@ -235,6 +238,9 @@ export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBac
|
|
|
235
238
|
onClick: async () => {
|
|
236
239
|
await VBHandler?.setBackground(mediaURL);
|
|
237
240
|
hmsActions.setAppData(APP_DATA.background, mediaURL);
|
|
241
|
+
if (isMobile) {
|
|
242
|
+
toggleVB();
|
|
243
|
+
}
|
|
238
244
|
},
|
|
239
245
|
supported: true,
|
|
240
246
|
}))}
|
|
@@ -46,7 +46,6 @@ const toastMap = {};
|
|
|
46
46
|
const ToggleChat = ({ isFullScreen = false }) => {
|
|
47
47
|
const { elements } = useRoomLayoutConferencingScreen();
|
|
48
48
|
const sidepane = useHMSStore(selectAppData(APP_DATA.sidePane));
|
|
49
|
-
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
|
50
49
|
const showChat = !!elements?.chat;
|
|
51
50
|
const isMobile = useMedia(config.media.md);
|
|
52
51
|
const hmsActions = useHMSActions();
|
|
@@ -57,7 +56,7 @@ const ToggleChat = ({ isFullScreen = false }) => {
|
|
|
57
56
|
hmsActions.setAppData(APP_DATA.sidePane, '');
|
|
58
57
|
})
|
|
59
58
|
.with({ isMobile: true, showChat: true, sidepane: P.when(value => !value) }, () => {
|
|
60
|
-
|
|
59
|
+
hmsActions.setAppData(APP_DATA.sidePane, SIDE_PANE_OPTIONS.CHAT);
|
|
61
60
|
})
|
|
62
61
|
.with({ showChat: false, isMobile: true, sidepane: SIDE_PANE_OPTIONS.CHAT }, () => {
|
|
63
62
|
hmsActions.setAppData(APP_DATA.sidePane, '');
|
|
@@ -65,7 +64,7 @@ const ToggleChat = ({ isFullScreen = false }) => {
|
|
|
65
64
|
.otherwise(() => {
|
|
66
65
|
//do nothing
|
|
67
66
|
});
|
|
68
|
-
}, [sidepane, isMobile,
|
|
67
|
+
}, [sidepane, isMobile, showChat, hmsActions, isFullScreen]);
|
|
69
68
|
return null;
|
|
70
69
|
};
|
|
71
70
|
const HLSView = () => {
|
|
@@ -286,6 +285,7 @@ const HLSView = () => {
|
|
|
286
285
|
hlsPlayer.reset();
|
|
287
286
|
};
|
|
288
287
|
}
|
|
288
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
289
289
|
}, [hlsUrl, vanillaStore, hmsActions]);
|
|
290
290
|
|
|
291
291
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { ControlPosition } from 'react-draggable';
|
|
3
3
|
import { useMedia } from 'react-use';
|
|
4
4
|
import {
|
|
@@ -15,16 +15,16 @@ import {
|
|
|
15
15
|
useHMSStore,
|
|
16
16
|
} from '@100mslive/react-sdk';
|
|
17
17
|
import { PeopleAddIcon, ShareScreenIcon } from '@100mslive/react-icons';
|
|
18
|
-
import FullPageProgress from '../components/FullPageProgress';
|
|
19
18
|
import { GridLayout } from '../components/VideoLayouts/GridLayout';
|
|
20
19
|
import { Box, Flex } from '../../Layout';
|
|
21
20
|
import { config } from '../../Theme';
|
|
22
21
|
// @ts-ignore: No implicit Any
|
|
23
22
|
import { EmbedView } from './EmbedView';
|
|
24
23
|
// @ts-ignore: No implicit Any
|
|
24
|
+
import HLSView from './HLSView';
|
|
25
|
+
// @ts-ignore: No implicit Any
|
|
25
26
|
import { PDFView } from './PDFView';
|
|
26
27
|
import SidePane from './SidePane';
|
|
27
|
-
// @ts-ignore: No implicit Any
|
|
28
28
|
import { WaitingView } from './WaitingView';
|
|
29
29
|
import { CaptionsViewer } from '../plugins/CaptionsViewer';
|
|
30
30
|
// @ts-ignore: No implicit Any
|
|
@@ -32,8 +32,6 @@ import { usePDFConfig, useUrlToEmbed } from '../components/AppData/useUISettings
|
|
|
32
32
|
import { useCloseScreenshareWhiteboard } from '../components/hooks/useCloseScreenshareWhiteboard';
|
|
33
33
|
import { useLandscapeHLSStream, useMobileHLSStream, useWaitingRoomInfo } from '../common/hooks';
|
|
34
34
|
import { SESSION_STORE_KEY } from '../common/constants';
|
|
35
|
-
// @ts-ignore: No implicit Any
|
|
36
|
-
const HLSView = React.lazy(() => import('./HLSView'));
|
|
37
35
|
|
|
38
36
|
export const VideoStreamingSection = ({
|
|
39
37
|
screenType,
|
|
@@ -79,90 +77,88 @@ export const VideoStreamingSection = ({
|
|
|
79
77
|
}
|
|
80
78
|
|
|
81
79
|
return (
|
|
82
|
-
<
|
|
83
|
-
|
|
80
|
+
<Flex
|
|
81
|
+
css={{
|
|
82
|
+
size: '100%',
|
|
83
|
+
position: 'relative',
|
|
84
|
+
gap: isMobileHLSStream || isLandscapeHLSStream ? '0' : '$4',
|
|
85
|
+
}}
|
|
86
|
+
direction={match<Record<string, boolean>, 'row' | 'column'>({ isLandscapeHLSStream, isMobileHLSStream })
|
|
87
|
+
.with({ isLandscapeHLSStream: true }, () => 'row')
|
|
88
|
+
.with({ isMobileHLSStream: true }, () => 'column')
|
|
89
|
+
.otherwise(() => 'row')}
|
|
90
|
+
>
|
|
91
|
+
{match({
|
|
92
|
+
screenType,
|
|
93
|
+
isNotAllowedToPublish,
|
|
94
|
+
isScreenOnlyPublishParams,
|
|
95
|
+
hasSubscribedRolePublishing,
|
|
96
|
+
isSharingScreen,
|
|
97
|
+
pdfAnnotatorActive,
|
|
98
|
+
urlToIframe,
|
|
99
|
+
})
|
|
100
|
+
.with(
|
|
101
|
+
{
|
|
102
|
+
screenType: 'hls_live_streaming',
|
|
103
|
+
},
|
|
104
|
+
() => <HLSView />,
|
|
105
|
+
)
|
|
106
|
+
.when(
|
|
107
|
+
({ isNotAllowedToPublish, hasSubscribedRolePublishing }) =>
|
|
108
|
+
isNotAllowedToPublish && !hasSubscribedRolePublishing,
|
|
109
|
+
() => (
|
|
110
|
+
<WaitingView
|
|
111
|
+
title="Waiting for Host to join"
|
|
112
|
+
subtitle="Sit back and relax"
|
|
113
|
+
icon={<PeopleAddIcon width="56px" height="56px" style={{ color: 'white' }} />}
|
|
114
|
+
/>
|
|
115
|
+
),
|
|
116
|
+
)
|
|
117
|
+
.when(
|
|
118
|
+
({ isScreenOnlyPublishParams, isSharingScreen, hasSubscribedRolePublishing }) =>
|
|
119
|
+
isScreenOnlyPublishParams && !isSharingScreen && !hasSubscribedRolePublishing,
|
|
120
|
+
() => (
|
|
121
|
+
<WaitingView
|
|
122
|
+
title="Ready to present"
|
|
123
|
+
subtitle="Select the Screenshare button to start presenting"
|
|
124
|
+
icon={<ShareScreenIcon width="56px" height="56px" style={{ color: 'white' }} />}
|
|
125
|
+
/>
|
|
126
|
+
),
|
|
127
|
+
)
|
|
128
|
+
.when(
|
|
129
|
+
({ pdfAnnotatorActive }) => !!pdfAnnotatorActive,
|
|
130
|
+
() => <PDFView />,
|
|
131
|
+
)
|
|
132
|
+
.when(
|
|
133
|
+
({ urlToIframe }) => !!urlToIframe,
|
|
134
|
+
() => <EmbedView />,
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
.otherwise(() => {
|
|
138
|
+
// @ts-ignore
|
|
139
|
+
return <GridLayout {...(elements as DefaultConferencingScreen_Elements)?.video_tile_layout?.grid} />;
|
|
140
|
+
})}
|
|
141
|
+
<CaptionsViewer setDefaultPosition={setCaptionPosition} defaultPosition={captionPosition} />
|
|
142
|
+
<Box
|
|
84
143
|
css={{
|
|
85
|
-
|
|
144
|
+
flex: match({ isLandscapeHLSStream, isMobileHLSStream })
|
|
145
|
+
.with({ isLandscapeHLSStream: true }, () => '1 1 0')
|
|
146
|
+
.with({ isMobileHLSStream: true }, () => '2 1 0')
|
|
147
|
+
.otherwise(() => undefined),
|
|
86
148
|
position: 'relative',
|
|
87
|
-
|
|
149
|
+
height: !isMobileHLSStream ? '100%' : undefined,
|
|
150
|
+
maxHeight: '100%',
|
|
151
|
+
'&:empty': { display: 'none' },
|
|
152
|
+
overflowY: 'clip',
|
|
88
153
|
}}
|
|
89
|
-
direction={match<Record<string, boolean>, 'row' | 'column'>({ isLandscapeHLSStream, isMobileHLSStream })
|
|
90
|
-
.with({ isLandscapeHLSStream: true }, () => 'row')
|
|
91
|
-
.with({ isMobileHLSStream: true }, () => 'column')
|
|
92
|
-
.otherwise(() => 'row')}
|
|
93
154
|
>
|
|
94
|
-
|
|
95
|
-
screenType
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
})
|
|
103
|
-
.with(
|
|
104
|
-
{
|
|
105
|
-
screenType: 'hls_live_streaming',
|
|
106
|
-
},
|
|
107
|
-
() => <HLSView />,
|
|
108
|
-
)
|
|
109
|
-
.when(
|
|
110
|
-
({ isNotAllowedToPublish, hasSubscribedRolePublishing }) =>
|
|
111
|
-
isNotAllowedToPublish && !hasSubscribedRolePublishing,
|
|
112
|
-
() => (
|
|
113
|
-
<WaitingView
|
|
114
|
-
title="Waiting for Host to join"
|
|
115
|
-
subtitle="Sit back and relax"
|
|
116
|
-
icon={<PeopleAddIcon width="56px" height="56px" style={{ color: 'white' }} />}
|
|
117
|
-
/>
|
|
118
|
-
),
|
|
119
|
-
)
|
|
120
|
-
.when(
|
|
121
|
-
({ isScreenOnlyPublishParams, isSharingScreen, hasSubscribedRolePublishing }) =>
|
|
122
|
-
isScreenOnlyPublishParams && !isSharingScreen && !hasSubscribedRolePublishing,
|
|
123
|
-
() => (
|
|
124
|
-
<WaitingView
|
|
125
|
-
title="Ready to present"
|
|
126
|
-
subtitle="Select the Screenshare button to start presenting"
|
|
127
|
-
icon={<ShareScreenIcon width="56px" height="56px" style={{ color: 'white' }} />}
|
|
128
|
-
/>
|
|
129
|
-
),
|
|
130
|
-
)
|
|
131
|
-
.when(
|
|
132
|
-
({ pdfAnnotatorActive }) => !!pdfAnnotatorActive,
|
|
133
|
-
() => <PDFView />,
|
|
134
|
-
)
|
|
135
|
-
.when(
|
|
136
|
-
({ urlToIframe }) => !!urlToIframe,
|
|
137
|
-
() => <EmbedView />,
|
|
138
|
-
)
|
|
139
|
-
|
|
140
|
-
.otherwise(() => {
|
|
141
|
-
// @ts-ignore
|
|
142
|
-
return <GridLayout {...(elements as DefaultConferencingScreen_Elements)?.video_tile_layout?.grid} />;
|
|
143
|
-
})}
|
|
144
|
-
<CaptionsViewer setDefaultPosition={setCaptionPosition} defaultPosition={captionPosition} />
|
|
145
|
-
<Box
|
|
146
|
-
css={{
|
|
147
|
-
flex: match({ isLandscapeHLSStream, isMobileHLSStream })
|
|
148
|
-
.with({ isLandscapeHLSStream: true }, () => '1 1 0')
|
|
149
|
-
.with({ isMobileHLSStream: true }, () => '2 1 0')
|
|
150
|
-
.otherwise(() => undefined),
|
|
151
|
-
position: 'relative',
|
|
152
|
-
height: !isMobileHLSStream ? '100%' : undefined,
|
|
153
|
-
maxHeight: '100%',
|
|
154
|
-
'&:empty': { display: 'none' },
|
|
155
|
-
overflowY: 'clip',
|
|
156
|
-
}}
|
|
157
|
-
>
|
|
158
|
-
<SidePane
|
|
159
|
-
screenType={screenType}
|
|
160
|
-
// @ts-ignore
|
|
161
|
-
tileProps={(elements as DefaultConferencingScreen_Elements)?.video_tile_layout?.grid}
|
|
162
|
-
hideControls={hideControls}
|
|
163
|
-
/>
|
|
164
|
-
</Box>
|
|
165
|
-
</Flex>
|
|
166
|
-
</Suspense>
|
|
155
|
+
<SidePane
|
|
156
|
+
screenType={screenType}
|
|
157
|
+
// @ts-ignore
|
|
158
|
+
tileProps={(elements as DefaultConferencingScreen_Elements)?.video_tile_layout?.grid}
|
|
159
|
+
hideControls={hideControls}
|
|
160
|
+
/>
|
|
161
|
+
</Box>
|
|
162
|
+
</Flex>
|
|
167
163
|
);
|
|
168
164
|
};
|