@100mslive/roomkit-react 0.3.3-alpha.4 → 0.3.3-alpha.6
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Accordion/Accordion.d.ts +1 -0
- package/dist/Accordion/index.d.ts +1 -0
- package/dist/{HLSView-VUANLYLS.js → HLSView-XI2Q44RQ.js} +331 -166
- package/dist/HLSView-XI2Q44RQ.js.map +7 -0
- package/dist/IconButton/IconButton.d.ts +1 -1
- package/dist/Modal/Dialog.d.ts +1 -1
- package/dist/Prebuilt/IconButton.d.ts +2 -3
- package/dist/Prebuilt/components/Footer/ChatToggle.d.ts +3 -1
- package/dist/Prebuilt/components/HMSVideo/PlayPauseButton.d.ts +2 -2
- package/dist/Prebuilt/components/HMSVideo/PlayPauseSeekControls.d.ts +14 -0
- package/dist/Prebuilt/components/HMSVideo/{SeekControls.d.ts → SeekControl.d.ts} +2 -2
- package/dist/Prebuilt/components/HMSVideo/index.d.ts +15 -11
- package/dist/Prebuilt/components/Leave/LeaveAtoms.d.ts +2 -2
- package/dist/Prebuilt/components/RaiseHand.d.ts +1 -1
- package/dist/Prebuilt/components/VideoLayouts/WhiteboardLayout.d.ts +3 -0
- package/dist/Prebuilt/components/hooks/useMetadata.d.ts +8 -0
- package/dist/Sheet/Sheet.d.ts +1 -1
- package/dist/{chunk-5WTUTVRO.js → chunk-3JLNG275.js} +620 -542
- package/dist/chunk-3JLNG275.js.map +7 -0
- package/dist/index.cjs.js +1688 -1427
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.js +1 -1
- package/dist/meta.cjs.json +249 -170
- package/dist/meta.esbuild.json +261 -181
- package/package.json +7 -7
- package/src/Accordion/Accordion.tsx +4 -4
- package/src/IconButton/IconButton.tsx +2 -7
- package/src/Prebuilt/IconButton.tsx +6 -10
- package/src/Prebuilt/components/Chat/ChatBody.tsx +10 -0
- package/src/Prebuilt/components/Chat/ChatFooter.tsx +2 -4
- package/src/Prebuilt/components/ConferenceScreen.tsx +1 -4
- package/src/Prebuilt/components/Footer/ChatToggle.tsx +2 -2
- package/src/Prebuilt/components/Footer/Footer.tsx +1 -4
- package/src/Prebuilt/components/Footer/ParticipantList.tsx +4 -1
- package/src/Prebuilt/components/Footer/RoleAccordion.tsx +6 -6
- package/src/Prebuilt/components/Footer/WhiteboardToggle.tsx +17 -3
- package/src/Prebuilt/components/HMSVideo/HMSVideo.jsx +1 -0
- package/src/Prebuilt/components/HMSVideo/PlayPauseButton.tsx +2 -2
- package/src/Prebuilt/components/HMSVideo/PlayPauseSeekControls.tsx +158 -0
- package/src/Prebuilt/components/HMSVideo/{SeekControls.tsx → SeekControl.tsx} +2 -2
- package/src/Prebuilt/components/HMSVideo/VideoProgress.tsx +7 -3
- package/src/Prebuilt/components/HMSVideo/index.ts +5 -4
- package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.tsx +7 -7
- package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.tsx +0 -1
- package/src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.tsx +1 -5
- package/src/Prebuilt/components/PreviousRoleInMetadata.tsx +0 -1
- package/src/Prebuilt/components/RaiseHand.tsx +7 -1
- package/src/Prebuilt/components/RoleChangeRequest/RoleChangeRequestModal.tsx +0 -1
- package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +27 -4
- package/src/Prebuilt/components/VideoLayouts/WhiteboardLayout.tsx +95 -0
- package/src/Prebuilt/components/hooks/useCloseScreenshareWhiteboard.tsx +13 -5
- package/src/Prebuilt/components/hooks/{useMetadata.jsx → useMetadata.tsx} +2 -8
- package/src/Prebuilt/layouts/HLSView.jsx +115 -78
- package/src/Prebuilt/layouts/VideoStreamingSection.tsx +1 -17
- package/dist/HLSView-VUANLYLS.js.map +0 -7
- package/dist/Prebuilt/layouts/WhiteboardView.d.ts +0 -2
- package/dist/chunk-5WTUTVRO.js.map +0 -7
- package/src/Prebuilt/layouts/WhiteboardView.tsx +0 -69
package/package.json
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
"prebuilt",
|
11
11
|
"roomkit"
|
12
12
|
],
|
13
|
-
"version": "0.3.3-alpha.
|
13
|
+
"version": "0.3.3-alpha.6",
|
14
14
|
"author": "100ms",
|
15
15
|
"license": "MIT",
|
16
16
|
"repository": {
|
@@ -82,12 +82,12 @@
|
|
82
82
|
"react": ">=17.0.2 <19.0.0"
|
83
83
|
},
|
84
84
|
"dependencies": {
|
85
|
-
"@100mslive/hls-player": "0.3.3-alpha.
|
85
|
+
"@100mslive/hls-player": "0.3.3-alpha.6",
|
86
86
|
"@100mslive/hms-noise-cancellation": "0.0.0-alpha.1",
|
87
|
-
"@100mslive/hms-virtual-background": "1.13.3-alpha.
|
88
|
-
"@100mslive/react-icons": "0.10.3-alpha.
|
89
|
-
"@100mslive/react-sdk": "0.10.3-alpha.
|
90
|
-
"@100mslive/types-prebuilt": "0.12.
|
87
|
+
"@100mslive/hms-virtual-background": "1.13.3-alpha.6",
|
88
|
+
"@100mslive/react-icons": "0.10.3-alpha.6",
|
89
|
+
"@100mslive/react-sdk": "0.10.3-alpha.6",
|
90
|
+
"@100mslive/types-prebuilt": "0.12.8",
|
91
91
|
"@emoji-mart/data": "^1.0.6",
|
92
92
|
"@emoji-mart/react": "^1.0.1",
|
93
93
|
"@radix-ui/react-accordion": "1.0.0",
|
@@ -122,5 +122,5 @@
|
|
122
122
|
"uuid": "^8.3.2",
|
123
123
|
"worker-timers": "^7.0.40"
|
124
124
|
},
|
125
|
-
"gitHead": "
|
125
|
+
"gitHead": "b096cea8bf439c4d3e99d27b4d758d87f54c9512"
|
126
126
|
}
|
@@ -64,15 +64,15 @@ export const AccordionRoot = StyledAccordion;
|
|
64
64
|
export const AccordionItem = StyledItem;
|
65
65
|
|
66
66
|
export const AccordionHeader: React.FC<
|
67
|
-
PropsWithChildren<BaseAccordion.AccordionTriggerProps & { iconStyles?: CSS; css?: CSS }>
|
67
|
+
PropsWithChildren<BaseAccordion.AccordionTriggerProps & { iconStyles?: CSS; css?: CSS; chevronID?: string }>
|
68
68
|
> = React.forwardRef<
|
69
69
|
HTMLButtonElement,
|
70
|
-
PropsWithChildren<BaseAccordion.AccordionTriggerProps & { iconStyles?: CSS; css?: CSS }>
|
71
|
-
>(({ children, iconStyles, css, ...props }, forwardedRef) => (
|
70
|
+
PropsWithChildren<BaseAccordion.AccordionTriggerProps & { iconStyles?: CSS; css?: CSS; chevronID?: string }>
|
71
|
+
>(({ children, iconStyles, css, chevronID, ...props }, forwardedRef) => (
|
72
72
|
<StyledHeader css={css}>
|
73
73
|
<StyledTrigger {...props} ref={forwardedRef}>
|
74
74
|
{children}
|
75
|
-
<StyledChevron aria-hidden css={iconStyles} />
|
75
|
+
<StyledChevron data-testid={chevronID} aria-hidden css={iconStyles} />
|
76
76
|
</StyledTrigger>
|
77
77
|
</StyledHeader>
|
78
78
|
));
|
@@ -25,19 +25,14 @@ export const IconButton = styled('button', {
|
|
25
25
|
'&[disabled]': {
|
26
26
|
opacity: 0.5,
|
27
27
|
cursor: 'not-allowed',
|
28
|
+
backgroundColor: '$secondary_dim',
|
29
|
+
color: '$on_primary_high',
|
28
30
|
},
|
29
31
|
'&:focus': {
|
30
32
|
outline: 'none',
|
31
33
|
},
|
32
34
|
variants: {
|
33
35
|
active: {
|
34
|
-
false: {
|
35
|
-
backgroundColor: '$secondary_dim',
|
36
|
-
color: '$on_primary_high',
|
37
|
-
'&:not([disabled]):hover': {
|
38
|
-
backgroundColor: '$secondary_default',
|
39
|
-
},
|
40
|
-
},
|
41
36
|
true: {
|
42
37
|
'&:not([disabled]):hover': {
|
43
38
|
backgroundColor: '$on_surface_low',
|
@@ -7,22 +7,18 @@ const IconButton = styled(BaseIconButton, {
|
|
7
7
|
border: '1px solid $border_bright',
|
8
8
|
bg: '$background_dim',
|
9
9
|
r: '$1',
|
10
|
+
'&[disabled]': {
|
11
|
+
opacity: 0.5,
|
12
|
+
cursor: 'not-allowed',
|
13
|
+
backgroundColor: '$secondary_dim',
|
14
|
+
color: '$on_primary_high',
|
15
|
+
},
|
10
16
|
variants: {
|
11
17
|
active: {
|
12
18
|
true: {
|
13
19
|
color: '$on_surface_high',
|
14
20
|
backgroundColor: 'transparent',
|
15
21
|
},
|
16
|
-
false: {
|
17
|
-
border: '1px solid transparent',
|
18
|
-
color: '$on_primary_high',
|
19
|
-
},
|
20
|
-
},
|
21
|
-
disabled: {
|
22
|
-
true: {
|
23
|
-
backgroundColor: '$surface_brighter',
|
24
|
-
color: '$on_surface_low',
|
25
|
-
},
|
26
22
|
},
|
27
23
|
},
|
28
24
|
});
|
@@ -410,6 +410,7 @@ export const ChatBody = React.forwardRef<VariableSizeList, { scrollToBottom: (co
|
|
410
410
|
}, [blacklistedMessageIDs, messages]);
|
411
411
|
|
412
412
|
const vanillaStore = useHMSVanillaStore();
|
413
|
+
const rerenderOnFirstMount = useRef(false);
|
413
414
|
|
414
415
|
useEffect(() => {
|
415
416
|
const unsubscribe = vanillaStore.subscribe(() => {
|
@@ -426,6 +427,15 @@ export const ChatBody = React.forwardRef<VariableSizeList, { scrollToBottom: (co
|
|
426
427
|
return unsubscribe;
|
427
428
|
}, [vanillaStore, listRef, scrollToBottom]);
|
428
429
|
|
430
|
+
useEffect(() => {
|
431
|
+
// @ts-ignore
|
432
|
+
if (filteredMessages.length > 0 && listRef?.current && !rerenderOnFirstMount.current) {
|
433
|
+
rerenderOnFirstMount.current = true;
|
434
|
+
// @ts-ignore
|
435
|
+
listRef.current.resetAfterIndex(0);
|
436
|
+
}
|
437
|
+
}, [listRef, filteredMessages]);
|
438
|
+
|
429
439
|
return filteredMessages.length === 0 ? (
|
430
440
|
<EmptyChat />
|
431
441
|
) : (
|
@@ -2,7 +2,7 @@ import React, { ReactNode, useCallback, useEffect, useRef, useState } from 'reac
|
|
2
2
|
import { useMedia } from 'react-use';
|
3
3
|
import data from '@emoji-mart/data';
|
4
4
|
import Picker from '@emoji-mart/react';
|
5
|
-
import { HMSException, selectLocalPeer,
|
5
|
+
import { HMSException, selectLocalPeer, useHMSActions, useHMSStore } from '@100mslive/react-sdk';
|
6
6
|
import { EmojiIcon, PauseCircleIcon, SendIcon, VerticalMenuIcon } from '@100mslive/react-icons';
|
7
7
|
import { Box, config as cssConfig, Flex, IconButton as BaseIconButton, Popover, styled, Text } from '../../..';
|
8
8
|
import { IconButton } from '../../../IconButton';
|
@@ -89,8 +89,6 @@ export const ChatFooter = ({ onSend, children }: { onSend: (count: number) => vo
|
|
89
89
|
const defaultSelection = useDefaultChatSelection();
|
90
90
|
const selection = selectedPeer.name || selectedRole || defaultSelection;
|
91
91
|
const isLocalPeerBlacklisted = useIsPeerBlacklisted({ local: true });
|
92
|
-
const { toggleAudio, toggleVideo } = useAVToggle();
|
93
|
-
const noAVPermissions = !(toggleAudio || toggleVideo);
|
94
92
|
const isMwebHLSStream = useMobileHLSStream();
|
95
93
|
const isLandscapeHLSStream = useLandscapeHLSStream();
|
96
94
|
|
@@ -275,7 +273,7 @@ export const ChatFooter = ({ onSend, children }: { onSend: (count: number) => vo
|
|
275
273
|
}}
|
276
274
|
gap="2"
|
277
275
|
>
|
278
|
-
|
276
|
+
<RaiseHand css={{ bg: '$surface_default' }} />
|
279
277
|
<MoreSettings elements={elements} screenType={screenType} />
|
280
278
|
</Flex>
|
281
279
|
</>
|
@@ -6,7 +6,6 @@ import {
|
|
6
6
|
selectAppData,
|
7
7
|
selectIsConnectedToRoom,
|
8
8
|
selectRoomState,
|
9
|
-
useAVToggle,
|
10
9
|
useHMSActions,
|
11
10
|
useHMSStore,
|
12
11
|
} from '@100mslive/react-sdk';
|
@@ -54,8 +53,6 @@ export const ConferenceScreen = () => {
|
|
54
53
|
const dropdownListRef = useRef<string[]>();
|
55
54
|
const [isHLSStarted] = useSetAppDataByKey(APP_DATA.hlsStarted);
|
56
55
|
|
57
|
-
const { toggleAudio, toggleVideo } = useAVToggle();
|
58
|
-
const noAVPermissions = !(toggleAudio || toggleVideo);
|
59
56
|
// using it in hls stream to show action button when chat is disabled
|
60
57
|
const showChat = !!screenProps.elements?.chat;
|
61
58
|
const autoRoomJoined = useRef(isPreviewScreenEnabled);
|
@@ -202,7 +199,7 @@ export const ConferenceScreen = () => {
|
|
202
199
|
justify="end"
|
203
200
|
gap="2"
|
204
201
|
>
|
205
|
-
|
202
|
+
<RaiseHand />
|
206
203
|
<MoreSettings elements={screenProps.elements} screenType={screenProps.screenType} />
|
207
204
|
<Box
|
208
205
|
css={{
|
@@ -9,7 +9,7 @@ import { useIsSidepaneTypeOpen, useSidepaneToggle } from '../AppData/useSidepane
|
|
9
9
|
// @ts-ignore: No implicit Any
|
10
10
|
import { SIDE_PANE_OPTIONS } from '../../common/constants';
|
11
11
|
|
12
|
-
export const ChatToggle = () => {
|
12
|
+
export const ChatToggle = ({ onClick }: { onClick?: () => void }) => {
|
13
13
|
const countUnreadMessages = useHMSStore(selectUnreadHMSMessagesCount);
|
14
14
|
const isChatOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.CHAT);
|
15
15
|
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
@@ -21,7 +21,7 @@ export const ChatToggle = () => {
|
|
21
21
|
}}
|
22
22
|
>
|
23
23
|
<Tooltip key="chat" title={`${isChatOpen ? 'Close' : 'Open'} chat`}>
|
24
|
-
<IconButton onClick={toggleChat} active={!isChatOpen} data-testid="chat_btn">
|
24
|
+
<IconButton onClick={() => (onClick ? onClick() : toggleChat())} active={!isChatOpen} data-testid="chat_btn">
|
25
25
|
<ChatIcon />
|
26
26
|
</IconButton>
|
27
27
|
</Tooltip>
|
@@ -2,7 +2,6 @@ import React, { useEffect } from 'react';
|
|
2
2
|
import { useMedia } from 'react-use';
|
3
3
|
import { ConferencingScreen } from '@100mslive/types-prebuilt';
|
4
4
|
import { Chat_ChatState } from '@100mslive/types-prebuilt/elements/chat';
|
5
|
-
import { useAVToggle } from '@100mslive/react-sdk';
|
6
5
|
import { config as cssConfig, Footer as AppFooter } from '../../..';
|
7
6
|
// @ts-ignore: No implicit Any
|
8
7
|
import { AudioVideoToggle } from '../AudioVideoToggle';
|
@@ -41,8 +40,6 @@ export const Footer = ({
|
|
41
40
|
const isOverlayChat = !!elements?.chat?.is_overlay;
|
42
41
|
const openByDefault = elements?.chat?.initial_state === Chat_ChatState.CHAT_STATE_OPEN;
|
43
42
|
|
44
|
-
const { toggleAudio, toggleVideo } = useAVToggle();
|
45
|
-
const noAVPermissions = !(toggleAudio || toggleVideo);
|
46
43
|
const isChatOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.CHAT);
|
47
44
|
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
48
45
|
const { showPolls } = useShowPolls();
|
@@ -90,7 +87,7 @@ export const Footer = ({
|
|
90
87
|
>
|
91
88
|
{isMobile ? (
|
92
89
|
<>
|
93
|
-
|
90
|
+
<RaiseHand />
|
94
91
|
{elements?.chat && <ChatToggle />}
|
95
92
|
<MoreSettings elements={elements} screenType={screenType} />
|
96
93
|
</>
|
@@ -324,12 +324,15 @@ const HandRaisedAccordionParticipantActions = ({ peerId, role }: { peerId: strin
|
|
324
324
|
peerId,
|
325
325
|
role,
|
326
326
|
});
|
327
|
+
if (!shouldShowStageRoleChange) {
|
328
|
+
return null;
|
329
|
+
}
|
327
330
|
return (
|
328
331
|
<>
|
329
332
|
<Button variant="standard" css={quickActionStyle} onClick={lowerPeerHand}>
|
330
333
|
<CrossIcon height={18} width={18} />
|
331
334
|
</Button>
|
332
|
-
{
|
335
|
+
{!isInStage && (
|
333
336
|
<Button variant="primary" onClick={handleStageAction} css={quickActionStyle}>
|
334
337
|
<AddIcon height={18} width={18} />
|
335
338
|
</Button>
|
@@ -93,6 +93,7 @@ export const RoleAccordion = ({
|
|
93
93
|
return (
|
94
94
|
<Accordion.Item value={roleName} css={{ '&:hover .role_actions': { visibility: 'visible' }, mb: '$8' }} ref={ref}>
|
95
95
|
<Accordion.Header
|
96
|
+
chevronID={`role_accordion_btn_${roleName}`}
|
96
97
|
iconStyles={{ c: '$on_surface_high' }}
|
97
98
|
css={{
|
98
99
|
textTransform: 'capitalize',
|
@@ -148,18 +149,17 @@ export const RoleAccordion = ({
|
|
148
149
|
<ChevronRightIcon />
|
149
150
|
</Flex>
|
150
151
|
) : null}
|
151
|
-
{isHandRaisedAccordion && (
|
152
|
+
{isHandRaisedAccordion && canBringToStage && (
|
152
153
|
<>
|
153
154
|
<HorizontalDivider />
|
154
155
|
<Flex css={{ w: '100%', p: '$6', gap: '$4' }} justify="center">
|
155
156
|
<Button variant="standard" onClick={lowerAllHands} icon css={{ pl: '$2' }}>
|
156
157
|
<CrossIcon /> Lower all hands
|
157
158
|
</Button>
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
)}
|
159
|
+
|
160
|
+
<Button onClick={bringAllToStage} icon css={{ pl: '$2' }}>
|
161
|
+
<AddIcon /> {bring_to_stage_label}
|
162
|
+
</Button>
|
163
163
|
</Flex>
|
164
164
|
</>
|
165
165
|
)}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import { useWhiteboard } from '@100mslive/react-sdk';
|
2
|
+
import { useScreenShare, useWhiteboard } from '@100mslive/react-sdk';
|
3
3
|
import { PencilDrawIcon } from '@100mslive/react-icons';
|
4
4
|
import { Tooltip } from '../../..';
|
5
5
|
// @ts-ignore: No implicit Any
|
@@ -9,14 +9,28 @@ import { ToastManager } from '../Toast/ToastManager';
|
|
9
9
|
|
10
10
|
export const WhiteboardToggle = () => {
|
11
11
|
const { toggle, open, isOwner } = useWhiteboard();
|
12
|
+
const { screenSharingPeerId, amIScreenSharing } = useScreenShare();
|
13
|
+
const remoteScreenShare = screenSharingPeerId && !amIScreenSharing;
|
14
|
+
const disabled = remoteScreenShare || (open && !isOwner);
|
15
|
+
|
12
16
|
if (!toggle) {
|
13
17
|
return null;
|
14
18
|
}
|
15
19
|
|
16
20
|
return (
|
17
|
-
<Tooltip
|
21
|
+
<Tooltip
|
22
|
+
key="whiteboard"
|
23
|
+
title={
|
24
|
+
remoteScreenShare
|
25
|
+
? 'Cannot open whiteboard when viewing a shared screen'
|
26
|
+
: `${open ? 'Close' : 'Open'} Whiteboard`
|
27
|
+
}
|
28
|
+
>
|
18
29
|
<IconButton
|
19
30
|
onClick={async () => {
|
31
|
+
if (disabled) {
|
32
|
+
return;
|
33
|
+
}
|
20
34
|
try {
|
21
35
|
await toggle();
|
22
36
|
} catch (error) {
|
@@ -24,7 +38,7 @@ export const WhiteboardToggle = () => {
|
|
24
38
|
}
|
25
39
|
}}
|
26
40
|
active={!open}
|
27
|
-
disabled={
|
41
|
+
disabled={disabled}
|
28
42
|
data-testid="whiteboard_btn"
|
29
43
|
>
|
30
44
|
<PencilDrawIcon />
|
@@ -9,8 +9,8 @@ export const PlayPauseButton = ({
|
|
9
9
|
height = 20,
|
10
10
|
}: {
|
11
11
|
isPaused: boolean;
|
12
|
-
width
|
13
|
-
height
|
12
|
+
width?: number;
|
13
|
+
height?: number;
|
14
14
|
}) => {
|
15
15
|
const { hlsPlayer } = useHMSPlayerContext();
|
16
16
|
const onClick = async (event: MouseEvent) => {
|
@@ -0,0 +1,158 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { useMedia } from 'react-use';
|
3
|
+
import { BackwardArrowIcon, ForwardArrowIcon } from '@100mslive/react-icons';
|
4
|
+
import { Box, Flex } from '../../../Layout';
|
5
|
+
import { Text } from '../../../Text';
|
6
|
+
import { config } from '../../../Theme';
|
7
|
+
import { PlayPauseButton } from './PlayPauseButton';
|
8
|
+
import { SeekControl } from './SeekControl';
|
9
|
+
import { useIsLandscape } from '../../common/hooks';
|
10
|
+
|
11
|
+
// desktop buttons
|
12
|
+
export const PlayPauseSeekControls = ({
|
13
|
+
isPaused,
|
14
|
+
onSeekTo,
|
15
|
+
}: {
|
16
|
+
isPaused: boolean;
|
17
|
+
onSeekTo: (value: number) => void;
|
18
|
+
}) => {
|
19
|
+
return (
|
20
|
+
<>
|
21
|
+
<SeekControl
|
22
|
+
onClick={e => {
|
23
|
+
e.stopPropagation();
|
24
|
+
onSeekTo(-10);
|
25
|
+
}}
|
26
|
+
title="backward"
|
27
|
+
>
|
28
|
+
<BackwardArrowIcon width={20} height={20} />
|
29
|
+
</SeekControl>
|
30
|
+
<PlayPauseButton isPaused={isPaused} />
|
31
|
+
<SeekControl
|
32
|
+
onClick={e => {
|
33
|
+
e.stopPropagation();
|
34
|
+
onSeekTo(10);
|
35
|
+
}}
|
36
|
+
title="forward"
|
37
|
+
>
|
38
|
+
<ForwardArrowIcon width={20} height={20} />
|
39
|
+
</SeekControl>
|
40
|
+
</>
|
41
|
+
);
|
42
|
+
};
|
43
|
+
|
44
|
+
// overlay handlers
|
45
|
+
export const PlayPauseSeekOverlayControls = ({
|
46
|
+
isPaused,
|
47
|
+
showControls,
|
48
|
+
hoverControlsVisible,
|
49
|
+
}: {
|
50
|
+
isPaused: boolean;
|
51
|
+
showControls: boolean;
|
52
|
+
hoverControlsVisible: {
|
53
|
+
seekBackward: boolean;
|
54
|
+
seekForward: boolean;
|
55
|
+
pausePlay: boolean;
|
56
|
+
};
|
57
|
+
}) => {
|
58
|
+
const isMobile = useMedia(config.media.md);
|
59
|
+
const isLandscape = useIsLandscape();
|
60
|
+
|
61
|
+
if (!isMobile && !isLandscape) {
|
62
|
+
// show desktopOverflow icons
|
63
|
+
return (
|
64
|
+
<>
|
65
|
+
<Flex
|
66
|
+
css={{
|
67
|
+
bg: 'rgba(0, 0, 0, 0.6)',
|
68
|
+
r: '$round',
|
69
|
+
size: '$24',
|
70
|
+
visibility: hoverControlsVisible.seekBackward ? `` : `hidden`,
|
71
|
+
opacity: hoverControlsVisible.seekBackward ? `1` : '0',
|
72
|
+
}}
|
73
|
+
direction="column"
|
74
|
+
align="center"
|
75
|
+
>
|
76
|
+
<SeekControl title="backward">
|
77
|
+
<BackwardArrowIcon width={52} height={52} />
|
78
|
+
</SeekControl>
|
79
|
+
<Text variant="body2" css={{ fontWeight: '$regular' }}>
|
80
|
+
10 secs
|
81
|
+
</Text>
|
82
|
+
</Flex>
|
83
|
+
<Box
|
84
|
+
css={{
|
85
|
+
bg: 'rgba(0, 0, 0, 0.6)',
|
86
|
+
r: '$round',
|
87
|
+
visibility: hoverControlsVisible.pausePlay ? `` : `hidden`,
|
88
|
+
opacity: hoverControlsVisible.pausePlay ? `1` : '0',
|
89
|
+
}}
|
90
|
+
>
|
91
|
+
<PlayPauseButton isPaused={isPaused} width={48} height={48} />
|
92
|
+
</Box>
|
93
|
+
<Flex
|
94
|
+
css={{
|
95
|
+
bg: 'rgba(0, 0, 0, 0.6)',
|
96
|
+
r: '$round',
|
97
|
+
size: '$24',
|
98
|
+
visibility: hoverControlsVisible.seekForward ? `` : `hidden`,
|
99
|
+
opacity: hoverControlsVisible.seekForward ? `1` : '0',
|
100
|
+
}}
|
101
|
+
direction="column"
|
102
|
+
align="center"
|
103
|
+
>
|
104
|
+
<SeekControl title="forward">
|
105
|
+
<ForwardArrowIcon width={52} height={52} />
|
106
|
+
</SeekControl>
|
107
|
+
<Text variant="body2" css={{ fontWeight: '$regular' }}>
|
108
|
+
10 secs
|
109
|
+
</Text>
|
110
|
+
</Flex>
|
111
|
+
</>
|
112
|
+
);
|
113
|
+
}
|
114
|
+
|
115
|
+
return (
|
116
|
+
<Flex
|
117
|
+
align="center"
|
118
|
+
justify="center"
|
119
|
+
css={{
|
120
|
+
position: 'absolute',
|
121
|
+
bg: '#00000066',
|
122
|
+
display: 'inline-flex',
|
123
|
+
gap: '$2',
|
124
|
+
zIndex: 1,
|
125
|
+
size: '100%',
|
126
|
+
visibility: showControls ? `` : `hidden`,
|
127
|
+
opacity: showControls ? `1` : '0',
|
128
|
+
}}
|
129
|
+
>
|
130
|
+
<SeekControl
|
131
|
+
title="backward"
|
132
|
+
css={{
|
133
|
+
visibility: hoverControlsVisible.seekBackward ? `` : `hidden`,
|
134
|
+
opacity: hoverControlsVisible.seekBackward ? `1` : '0',
|
135
|
+
}}
|
136
|
+
>
|
137
|
+
<BackwardArrowIcon width={32} height={32} />
|
138
|
+
</SeekControl>
|
139
|
+
<Box
|
140
|
+
css={{
|
141
|
+
bg: 'rgba(0, 0, 0, 0.6)',
|
142
|
+
r: '$round',
|
143
|
+
}}
|
144
|
+
>
|
145
|
+
<PlayPauseButton isPaused={isPaused} width={48} height={48} />
|
146
|
+
</Box>
|
147
|
+
<SeekControl
|
148
|
+
title="forward"
|
149
|
+
css={{
|
150
|
+
visibility: hoverControlsVisible.seekForward ? `` : `hidden`,
|
151
|
+
opacity: hoverControlsVisible.seekForward ? `1` : '0',
|
152
|
+
}}
|
153
|
+
>
|
154
|
+
<ForwardArrowIcon width={32} height={32} />
|
155
|
+
</SeekControl>
|
156
|
+
</Flex>
|
157
|
+
);
|
158
|
+
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { MouseEventHandler } from 'react';
|
2
2
|
import { IconButton, Tooltip } from '../../..';
|
3
3
|
|
4
|
-
export const
|
4
|
+
export const SeekControl = ({
|
5
5
|
title,
|
6
6
|
onClick,
|
7
7
|
children,
|
@@ -9,7 +9,7 @@ export const SeekControls = ({
|
|
9
9
|
}: {
|
10
10
|
title: string;
|
11
11
|
onClick?: MouseEventHandler<HTMLButtonElement>;
|
12
|
-
css
|
12
|
+
css?: any;
|
13
13
|
children: React.ReactNode;
|
14
14
|
}) => {
|
15
15
|
return (
|
@@ -25,8 +25,12 @@ export const VideoProgress = ({
|
|
25
25
|
if (videoEl.buffered.length > 0) {
|
26
26
|
bufferProgress = Math.floor(getPercentage(videoEl.buffered?.end(0), duration));
|
27
27
|
}
|
28
|
-
|
29
|
-
|
28
|
+
if (!isNaN(videoProgress)) {
|
29
|
+
setVideoProgress(videoProgress);
|
30
|
+
}
|
31
|
+
if (!isNaN(bufferProgress)) {
|
32
|
+
setBufferProgress(bufferProgress);
|
33
|
+
}
|
30
34
|
}, [videoEl]);
|
31
35
|
const timeupdateHandler = useCallback(() => {
|
32
36
|
if (!videoEl || seekProgress) {
|
@@ -42,7 +46,7 @@ export const VideoProgress = ({
|
|
42
46
|
return function cleanup() {
|
43
47
|
videoEl?.removeEventListener('timeupdate', timeupdateHandler);
|
44
48
|
};
|
45
|
-
}, [timeupdateHandler, videoEl]);
|
49
|
+
}, [setProgress, timeupdateHandler, videoEl]);
|
46
50
|
|
47
51
|
const onProgress = (progress: number[]) => {
|
48
52
|
const progress1 = Math.floor(getPercentage(progress[0], 100));
|
@@ -2,15 +2,13 @@
|
|
2
2
|
import { LeftControls, RightControls, VideoControls } from './Controls';
|
3
3
|
// @ts-ignore
|
4
4
|
import { HMSVideo } from './HMSVideo';
|
5
|
-
import {
|
6
|
-
import { SeekControls } from './SeekControls';
|
5
|
+
import { PlayPauseSeekControls, PlayPauseSeekOverlayControls } from './PlayPauseSeekControls';
|
7
6
|
import { VideoProgress } from './VideoProgress';
|
8
7
|
import { VideoTime } from './VideoTime';
|
9
8
|
import { VolumeControl } from './VolumeControl';
|
10
9
|
|
11
10
|
export const HMSVideoPlayer = {
|
12
11
|
Root: HMSVideo,
|
13
|
-
PlayPauseButton: PlayPauseButton,
|
14
12
|
Progress: VideoProgress,
|
15
13
|
Duration: VideoTime,
|
16
14
|
Volume: VolumeControl,
|
@@ -19,5 +17,8 @@ export const HMSVideoPlayer = {
|
|
19
17
|
Left: LeftControls,
|
20
18
|
Right: RightControls,
|
21
19
|
},
|
22
|
-
|
20
|
+
PlayPauseSeekControls: {
|
21
|
+
Overlay: PlayPauseSeekOverlayControls,
|
22
|
+
Button: PlayPauseSeekControls,
|
23
|
+
},
|
23
24
|
};
|
@@ -25,9 +25,9 @@ const IconSection = styled(IconButton, {
|
|
25
25
|
p: '$4',
|
26
26
|
r: '$1',
|
27
27
|
bg: 'transparent',
|
28
|
-
borderTopRightRadius: 0,
|
28
|
+
borderTopRightRadius: '0 !important',
|
29
29
|
borderColor: '$border_bright',
|
30
|
-
borderBottomRightRadius: 0,
|
30
|
+
borderBottomRightRadius: '0 !important',
|
31
31
|
position: 'relative',
|
32
32
|
'&:not([disabled]):focus-visible': {
|
33
33
|
zIndex: 1,
|
@@ -41,8 +41,8 @@ const IconSection = styled(IconButton, {
|
|
41
41
|
...variants,
|
42
42
|
hideOptions: {
|
43
43
|
true: {
|
44
|
-
borderTopRightRadius: '$1',
|
45
|
-
borderBottomRightRadius: '$1',
|
44
|
+
borderTopRightRadius: '$1 !important',
|
45
|
+
borderBottomRightRadius: '$1 !important',
|
46
46
|
},
|
47
47
|
},
|
48
48
|
},
|
@@ -53,10 +53,10 @@ const OptionsSection = styled(IconButton, {
|
|
53
53
|
h: '$14',
|
54
54
|
p: '$4 $2',
|
55
55
|
r: '$1',
|
56
|
-
borderTopLeftRadius: 0,
|
56
|
+
borderTopLeftRadius: '0 !important',
|
57
57
|
borderColor: '$border_bright',
|
58
|
-
borderBottomLeftRadius: 0,
|
59
|
-
borderLeftWidth: 0,
|
58
|
+
borderBottomLeftRadius: '0 !important',
|
59
|
+
borderLeftWidth: '0 !important',
|
60
60
|
position: 'relative',
|
61
61
|
'&:not([disabled]):focus-visible': {
|
62
62
|
zIndex: 1,
|
@@ -29,7 +29,6 @@ import { FullScreenItem } from '../FullScreenItem';
|
|
29
29
|
import { MuteAllModal } from '../MuteAllModal';
|
30
30
|
// @ts-ignore: No implicit any
|
31
31
|
import { useDropdownList } from '../../hooks/useDropdownList';
|
32
|
-
// @ts-ignore: No implicit any
|
33
32
|
import { useMyMetadata } from '../../hooks/useMetadata';
|
34
33
|
// @ts-ignore: No implicit any
|
35
34
|
import { APP_DATA, isMacOS } from '../../../common/constants';
|
@@ -6,7 +6,6 @@ import {
|
|
6
6
|
selectIsConnectedToRoom,
|
7
7
|
selectPeerCount,
|
8
8
|
selectPermissions,
|
9
|
-
useAVToggle,
|
10
9
|
useHMSActions,
|
11
10
|
useHMSStore,
|
12
11
|
useRecordingStreaming,
|
@@ -51,7 +50,6 @@ import { usePollViewToggle, useSidepaneToggle } from '../../AppData/useSidepane'
|
|
51
50
|
import { useShowPolls } from '../../AppData/useUISettings';
|
52
51
|
// @ts-ignore: No implicit any
|
53
52
|
import { useDropdownList } from '../../hooks/useDropdownList';
|
54
|
-
// @ts-ignore: No implicit any
|
55
53
|
import { useMyMetadata } from '../../hooks/useMetadata';
|
56
54
|
import { useUnreadPollQuizPresent } from '../../hooks/useUnreadPollQuizPresent';
|
57
55
|
import { useLandscapeHLSStream, useMobileHLSStream } from '../../../common/hooks';
|
@@ -95,8 +93,6 @@ export const MwebOptions = ({
|
|
95
93
|
const peerCount = useHMSStore(selectPeerCount);
|
96
94
|
const emojiCardRef = useRef(null);
|
97
95
|
const { isBRBOn, toggleBRB, isHandRaised, toggleHandRaise } = useMyMetadata();
|
98
|
-
const { toggleAudio, toggleVideo } = useAVToggle();
|
99
|
-
const noAVPermissions = !(toggleAudio || toggleVideo);
|
100
96
|
const { unreadPollQuiz, setUnreadPollQuiz } = useUnreadPollQuizPresent();
|
101
97
|
const { title, description } = useRoomLayoutHeader();
|
102
98
|
const toggleDetailsSheet = useSheetToggle(SHEET_OPTIONS.ROOM_DETAILS);
|
@@ -175,7 +171,7 @@ export const MwebOptions = ({
|
|
175
171
|
</ActionTile.Root>
|
176
172
|
)}
|
177
173
|
|
178
|
-
{
|
174
|
+
{elements.hand_raise ? (
|
179
175
|
<ActionTile.Root
|
180
176
|
active={isHandRaised}
|
181
177
|
onClick={() => {
|