@100mslive/roomkit-react 0.2.8-alpha.6 → 0.2.8-alpha.8
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/{HLSView-53PDKIS2.js → HLSView-6KPQ2KD6.js} +176 -174
- package/dist/HLSView-6KPQ2KD6.js.map +7 -0
- package/dist/Prebuilt/components/HMSVideo/HLSQualitySelector.d.ts +3 -2
- package/dist/Prebuilt/components/HMSVideo/utils.d.ts +0 -1
- package/dist/Prebuilt/components/Leave/DesktopLeaveRoom.d.ts +2 -1
- package/dist/Prebuilt/components/Leave/LeaveRoom.d.ts +2 -1
- package/dist/Prebuilt/components/Leave/MwebLeaveRoom.d.ts +2 -1
- package/dist/Prebuilt/components/RaiseHand.d.ts +4 -1
- package/dist/Sheet/Sheet.d.ts +1 -0
- package/dist/{chunk-2ZFAT7KY.js → chunk-JQCSGJIR.js} +742 -639
- package/dist/chunk-JQCSGJIR.js.map +7 -0
- package/dist/index.cjs.js +1253 -1144
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.js +1 -1
- package/dist/meta.cjs.json +256 -201
- package/dist/meta.esbuild.json +263 -206
- package/package.json +6 -6
- package/src/Button/Button.tsx +4 -4
- package/src/Fieldset/Fieldset.tsx +1 -1
- package/src/Input/PasswordInput.stories.tsx +1 -1
- package/src/Pagination/StyledPagination.stories.tsx +2 -2
- package/src/Prebuilt/IconButton.tsx +1 -1
- package/src/Prebuilt/components/AppData/useSidepane.js +22 -10
- package/src/Prebuilt/components/Chat/Chat.tsx +41 -1
- package/src/Prebuilt/components/Chat/ChatFooter.tsx +19 -15
- package/src/Prebuilt/components/EmojiReaction.jsx +32 -22
- package/src/Prebuilt/components/HMSVideo/HLSQualitySelector.tsx +85 -78
- package/src/Prebuilt/components/HMSVideo/HMSVideo.jsx +3 -4
- package/src/Prebuilt/components/HMSVideo/MwebHLSViewTitle.tsx +49 -56
- package/src/Prebuilt/components/HMSVideo/VideoTime.tsx +2 -1
- package/src/Prebuilt/components/HMSVideo/utils.ts +0 -8
- package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.tsx +1 -1
- package/src/Prebuilt/components/Leave/DesktopLeaveRoom.tsx +50 -46
- package/src/Prebuilt/components/Leave/LeaveRoom.tsx +10 -5
- package/src/Prebuilt/components/Leave/MwebLeaveRoom.tsx +12 -6
- package/src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.tsx +7 -3
- package/src/Prebuilt/components/Notifications/HandRaisedNotifications.tsx +4 -1
- package/src/Prebuilt/components/Polls/Voting/Voting.tsx +3 -2
- package/src/Prebuilt/components/Polls/common/OptionInputWithDelete.tsx +1 -1
- package/src/Prebuilt/components/Polls/common/utils.ts +2 -2
- package/src/Prebuilt/components/RaiseHand.tsx +8 -2
- package/src/Prebuilt/components/RoomDetails/RoomDetailsPane.tsx +41 -14
- package/src/Prebuilt/components/pdfAnnotator/shareScreenOptions.jsx +2 -2
- package/src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx +1 -1
- package/src/Prebuilt/layouts/HLSView.jsx +27 -24
- package/src/Prebuilt/layouts/SidePane.tsx +1 -2
- package/src/Prebuilt/layouts/VideoStreamingSection.tsx +3 -2
- package/src/Prebuilt/primitives/DialogContent.jsx +1 -1
- package/src/Sheet/Sheet.tsx +3 -3
- package/dist/HLSView-53PDKIS2.js.map +0 -7
- package/dist/chunk-2ZFAT7KY.js.map +0 -7
@@ -1,13 +1,14 @@
|
|
1
|
-
import React
|
2
|
-
import {
|
1
|
+
import React from 'react';
|
2
|
+
import { ChevronDownIcon } from '@100mslive/react-icons';
|
3
3
|
import { Flex } from '../../../Layout';
|
4
4
|
import { Text } from '../../../Text';
|
5
5
|
// @ts-ignore: No implicit any
|
6
6
|
import { Logo } from '../Header/HeaderComponents';
|
7
|
-
import {
|
8
|
-
|
9
|
-
|
10
|
-
import {
|
7
|
+
import { RoomDetailsRow } from '../RoomDetails/RoomDetailsRow';
|
8
|
+
import { useRoomLayoutHeader } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
|
9
|
+
// @ts-ignore
|
10
|
+
import { useIsSidepaneTypeOpen, useSidepaneToggle } from '../AppData/useSidepane';
|
11
|
+
import { SIDE_PANE_OPTIONS } from '../../common/constants';
|
11
12
|
|
12
13
|
/*
|
13
14
|
player handler --> left -> go live with timer or live, right -> expand icon
|
@@ -16,39 +17,41 @@ import { getTime } from './utils';
|
|
16
17
|
half page will have chat or participant view
|
17
18
|
*/
|
18
19
|
export const HLSViewTitle = () => {
|
19
|
-
const
|
20
|
-
const
|
21
|
-
const
|
22
|
-
const { screenType } = useRoomLayoutConferencingScreen();
|
23
|
-
const [liveTime, setLiveTime] = useState(0);
|
24
|
-
|
25
|
-
const startTimer = useCallback(() => {
|
26
|
-
intervalRef.current = setInterval(() => {
|
27
|
-
const timeStamp = hlsState?.variants[0]?.[screenType === 'hls_live_streaming' ? 'startedAt' : 'initialisedAt'];
|
28
|
-
if (hlsState?.running && timeStamp) {
|
29
|
-
setLiveTime(Date.now() - timeStamp.getTime());
|
30
|
-
}
|
31
|
-
}, 60000);
|
32
|
-
}, [hlsState?.running, hlsState?.variants, screenType]);
|
33
|
-
|
34
|
-
useEffect(() => {
|
35
|
-
if (hlsState?.running) {
|
36
|
-
startTimer();
|
37
|
-
const timeStamp = hlsState?.variants[0]?.[screenType === 'hls_live_streaming' ? 'startedAt' : 'initialisedAt'];
|
38
|
-
if (hlsState?.running && timeStamp) {
|
39
|
-
setLiveTime(Date.now() - timeStamp.getTime());
|
40
|
-
}
|
41
|
-
}
|
42
|
-
if (!hlsState?.running && intervalRef.current) {
|
43
|
-
clearInterval(intervalRef.current);
|
44
|
-
}
|
45
|
-
return () => {
|
46
|
-
if (intervalRef.current) {
|
47
|
-
clearInterval(intervalRef.current);
|
48
|
-
}
|
49
|
-
};
|
50
|
-
}, [hlsState?.running, hlsState?.variants, screenType, startTimer]);
|
20
|
+
const { title, details } = useRoomLayoutHeader();
|
21
|
+
const toggleDetailsPane = useSidepaneToggle(SIDE_PANE_OPTIONS.ROOM_DETAILS);
|
22
|
+
const isDetailSidepaneOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.ROOM_DETAILS);
|
51
23
|
|
24
|
+
if (isDetailSidepaneOpen) {
|
25
|
+
return (
|
26
|
+
<Flex
|
27
|
+
gap="4"
|
28
|
+
align="center"
|
29
|
+
justify="between"
|
30
|
+
css={{
|
31
|
+
position: 'relative',
|
32
|
+
h: 'fit-content',
|
33
|
+
w: '100%',
|
34
|
+
borderBottom: '1px solid $border_bright',
|
35
|
+
p: '$8',
|
36
|
+
backgroundColor: '$surface_dim',
|
37
|
+
}}
|
38
|
+
>
|
39
|
+
<Text variant="sub2" css={{ fontWeight: '$semiBold' }}>
|
40
|
+
About Session
|
41
|
+
</Text>
|
42
|
+
<Flex
|
43
|
+
onClick={toggleDetailsPane}
|
44
|
+
css={{
|
45
|
+
color: '$on_surface_high',
|
46
|
+
cursor: 'pointer',
|
47
|
+
'&:hover': { opacity: '0.8' },
|
48
|
+
}}
|
49
|
+
>
|
50
|
+
<ChevronDownIcon />
|
51
|
+
</Flex>
|
52
|
+
</Flex>
|
53
|
+
);
|
54
|
+
}
|
52
55
|
return (
|
53
56
|
<Flex
|
54
57
|
gap="4"
|
@@ -64,25 +67,15 @@ export const HLSViewTitle = () => {
|
|
64
67
|
>
|
65
68
|
<Logo />
|
66
69
|
<Flex direction="column">
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
<Flex gap="1">
|
71
|
-
<Text variant="caption" css={{ color: '$on_surface_medium' }}>
|
72
|
-
{getFormattedCount(peerCount) + ' watching'}
|
70
|
+
{title ? (
|
71
|
+
<Text variant="sub2" css={{ fontWeight: '$semiBold' }}>
|
72
|
+
{title}
|
73
73
|
</Text>
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
backgroundColor: '$on_surface_medium',
|
80
|
-
borderRadius: '50%',
|
81
|
-
alignSelf: 'center',
|
82
|
-
}}
|
83
|
-
/>
|
84
|
-
<Text variant="caption" css={{ color: '$on_surface_medium' }}>
|
85
|
-
{'Started ' + getTime(liveTime) + ' ago'}
|
74
|
+
) : null}
|
75
|
+
<Flex>
|
76
|
+
<RoomDetailsRow details={details} />
|
77
|
+
<Text variant="caption" css={{ color: '$on_surface_medium' }} onClick={toggleDetailsPane}>
|
78
|
+
...more
|
86
79
|
</Text>
|
87
80
|
</Flex>
|
88
81
|
</Flex>
|
@@ -12,7 +12,8 @@ export const VideoTime = () => {
|
|
12
12
|
const timeupdateHandler = (currentTime: number) => {
|
13
13
|
const videoEl = hlsPlayer?.getVideoElement();
|
14
14
|
if (videoEl) {
|
15
|
-
|
15
|
+
const duration = isFinite(videoEl.duration) ? videoEl.duration : videoEl.seekable.end(0) || 0;
|
16
|
+
setVideoTime(getDurationFromSeconds(duration - currentTime));
|
16
17
|
} else {
|
17
18
|
setVideoTime(getDurationFromSeconds(currentTime));
|
18
19
|
}
|
@@ -25,11 +25,3 @@ export function getDurationFromSeconds(timeInSeconds: number) {
|
|
25
25
|
}
|
26
26
|
return videoTimeStr;
|
27
27
|
}
|
28
|
-
|
29
|
-
export function getTime(timeInMilles: number) {
|
30
|
-
const timeInSeconds = Math.floor(timeInMilles / 1000);
|
31
|
-
const hours = Math.floor(timeInSeconds / 3600);
|
32
|
-
const minutes = Math.floor((timeInSeconds % 3600) / 60);
|
33
|
-
const hour = hours !== 0 ? `${hours < 10 ? '0' : ''}${hours}` : '';
|
34
|
-
return hour + `${hour ? 'h:' : ''}` + minutes + 'm';
|
35
|
-
}
|
@@ -17,10 +17,12 @@ export const DesktopLeaveRoom = ({
|
|
17
17
|
leaveRoom,
|
18
18
|
screenType,
|
19
19
|
endRoom,
|
20
|
+
container,
|
20
21
|
}: {
|
21
22
|
leaveRoom: (options?: { endStream?: boolean }) => Promise<void>;
|
22
23
|
screenType: keyof ConferencingScreen;
|
23
24
|
endRoom: () => Promise<void>;
|
25
|
+
container?: HTMLElement;
|
24
26
|
}) => {
|
25
27
|
const [open, setOpen] = useState(false);
|
26
28
|
const [showLeaveRoomAlert, setShowLeaveRoomAlert] = useState(false);
|
@@ -69,54 +71,56 @@ export const DesktopLeaveRoom = ({
|
|
69
71
|
<VerticalMenuIcon />
|
70
72
|
</MenuTriggerButton>
|
71
73
|
</Dropdown.Trigger>
|
72
|
-
<Dropdown.
|
73
|
-
<Dropdown.
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
74
|
+
<Dropdown.Portal container={container}>
|
75
|
+
<Dropdown.Content css={{ p: 0, w: '$100' }} alignOffset={-50} sideOffset={10}>
|
76
|
+
<Dropdown.Item
|
77
|
+
css={{
|
78
|
+
bg: '$surface_dim',
|
79
|
+
color: '$on_surface_medium',
|
80
|
+
'&:hover': { bg: '$surface_default', color: '$on_surface_high' },
|
81
|
+
p: '0',
|
82
|
+
}}
|
83
|
+
data-testid="just_leave_btn"
|
84
|
+
>
|
85
|
+
<LeaveCard
|
86
|
+
title={showStream ? 'Leave Stream' : 'Leave Session'}
|
87
|
+
subtitle={`Others will continue after you leave. You can join the ${
|
88
|
+
showStream ? 'stream' : 'session'
|
89
|
+
} again.`}
|
90
|
+
bg=""
|
91
|
+
titleColor="$on_surface_high"
|
92
|
+
icon={<ExitIcon height={24} width={24} style={{ transform: 'rotate(180deg)' }} />}
|
93
|
+
onClick={async () => await leaveRoom()}
|
94
|
+
css={{ p: '$8 $4' }}
|
95
|
+
/>
|
96
|
+
</Dropdown.Item>
|
94
97
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
}}
|
102
|
-
data-testid="end_room_btn"
|
103
|
-
>
|
104
|
-
<LeaveCard
|
105
|
-
title={showStream ? 'End Stream' : 'End Session'}
|
106
|
-
subtitle={`The ${
|
107
|
-
showStream ? 'stream' : 'session'
|
108
|
-
} will end for everyone. You can't undo this action.`}
|
109
|
-
bg=""
|
110
|
-
titleColor="$alert_error_brighter"
|
111
|
-
icon={<StopIcon height={24} width={24} />}
|
112
|
-
onClick={() => {
|
113
|
-
setOpen(false);
|
114
|
-
setShowEndStreamAlert(true);
|
98
|
+
<Dropdown.Item
|
99
|
+
css={{
|
100
|
+
bg: '$alert_error_dim',
|
101
|
+
color: '$alert_error_bright',
|
102
|
+
'&:hover': { bg: '$alert_error_dim', color: '$alert_error_brighter' },
|
103
|
+
p: '0',
|
115
104
|
}}
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
105
|
+
data-testid="end_room_btn"
|
106
|
+
>
|
107
|
+
<LeaveCard
|
108
|
+
title={showStream ? 'End Stream' : 'End Session'}
|
109
|
+
subtitle={`The ${
|
110
|
+
showStream ? 'stream' : 'session'
|
111
|
+
} will end for everyone. You can't undo this action.`}
|
112
|
+
bg=""
|
113
|
+
titleColor="$alert_error_brighter"
|
114
|
+
icon={<StopIcon height={24} width={24} />}
|
115
|
+
onClick={() => {
|
116
|
+
setOpen(false);
|
117
|
+
setShowEndStreamAlert(true);
|
118
|
+
}}
|
119
|
+
css={{ p: '$8 $4' }}
|
120
|
+
/>
|
121
|
+
</Dropdown.Item>
|
122
|
+
</Dropdown.Content>
|
123
|
+
</Dropdown.Portal>
|
120
124
|
</Dropdown.Root>
|
121
125
|
</Flex>
|
122
126
|
) : (
|
@@ -14,13 +14,18 @@ import {
|
|
14
14
|
} from '@100mslive/react-sdk';
|
15
15
|
import { config as cssConfig } from '../../../Theme';
|
16
16
|
// @ts-ignore: No implicit Any
|
17
|
-
// @ts-ignore: No implicit Any
|
18
17
|
import { ToastManager } from '../Toast/ToastManager';
|
19
18
|
import { DesktopLeaveRoom } from './DesktopLeaveRoom';
|
20
19
|
import { MwebLeaveRoom } from './MwebLeaveRoom';
|
21
20
|
import { useLandscapeHLSStream, useMobileHLSStream } from '../../common/hooks';
|
22
21
|
|
23
|
-
export const LeaveRoom = ({
|
22
|
+
export const LeaveRoom = ({
|
23
|
+
screenType,
|
24
|
+
container,
|
25
|
+
}: {
|
26
|
+
screenType: keyof ConferencingScreen;
|
27
|
+
container?: HTMLElement;
|
28
|
+
}) => {
|
24
29
|
const isConnected = useHMSStore(selectIsConnectedToRoom);
|
25
30
|
const permissions = useHMSStore(selectPermissions);
|
26
31
|
const isMobile = useMedia(cssConfig.media.md);
|
@@ -65,11 +70,11 @@ export const LeaveRoom = ({ screenType }: { screenType: keyof ConferencingScreen
|
|
65
70
|
return null;
|
66
71
|
}
|
67
72
|
if (isMobileHLSStream || isLandscapeHLSStream) {
|
68
|
-
return <MwebLeaveRoom leaveRoom={leaveRoom} endRoom={endRoom} />;
|
73
|
+
return <MwebLeaveRoom leaveRoom={leaveRoom} endRoom={endRoom} container={container} />;
|
69
74
|
}
|
70
75
|
return isMobile ? (
|
71
|
-
<MwebLeaveRoom leaveRoom={leaveRoom} endRoom={endRoom} />
|
76
|
+
<MwebLeaveRoom leaveRoom={leaveRoom} endRoom={endRoom} container={container} />
|
72
77
|
) : (
|
73
|
-
<DesktopLeaveRoom leaveRoom={leaveRoom} screenType={screenType} endRoom={endRoom} />
|
78
|
+
<DesktopLeaveRoom leaveRoom={leaveRoom} screenType={screenType} endRoom={endRoom} container={container} />
|
74
79
|
);
|
75
80
|
};
|
@@ -19,9 +19,11 @@ import { useLandscapeHLSStream, useMobileHLSStream } from '../../common/hooks';
|
|
19
19
|
export const MwebLeaveRoom = ({
|
20
20
|
leaveRoom,
|
21
21
|
endRoom,
|
22
|
+
container,
|
22
23
|
}: {
|
23
24
|
leaveRoom: (options?: { endStream?: boolean }) => Promise<void>;
|
24
25
|
endRoom: () => Promise<void>;
|
26
|
+
container?: HTMLElement;
|
25
27
|
}) => {
|
26
28
|
const [open, setOpen] = useState(false);
|
27
29
|
const { screenType } = useRoomLayoutConferencingScreen();
|
@@ -44,9 +46,13 @@ export const MwebLeaveRoom = ({
|
|
44
46
|
{showLeaveOptions ? (
|
45
47
|
<Sheet.Root open={open} onOpenChange={setOpen}>
|
46
48
|
<Sheet.Trigger asChild>
|
47
|
-
<LeaveButton
|
49
|
+
<LeaveButton
|
50
|
+
onClick={() => {
|
51
|
+
setOpen(open => !open);
|
52
|
+
}}
|
53
|
+
/>
|
48
54
|
</Sheet.Trigger>
|
49
|
-
<Sheet.Content>
|
55
|
+
<Sheet.Content container={container}>
|
50
56
|
<LeaveCard
|
51
57
|
title={showStream ? 'Leave Stream' : 'Leave Session'}
|
52
58
|
subtitle={`Others will continue after you leave. You can join the ${
|
@@ -79,7 +85,7 @@ export const MwebLeaveRoom = ({
|
|
79
85
|
<LeaveButton onClick={() => setShowLeaveRoomAlert(true)} />
|
80
86
|
)}
|
81
87
|
<Sheet.Root open={showEndStreamAlert} onOpenChange={setShowEndStreamAlert}>
|
82
|
-
<Sheet.Content css={{ bg: '$surface_dim', p: '$10', pb: '$12' }}>
|
88
|
+
<Sheet.Content css={{ bg: '$surface_dim', p: '$10', pb: '$12' }} container={container}>
|
83
89
|
<EndSessionContent
|
84
90
|
setShowEndStreamAlert={setShowEndStreamAlert}
|
85
91
|
leaveRoom={isStreamingOn ? leaveRoom : endRoom}
|
@@ -89,7 +95,7 @@ export const MwebLeaveRoom = ({
|
|
89
95
|
</Sheet.Root>
|
90
96
|
|
91
97
|
<Sheet.Root open={showLeaveRoomAlert} onOpenChange={setShowLeaveRoomAlert}>
|
92
|
-
<Sheet.Content css={{ bg: '$surface_dim', p: '$10', pb: '$12' }}>
|
98
|
+
<Sheet.Content css={{ bg: '$surface_dim', p: '$10', pb: '$12' }} container={container}>
|
93
99
|
<LeaveSessionContent setShowLeaveRoomAlert={setShowLeaveRoomAlert} leaveRoom={leaveRoom} />
|
94
100
|
</Sheet.Content>
|
95
101
|
</Sheet.Root>
|
@@ -102,7 +108,7 @@ const LeaveButton = ({ onClick }: { onClick: () => void }) => {
|
|
102
108
|
const isLandscapeHLSStream = useLandscapeHLSStream();
|
103
109
|
|
104
110
|
return isMobileHLSStream || isLandscapeHLSStream ? (
|
105
|
-
<IconButton key="LeaveRoom" data-testid="leave_room_btn" onClick={
|
111
|
+
<IconButton key="LeaveRoom" data-testid="leave_room_btn" onClick={onClick}>
|
106
112
|
<Tooltip title="Leave Room">
|
107
113
|
<Box>
|
108
114
|
<CrossIcon />
|
@@ -117,7 +123,7 @@ const LeaveButton = ({ onClick }: { onClick: () => void }) => {
|
|
117
123
|
borderTopRightRadius: '$1',
|
118
124
|
borderBottomRightRadius: '$1',
|
119
125
|
}}
|
120
|
-
onClick={
|
126
|
+
onClick={onClick}
|
121
127
|
>
|
122
128
|
<Tooltip title="Leave Room">
|
123
129
|
<Box>
|
@@ -54,6 +54,7 @@ import { useDropdownList } from '../../hooks/useDropdownList';
|
|
54
54
|
// @ts-ignore: No implicit any
|
55
55
|
import { useMyMetadata } from '../../hooks/useMetadata';
|
56
56
|
import { useUnreadPollQuizPresent } from '../../hooks/useUnreadPollQuizPresent';
|
57
|
+
import { useLandscapeHLSStream, useMobileHLSStream } from '../../../common/hooks';
|
57
58
|
// @ts-ignore: No implicit any
|
58
59
|
import { getFormattedCount } from '../../../common/utils';
|
59
60
|
// @ts-ignore: No implicit any
|
@@ -99,6 +100,8 @@ export const MwebOptions = ({
|
|
99
100
|
const { unreadPollQuiz, setUnreadPollQuiz } = useUnreadPollQuizPresent();
|
100
101
|
const { title, description } = useRoomLayoutHeader();
|
101
102
|
const toggleDetailsSheet = useSheetToggle(SHEET_OPTIONS.ROOM_DETAILS);
|
103
|
+
const isMobileHLSStream = useMobileHLSStream();
|
104
|
+
const isLandscapeHLSStream = useLandscapeHLSStream();
|
102
105
|
|
103
106
|
useDropdownList({ open: openModals.size > 0 || openOptionsSheet || openSettingsSheet, name: 'MoreSettings' });
|
104
107
|
|
@@ -121,7 +124,7 @@ export const MwebOptions = ({
|
|
121
124
|
<Sheet.Root open={openOptionsSheet} onOpenChange={setOpenOptionsSheet}>
|
122
125
|
<Tooltip title="More options">
|
123
126
|
<Sheet.Trigger asChild data-testid="more_settings_btn">
|
124
|
-
<IconButton css={{
|
127
|
+
<IconButton css={{ bg: isMobileHLSStream || isLandscapeHLSStream ? '$surface_default' : '' }}>
|
125
128
|
<HamburgerMenuIcon />
|
126
129
|
</IconButton>
|
127
130
|
</Sheet.Trigger>
|
@@ -197,7 +200,7 @@ export const MwebOptions = ({
|
|
197
200
|
</ActionTile.Root>
|
198
201
|
) : null} */}
|
199
202
|
|
200
|
-
{elements?.emoji_reactions && (
|
203
|
+
{elements?.emoji_reactions && !(isLandscapeHLSStream || isMobileHLSStream) && (
|
201
204
|
<ActionTile.Root
|
202
205
|
onClick={() => {
|
203
206
|
setShowEmojiCard(true);
|
@@ -291,7 +294,8 @@ export const MwebOptions = ({
|
|
291
294
|
{match({ isBrowserRecordingOn, isRecordingLoading })
|
292
295
|
.with({ isBrowserRecordingOn: true, isRecordingLoading: false }, () => 'Recording On')
|
293
296
|
.with({ isRecordingLoading: true }, () => 'Starting Recording')
|
294
|
-
.with({ isRecordingLoading: false }, () => 'Start Recording')
|
297
|
+
.with({ isRecordingLoading: false }, () => 'Start Recording')
|
298
|
+
.otherwise(() => null)}
|
295
299
|
</ActionTile.Title>
|
296
300
|
</ActionTile.Root>
|
297
301
|
) : null}
|
@@ -3,6 +3,7 @@ import {
|
|
3
3
|
HMSNotificationTypes,
|
4
4
|
HMSRoomState,
|
5
5
|
selectHasPeerHandRaised,
|
6
|
+
selectPeerByID,
|
6
7
|
selectRoomState,
|
7
8
|
useHMSNotifications,
|
8
9
|
useHMSStore,
|
@@ -32,8 +33,10 @@ export const HandRaisedNotifications = () => {
|
|
32
33
|
return;
|
33
34
|
}
|
34
35
|
const hasPeerHandRaised = vanillaStore.getState(selectHasPeerHandRaised(notification.data.id));
|
36
|
+
const peer = vanillaStore.getState(selectPeerByID(notification.data.id));
|
35
37
|
if (hasPeerHandRaised) {
|
36
|
-
|
38
|
+
const showCTA = peer?.roleName && (on_stage_exp?.off_stage_roles || [])?.includes(peer.roleName);
|
39
|
+
ToastBatcher.showToast({ notification, type: showCTA ? 'RAISE_HAND_HLS' : 'RAISE_HAND' });
|
37
40
|
console.debug('Metadata updated', notification.data);
|
38
41
|
}
|
39
42
|
}, [isSubscribing, notification, on_stage_exp, roomState, vanillaStore]);
|
@@ -38,9 +38,9 @@ export const Voting = ({ id, toggleVoting }: { id: string; toggleVoting: () => v
|
|
38
38
|
<Flex
|
39
39
|
align="center"
|
40
40
|
css={{
|
41
|
-
gap: '$
|
41
|
+
gap: '$4',
|
42
42
|
py: '$6',
|
43
|
-
px: '$
|
43
|
+
px: '$8',
|
44
44
|
my: '$4',
|
45
45
|
w: '100%',
|
46
46
|
color: '$on_surface_high',
|
@@ -60,6 +60,7 @@ export const Voting = ({ id, toggleVoting }: { id: string; toggleVoting: () => v
|
|
60
60
|
marginLeft: 'auto',
|
61
61
|
cursor: 'pointer',
|
62
62
|
'&:hover': { opacity: '0.8' },
|
63
|
+
height: 'fit-content',
|
63
64
|
}}
|
64
65
|
>
|
65
66
|
<CrossIcon onClick={toggleVoting} />
|
@@ -29,7 +29,7 @@ export const OptionInputWithDelete = ({
|
|
29
29
|
key={index}
|
30
30
|
onChange={event => handleOptionTextChange(index, event.target.value)}
|
31
31
|
/>
|
32
|
-
<IconButton onClick={() => removeOption(index)} css={{ bg: '
|
32
|
+
<IconButton onClick={() => removeOption(index)} css={{ bg: 'transparent', border: 'none' }}>
|
33
33
|
<TrashIcon />
|
34
34
|
</IconButton>
|
35
35
|
</>
|
@@ -4,7 +4,7 @@ export const getFormattedTime = (milliseconds: number | undefined, precise = tru
|
|
4
4
|
const totalSeconds = milliseconds / 1000;
|
5
5
|
const hours = Math.floor(totalSeconds / 3600);
|
6
6
|
const minutes = Math.floor((totalSeconds % 3600) / 60);
|
7
|
-
const seconds =
|
7
|
+
const seconds = totalSeconds % 60;
|
8
8
|
|
9
9
|
let formattedTime = '';
|
10
10
|
if (hours) {
|
@@ -16,7 +16,7 @@ export const getFormattedTime = (milliseconds: number | undefined, precise = tru
|
|
16
16
|
if (!precise && (hours || minutes)) {
|
17
17
|
return formattedTime;
|
18
18
|
}
|
19
|
-
formattedTime += `${seconds}s`;
|
19
|
+
formattedTime += `${minutes >= 1 ? Math.floor(seconds) : seconds.toFixed(3)}s`;
|
20
20
|
|
21
21
|
return formattedTime;
|
22
22
|
};
|
@@ -1,16 +1,22 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { HandIcon, HandRaiseSlashedIcon } from '@100mslive/react-icons';
|
3
|
+
import { CSS } from '../../Theme';
|
3
4
|
import { Tooltip } from '../../Tooltip';
|
4
5
|
// @ts-ignore: No implicit Any
|
5
6
|
import IconButton from '../IconButton';
|
6
7
|
// @ts-ignore: No implicit Any
|
7
8
|
import { useMyMetadata } from './hooks/useMetadata';
|
8
9
|
|
9
|
-
export const RaiseHand = () => {
|
10
|
+
export const RaiseHand = ({ css }: { css?: CSS }) => {
|
10
11
|
const { isHandRaised, toggleHandRaise } = useMyMetadata();
|
11
12
|
return (
|
12
13
|
<Tooltip title={isHandRaised ? 'Lower hand' : 'Raise hand'}>
|
13
|
-
<IconButton
|
14
|
+
<IconButton
|
15
|
+
data-testid="hand_raise_btn"
|
16
|
+
css={css}
|
17
|
+
active={!isHandRaised}
|
18
|
+
onClick={async () => await toggleHandRaise()}
|
19
|
+
>
|
14
20
|
{isHandRaised ? <HandRaiseSlashedIcon /> : <HandIcon />}
|
15
21
|
</IconButton>
|
16
22
|
</Tooltip>
|
@@ -2,31 +2,32 @@ import React from 'react';
|
|
2
2
|
import { CrossIcon } from '@100mslive/react-icons';
|
3
3
|
import { Box, Flex } from '../../../Layout';
|
4
4
|
import { Text } from '../../../Text';
|
5
|
+
// @ts-ignore: No implicit any
|
6
|
+
import { Logo } from '../Header/HeaderComponents';
|
5
7
|
import { RoomDetailsRow } from './RoomDetailsRow';
|
6
8
|
import { useRoomLayoutHeader } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
|
7
9
|
// @ts-ignore
|
8
10
|
import { useSidepaneToggle } from '../AppData/useSidepane';
|
11
|
+
import { useMobileHLSStream } from '../../common/hooks';
|
9
12
|
import { SIDE_PANE_OPTIONS } from '../../common/constants';
|
10
13
|
|
11
14
|
export const RoomDetailsPane = () => {
|
12
|
-
const {
|
13
|
-
const
|
15
|
+
const { description } = useRoomLayoutHeader();
|
16
|
+
const isMwebHLSStream = useMobileHLSStream();
|
14
17
|
return (
|
15
18
|
<Box css={{ flex: '1 1 0' }}>
|
16
|
-
|
17
|
-
<
|
18
|
-
|
19
|
-
|
20
|
-
css={{ color: '$on_surface_high', cursor: 'pointer', '&:hover': { opacity: '0.8' } }}
|
21
|
-
>
|
22
|
-
<CrossIcon />
|
19
|
+
{isMwebHLSStream ? (
|
20
|
+
<Flex direction="row" align="center" gap="2">
|
21
|
+
<Logo />
|
22
|
+
<ShowRoomDetailHeader />
|
23
23
|
</Flex>
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
) : (
|
25
|
+
<ShowRoomDetailHeader />
|
26
|
+
)}
|
28
27
|
<Box css={{ mt: '$10' }}>
|
29
|
-
<Text css={{ color: '$on_surface_high', fontWeight: '$semiBold' }}>
|
28
|
+
<Text css={{ color: '$on_surface_high', fontWeight: '$semiBold', display: isMwebHLSStream ? 'none' : '' }}>
|
29
|
+
Description
|
30
|
+
</Text>
|
30
31
|
<Text variant="sm" css={{ c: '$on_surface_medium' }}>
|
31
32
|
{description}
|
32
33
|
</Text>
|
@@ -34,3 +35,29 @@ export const RoomDetailsPane = () => {
|
|
34
35
|
</Box>
|
35
36
|
);
|
36
37
|
};
|
38
|
+
|
39
|
+
const ShowRoomDetailHeader = () => {
|
40
|
+
const { title, details } = useRoomLayoutHeader();
|
41
|
+
const toggleDetailsPane = useSidepaneToggle(SIDE_PANE_OPTIONS.ROOM_DETAILS);
|
42
|
+
const isMwebHLSStream = useMobileHLSStream();
|
43
|
+
return (
|
44
|
+
<Flex direction="column">
|
45
|
+
<Flex justify="between" align="center" css={{ w: '100%' }}>
|
46
|
+
<Text variant="h6">{title}</Text>
|
47
|
+
{!isMwebHLSStream && (
|
48
|
+
<Flex
|
49
|
+
onClick={toggleDetailsPane}
|
50
|
+
css={{
|
51
|
+
color: '$on_surface_high',
|
52
|
+
cursor: 'pointer',
|
53
|
+
'&:hover': { opacity: '0.8' },
|
54
|
+
}}
|
55
|
+
>
|
56
|
+
<CrossIcon />
|
57
|
+
</Flex>
|
58
|
+
)}
|
59
|
+
</Flex>
|
60
|
+
<RoomDetailsRow details={details} />
|
61
|
+
</Flex>
|
62
|
+
);
|
63
|
+
};
|
@@ -61,7 +61,7 @@ export function ShareScreenOptions() {
|
|
61
61
|
pt: '$10',
|
62
62
|
pb: '$6',
|
63
63
|
'&:hover': {
|
64
|
-
bg: '
|
64
|
+
bg: 'transparent',
|
65
65
|
cursor: 'default',
|
66
66
|
},
|
67
67
|
}}
|
@@ -78,7 +78,7 @@ export function ShareScreenOptions() {
|
|
78
78
|
pt: '$6',
|
79
79
|
pb: '$10',
|
80
80
|
'&:hover': {
|
81
|
-
bg: '
|
81
|
+
bg: 'transparent',
|
82
82
|
cursor: 'default',
|
83
83
|
},
|
84
84
|
}}
|