@100mslive/roomkit-react 0.3.3-alpha.3 → 0.3.3-alpha.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Accordion/Accordion.d.ts +0 -1
- package/dist/Accordion/index.d.ts +0 -1
- package/dist/{HLSView-BCIIVR2T.js → HLSView-VUANLYLS.js} +166 -331
- package/dist/HLSView-VUANLYLS.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 +3 -2
- package/dist/Prebuilt/components/Footer/ChatToggle.d.ts +1 -3
- package/dist/Prebuilt/components/HMSVideo/PlayPauseButton.d.ts +2 -2
- package/dist/Prebuilt/components/HMSVideo/{SeekControl.d.ts → SeekControls.d.ts} +2 -2
- package/dist/Prebuilt/components/HMSVideo/index.d.ts +11 -15
- package/dist/Prebuilt/components/Leave/LeaveAtoms.d.ts +2 -2
- package/dist/Prebuilt/components/RaiseHand.d.ts +1 -1
- package/dist/Prebuilt/layouts/WhiteboardView.d.ts +2 -0
- package/dist/Sheet/Sheet.d.ts +1 -1
- package/dist/{chunk-W47ZJGSD.js → chunk-5WTUTVRO.js} +540 -617
- package/dist/chunk-5WTUTVRO.js.map +7 -0
- package/dist/index.cjs.js +1426 -1686
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.js +1 -1
- package/dist/meta.cjs.json +169 -248
- package/dist/meta.esbuild.json +180 -260
- package/package.json +7 -7
- package/src/Accordion/Accordion.tsx +4 -4
- package/src/IconButton/IconButton.tsx +7 -2
- package/src/Prebuilt/IconButton.tsx +10 -6
- package/src/Prebuilt/components/Chat/ChatBody.tsx +0 -10
- package/src/Prebuilt/components/Chat/ChatFooter.tsx +4 -2
- package/src/Prebuilt/components/ConferenceScreen.tsx +4 -1
- package/src/Prebuilt/components/Footer/ChatToggle.tsx +2 -2
- package/src/Prebuilt/components/Footer/Footer.tsx +4 -1
- package/src/Prebuilt/components/Footer/ParticipantList.tsx +1 -4
- package/src/Prebuilt/components/Footer/RoleAccordion.tsx +6 -6
- package/src/Prebuilt/components/Footer/WhiteboardToggle.tsx +3 -17
- package/src/Prebuilt/components/HMSVideo/HMSVideo.jsx +0 -1
- package/src/Prebuilt/components/HMSVideo/PlayPauseButton.tsx +2 -2
- package/src/Prebuilt/components/HMSVideo/{SeekControl.tsx → SeekControls.tsx} +2 -2
- package/src/Prebuilt/components/HMSVideo/VideoProgress.tsx +3 -7
- package/src/Prebuilt/components/HMSVideo/index.ts +4 -5
- package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.tsx +7 -7
- package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.tsx +1 -0
- package/src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.tsx +5 -1
- package/src/Prebuilt/components/PreviousRoleInMetadata.tsx +1 -0
- package/src/Prebuilt/components/RaiseHand.tsx +1 -7
- package/src/Prebuilt/components/RoleChangeRequest/RoleChangeRequestModal.tsx +1 -0
- package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +4 -27
- package/src/Prebuilt/components/hooks/useCloseScreenshareWhiteboard.tsx +5 -13
- package/src/Prebuilt/components/hooks/{useMetadata.tsx → useMetadata.jsx} +8 -2
- package/src/Prebuilt/layouts/HLSView.jsx +78 -115
- package/src/Prebuilt/layouts/VideoStreamingSection.tsx +17 -1
- package/src/Prebuilt/layouts/WhiteboardView.tsx +69 -0
- package/dist/HLSView-BCIIVR2T.js.map +0 -7
- package/dist/Prebuilt/components/HMSVideo/PlayPauseSeekControls.d.ts +0 -14
- package/dist/Prebuilt/components/VideoLayouts/WhiteboardLayout.d.ts +0 -3
- package/dist/Prebuilt/components/hooks/useMetadata.d.ts +0 -8
- package/dist/chunk-W47ZJGSD.js.map +0 -7
- package/src/Prebuilt/components/HMSVideo/PlayPauseSeekControls.tsx +0 -158
- package/src/Prebuilt/components/VideoLayouts/WhiteboardLayout.tsx +0 -95
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.4",
|
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.4",
|
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.4",
|
88
|
+
"@100mslive/react-icons": "0.10.3-alpha.4",
|
89
|
+
"@100mslive/react-sdk": "0.10.3-alpha.4",
|
90
|
+
"@100mslive/types-prebuilt": "0.12.7",
|
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": "f402d418c294acc6ce73bc81ab286d26431a6f53"
|
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 }>
|
68
68
|
> = React.forwardRef<
|
69
69
|
HTMLButtonElement,
|
70
|
-
PropsWithChildren<BaseAccordion.AccordionTriggerProps & { iconStyles?: CSS; css?: CSS
|
71
|
-
>(({ children, iconStyles, css,
|
70
|
+
PropsWithChildren<BaseAccordion.AccordionTriggerProps & { iconStyles?: CSS; css?: CSS }>
|
71
|
+
>(({ children, iconStyles, css, ...props }, forwardedRef) => (
|
72
72
|
<StyledHeader css={css}>
|
73
73
|
<StyledTrigger {...props} ref={forwardedRef}>
|
74
74
|
{children}
|
75
|
-
<StyledChevron
|
75
|
+
<StyledChevron aria-hidden css={iconStyles} />
|
76
76
|
</StyledTrigger>
|
77
77
|
</StyledHeader>
|
78
78
|
));
|
@@ -25,14 +25,19 @@ 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',
|
30
28
|
},
|
31
29
|
'&:focus': {
|
32
30
|
outline: 'none',
|
33
31
|
},
|
34
32
|
variants: {
|
35
33
|
active: {
|
34
|
+
false: {
|
35
|
+
backgroundColor: '$secondary_dim',
|
36
|
+
color: '$on_primary_high',
|
37
|
+
'&:not([disabled]):hover': {
|
38
|
+
backgroundColor: '$secondary_default',
|
39
|
+
},
|
40
|
+
},
|
36
41
|
true: {
|
37
42
|
'&:not([disabled]):hover': {
|
38
43
|
backgroundColor: '$on_surface_low',
|
@@ -7,18 +7,22 @@ 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
|
-
},
|
16
10
|
variants: {
|
17
11
|
active: {
|
18
12
|
true: {
|
19
13
|
color: '$on_surface_high',
|
20
14
|
backgroundColor: 'transparent',
|
21
15
|
},
|
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
|
+
},
|
22
26
|
},
|
23
27
|
},
|
24
28
|
});
|
@@ -410,7 +410,6 @@ export const ChatBody = React.forwardRef<VariableSizeList, { scrollToBottom: (co
|
|
410
410
|
}, [blacklistedMessageIDs, messages]);
|
411
411
|
|
412
412
|
const vanillaStore = useHMSVanillaStore();
|
413
|
-
const rerenderOnFirstMount = useRef(false);
|
414
413
|
|
415
414
|
useEffect(() => {
|
416
415
|
const unsubscribe = vanillaStore.subscribe(() => {
|
@@ -427,15 +426,6 @@ export const ChatBody = React.forwardRef<VariableSizeList, { scrollToBottom: (co
|
|
427
426
|
return unsubscribe;
|
428
427
|
}, [vanillaStore, listRef, scrollToBottom]);
|
429
428
|
|
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
|
-
|
439
429
|
return filteredMessages.length === 0 ? (
|
440
430
|
<EmptyChat />
|
441
431
|
) : (
|
@@ -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, useHMSActions, useHMSStore } from '@100mslive/react-sdk';
|
5
|
+
import { HMSException, selectLocalPeer, useAVToggle, 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,6 +89,8 @@ 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);
|
92
94
|
const isMwebHLSStream = useMobileHLSStream();
|
93
95
|
const isLandscapeHLSStream = useLandscapeHLSStream();
|
94
96
|
|
@@ -273,7 +275,7 @@ export const ChatFooter = ({ onSend, children }: { onSend: (count: number) => vo
|
|
273
275
|
}}
|
274
276
|
gap="2"
|
275
277
|
>
|
276
|
-
<RaiseHand css={{ bg: '$surface_default' }} />
|
278
|
+
{noAVPermissions ? <RaiseHand css={{ bg: '$surface_default' }} /> : null}
|
277
279
|
<MoreSettings elements={elements} screenType={screenType} />
|
278
280
|
</Flex>
|
279
281
|
</>
|
@@ -6,6 +6,7 @@ import {
|
|
6
6
|
selectAppData,
|
7
7
|
selectIsConnectedToRoom,
|
8
8
|
selectRoomState,
|
9
|
+
useAVToggle,
|
9
10
|
useHMSActions,
|
10
11
|
useHMSStore,
|
11
12
|
} from '@100mslive/react-sdk';
|
@@ -53,6 +54,8 @@ export const ConferenceScreen = () => {
|
|
53
54
|
const dropdownListRef = useRef<string[]>();
|
54
55
|
const [isHLSStarted] = useSetAppDataByKey(APP_DATA.hlsStarted);
|
55
56
|
|
57
|
+
const { toggleAudio, toggleVideo } = useAVToggle();
|
58
|
+
const noAVPermissions = !(toggleAudio || toggleVideo);
|
56
59
|
// using it in hls stream to show action button when chat is disabled
|
57
60
|
const showChat = !!screenProps.elements?.chat;
|
58
61
|
const autoRoomJoined = useRef(isPreviewScreenEnabled);
|
@@ -199,7 +202,7 @@ export const ConferenceScreen = () => {
|
|
199
202
|
justify="end"
|
200
203
|
gap="2"
|
201
204
|
>
|
202
|
-
<RaiseHand />
|
205
|
+
{noAVPermissions ? <RaiseHand /> : null}
|
203
206
|
<MoreSettings elements={screenProps.elements} screenType={screenProps.screenType} />
|
204
207
|
<Box
|
205
208
|
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 = () => {
|
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 = ({ onClick }: { onClick?: () => void }) => {
|
|
21
21
|
}}
|
22
22
|
>
|
23
23
|
<Tooltip key="chat" title={`${isChatOpen ? 'Close' : 'Open'} chat`}>
|
24
|
-
<IconButton onClick={
|
24
|
+
<IconButton onClick={toggleChat} active={!isChatOpen} data-testid="chat_btn">
|
25
25
|
<ChatIcon />
|
26
26
|
</IconButton>
|
27
27
|
</Tooltip>
|
@@ -2,6 +2,7 @@ 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';
|
5
6
|
import { config as cssConfig, Footer as AppFooter } from '../../..';
|
6
7
|
// @ts-ignore: No implicit Any
|
7
8
|
import { AudioVideoToggle } from '../AudioVideoToggle';
|
@@ -40,6 +41,8 @@ export const Footer = ({
|
|
40
41
|
const isOverlayChat = !!elements?.chat?.is_overlay;
|
41
42
|
const openByDefault = elements?.chat?.initial_state === Chat_ChatState.CHAT_STATE_OPEN;
|
42
43
|
|
44
|
+
const { toggleAudio, toggleVideo } = useAVToggle();
|
45
|
+
const noAVPermissions = !(toggleAudio || toggleVideo);
|
43
46
|
const isChatOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.CHAT);
|
44
47
|
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
45
48
|
const { showPolls } = useShowPolls();
|
@@ -87,7 +90,7 @@ export const Footer = ({
|
|
87
90
|
>
|
88
91
|
{isMobile ? (
|
89
92
|
<>
|
90
|
-
<RaiseHand />
|
93
|
+
{noAVPermissions ? <RaiseHand /> : null}
|
91
94
|
{elements?.chat && <ChatToggle />}
|
92
95
|
<MoreSettings elements={elements} screenType={screenType} />
|
93
96
|
</>
|
@@ -324,15 +324,12 @@ const HandRaisedAccordionParticipantActions = ({ peerId, role }: { peerId: strin
|
|
324
324
|
peerId,
|
325
325
|
role,
|
326
326
|
});
|
327
|
-
if (!shouldShowStageRoleChange) {
|
328
|
-
return null;
|
329
|
-
}
|
330
327
|
return (
|
331
328
|
<>
|
332
329
|
<Button variant="standard" css={quickActionStyle} onClick={lowerPeerHand}>
|
333
330
|
<CrossIcon height={18} width={18} />
|
334
331
|
</Button>
|
335
|
-
{!isInStage && (
|
332
|
+
{shouldShowStageRoleChange && !isInStage && (
|
336
333
|
<Button variant="primary" onClick={handleStageAction} css={quickActionStyle}>
|
337
334
|
<AddIcon height={18} width={18} />
|
338
335
|
</Button>
|
@@ -93,7 +93,6 @@ 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}`}
|
97
96
|
iconStyles={{ c: '$on_surface_high' }}
|
98
97
|
css={{
|
99
98
|
textTransform: 'capitalize',
|
@@ -149,17 +148,18 @@ export const RoleAccordion = ({
|
|
149
148
|
<ChevronRightIcon />
|
150
149
|
</Flex>
|
151
150
|
) : null}
|
152
|
-
{isHandRaisedAccordion &&
|
151
|
+
{isHandRaisedAccordion && (
|
153
152
|
<>
|
154
153
|
<HorizontalDivider />
|
155
154
|
<Flex css={{ w: '100%', p: '$6', gap: '$4' }} justify="center">
|
156
155
|
<Button variant="standard" onClick={lowerAllHands} icon css={{ pl: '$2' }}>
|
157
156
|
<CrossIcon /> Lower all hands
|
158
157
|
</Button>
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
158
|
+
{canBringToStage && (
|
159
|
+
<Button onClick={bringAllToStage} icon css={{ pl: '$2' }}>
|
160
|
+
<AddIcon /> {bring_to_stage_label}
|
161
|
+
</Button>
|
162
|
+
)}
|
163
163
|
</Flex>
|
164
164
|
</>
|
165
165
|
)}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import {
|
2
|
+
import { 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,28 +9,14 @@ 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
|
-
|
16
12
|
if (!toggle) {
|
17
13
|
return null;
|
18
14
|
}
|
19
15
|
|
20
16
|
return (
|
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
|
-
>
|
17
|
+
<Tooltip key="whiteboard" title={`${open ? 'Close' : 'Open'} Whiteboard`}>
|
29
18
|
<IconButton
|
30
19
|
onClick={async () => {
|
31
|
-
if (disabled) {
|
32
|
-
return;
|
33
|
-
}
|
34
20
|
try {
|
35
21
|
await toggle();
|
36
22
|
} catch (error) {
|
@@ -38,7 +24,7 @@ export const WhiteboardToggle = () => {
|
|
38
24
|
}
|
39
25
|
}}
|
40
26
|
active={!open}
|
41
|
-
disabled={
|
27
|
+
disabled={open && !isOwner}
|
42
28
|
data-testid="whiteboard_btn"
|
43
29
|
>
|
44
30
|
<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) => {
|
@@ -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 SeekControls = ({
|
5
5
|
title,
|
6
6
|
onClick,
|
7
7
|
children,
|
@@ -9,7 +9,7 @@ export const SeekControl = ({
|
|
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,12 +25,8 @@ 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
|
-
|
30
|
-
}
|
31
|
-
if (!isNaN(bufferProgress)) {
|
32
|
-
setBufferProgress(bufferProgress);
|
33
|
-
}
|
28
|
+
setVideoProgress(isNaN(videoProgress) ? 0 : videoProgress);
|
29
|
+
setBufferProgress(isNaN(bufferProgress) ? 0 : bufferProgress);
|
34
30
|
}, [videoEl]);
|
35
31
|
const timeupdateHandler = useCallback(() => {
|
36
32
|
if (!videoEl || seekProgress) {
|
@@ -46,7 +42,7 @@ export const VideoProgress = ({
|
|
46
42
|
return function cleanup() {
|
47
43
|
videoEl?.removeEventListener('timeupdate', timeupdateHandler);
|
48
44
|
};
|
49
|
-
}, [
|
45
|
+
}, [timeupdateHandler, videoEl]);
|
50
46
|
|
51
47
|
const onProgress = (progress: number[]) => {
|
52
48
|
const progress1 = Math.floor(getPercentage(progress[0], 100));
|
@@ -2,13 +2,15 @@
|
|
2
2
|
import { LeftControls, RightControls, VideoControls } from './Controls';
|
3
3
|
// @ts-ignore
|
4
4
|
import { HMSVideo } from './HMSVideo';
|
5
|
-
import {
|
5
|
+
import { PlayPauseButton } from './PlayPauseButton';
|
6
|
+
import { SeekControls } from './SeekControls';
|
6
7
|
import { VideoProgress } from './VideoProgress';
|
7
8
|
import { VideoTime } from './VideoTime';
|
8
9
|
import { VolumeControl } from './VolumeControl';
|
9
10
|
|
10
11
|
export const HMSVideoPlayer = {
|
11
12
|
Root: HMSVideo,
|
13
|
+
PlayPauseButton: PlayPauseButton,
|
12
14
|
Progress: VideoProgress,
|
13
15
|
Duration: VideoTime,
|
14
16
|
Volume: VolumeControl,
|
@@ -17,8 +19,5 @@ export const HMSVideoPlayer = {
|
|
17
19
|
Left: LeftControls,
|
18
20
|
Right: RightControls,
|
19
21
|
},
|
20
|
-
|
21
|
-
Overlay: PlayPauseSeekOverlayControls,
|
22
|
-
Button: PlayPauseSeekControls,
|
23
|
-
},
|
22
|
+
Seeker: SeekControls,
|
24
23
|
};
|
@@ -25,9 +25,9 @@ const IconSection = styled(IconButton, {
|
|
25
25
|
p: '$4',
|
26
26
|
r: '$1',
|
27
27
|
bg: 'transparent',
|
28
|
-
borderTopRightRadius:
|
28
|
+
borderTopRightRadius: 0,
|
29
29
|
borderColor: '$border_bright',
|
30
|
-
borderBottomRightRadius:
|
30
|
+
borderBottomRightRadius: 0,
|
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',
|
45
|
+
borderBottomRightRadius: '$1',
|
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:
|
56
|
+
borderTopLeftRadius: 0,
|
57
57
|
borderColor: '$border_bright',
|
58
|
-
borderBottomLeftRadius:
|
59
|
-
borderLeftWidth:
|
58
|
+
borderBottomLeftRadius: 0,
|
59
|
+
borderLeftWidth: 0,
|
60
60
|
position: 'relative',
|
61
61
|
'&:not([disabled]):focus-visible': {
|
62
62
|
zIndex: 1,
|
@@ -29,6 +29,7 @@ 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
|
32
33
|
import { useMyMetadata } from '../../hooks/useMetadata';
|
33
34
|
// @ts-ignore: No implicit any
|
34
35
|
import { APP_DATA, isMacOS } from '../../../common/constants';
|
@@ -6,6 +6,7 @@ import {
|
|
6
6
|
selectIsConnectedToRoom,
|
7
7
|
selectPeerCount,
|
8
8
|
selectPermissions,
|
9
|
+
useAVToggle,
|
9
10
|
useHMSActions,
|
10
11
|
useHMSStore,
|
11
12
|
useRecordingStreaming,
|
@@ -50,6 +51,7 @@ import { usePollViewToggle, useSidepaneToggle } from '../../AppData/useSidepane'
|
|
50
51
|
import { useShowPolls } from '../../AppData/useUISettings';
|
51
52
|
// @ts-ignore: No implicit any
|
52
53
|
import { useDropdownList } from '../../hooks/useDropdownList';
|
54
|
+
// @ts-ignore: No implicit any
|
53
55
|
import { useMyMetadata } from '../../hooks/useMetadata';
|
54
56
|
import { useUnreadPollQuizPresent } from '../../hooks/useUnreadPollQuizPresent';
|
55
57
|
import { useLandscapeHLSStream, useMobileHLSStream } from '../../../common/hooks';
|
@@ -93,6 +95,8 @@ export const MwebOptions = ({
|
|
93
95
|
const peerCount = useHMSStore(selectPeerCount);
|
94
96
|
const emojiCardRef = useRef(null);
|
95
97
|
const { isBRBOn, toggleBRB, isHandRaised, toggleHandRaise } = useMyMetadata();
|
98
|
+
const { toggleAudio, toggleVideo } = useAVToggle();
|
99
|
+
const noAVPermissions = !(toggleAudio || toggleVideo);
|
96
100
|
const { unreadPollQuiz, setUnreadPollQuiz } = useUnreadPollQuizPresent();
|
97
101
|
const { title, description } = useRoomLayoutHeader();
|
98
102
|
const toggleDetailsSheet = useSheetToggle(SHEET_OPTIONS.ROOM_DETAILS);
|
@@ -171,7 +175,7 @@ export const MwebOptions = ({
|
|
171
175
|
</ActionTile.Root>
|
172
176
|
)}
|
173
177
|
|
174
|
-
{
|
178
|
+
{!noAVPermissions ? (
|
175
179
|
<ActionTile.Root
|
176
180
|
active={isHandRaised}
|
177
181
|
onClick={() => {
|
@@ -4,17 +4,11 @@ import { CSS } from '../../Theme';
|
|
4
4
|
import { Tooltip } from '../../Tooltip';
|
5
5
|
// @ts-ignore: No implicit Any
|
6
6
|
import IconButton from '../IconButton';
|
7
|
-
|
7
|
+
// @ts-ignore: No implicit Any
|
8
8
|
import { useMyMetadata } from './hooks/useMetadata';
|
9
9
|
|
10
10
|
export const RaiseHand = ({ css }: { css?: CSS }) => {
|
11
11
|
const { isHandRaised, toggleHandRaise } = useMyMetadata();
|
12
|
-
const { elements } = useRoomLayoutConferencingScreen();
|
13
|
-
|
14
|
-
if (!elements.hand_raise) {
|
15
|
-
return null;
|
16
|
-
}
|
17
|
-
|
18
12
|
return (
|
19
13
|
<Tooltip title={isHandRaised ? 'Lower hand' : 'Raise hand'}>
|
20
14
|
<IconButton
|
@@ -13,6 +13,7 @@ import { Flex, Text } from '../../..';
|
|
13
13
|
import { PreviewControls, PreviewTile } from '../Preview/PreviewJoin';
|
14
14
|
import { RequestPrompt } from './RequestPrompt';
|
15
15
|
import { useRoomLayoutPreviewScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
|
16
|
+
// @ts-ignore: No implicit Any
|
16
17
|
import { useMyMetadata } from '../hooks/useMetadata';
|
17
18
|
// @ts-ignore: No implicit Any
|
18
19
|
import { ROLE_CHANGE_DECLINED } from '../../common/constants';
|
@@ -5,14 +5,12 @@ import {
|
|
5
5
|
selectLocalPeerRoleName,
|
6
6
|
selectPeers,
|
7
7
|
selectPeerScreenSharing,
|
8
|
-
selectWhiteboard,
|
9
8
|
useHMSStore,
|
10
9
|
useHMSVanillaStore,
|
11
10
|
} from '@100mslive/react-sdk';
|
12
11
|
import { EqualProminence } from './EqualProminence';
|
13
12
|
import { RoleProminence } from './RoleProminence';
|
14
13
|
import { ScreenshareLayout } from './ScreenshareLayout';
|
15
|
-
import { WhiteboardLayout } from './WhiteboardLayout';
|
16
14
|
// @ts-ignore: No implicit Any
|
17
15
|
import { usePinnedTrack, useSetAppDataByKey } from '../AppData/useUISettings';
|
18
16
|
import { VideoTileContext } from '../hooks/useVideoTileLayout';
|
@@ -42,7 +40,6 @@ export const GridLayout = ({
|
|
42
40
|
hide_metadata_on_tile = false,
|
43
41
|
}: GridLayoutProps) => {
|
44
42
|
const peerSharing = useHMSStore(selectPeerScreenSharing);
|
45
|
-
const whiteboard = useHMSStore(selectWhiteboard);
|
46
43
|
const pinnedTrack = usePinnedTrack();
|
47
44
|
const peers = useHMSStore(selectPeers);
|
48
45
|
const localPeerRole = useHMSStore(selectLocalPeerRoleName);
|
@@ -56,9 +53,9 @@ export const GridLayout = ({
|
|
56
53
|
)) ||
|
57
54
|
pinnedTrack;
|
58
55
|
const updatedPeers = useMemo(() => {
|
59
|
-
// remove screenshare
|
60
|
-
if (activeScreensharePeerId
|
61
|
-
return peers.filter(peer => peer.id !== activeScreensharePeerId
|
56
|
+
// remove screenshare peer from active speaker sorting
|
57
|
+
if (activeScreensharePeerId) {
|
58
|
+
return peers.filter(peer => peer.id !== activeScreensharePeerId);
|
62
59
|
}
|
63
60
|
if (isInsetEnabled) {
|
64
61
|
const isLocalPeerPinned = localPeerID === pinnedTrack?.peerId;
|
@@ -70,16 +67,7 @@ export const GridLayout = ({
|
|
70
67
|
}
|
71
68
|
}
|
72
69
|
return peers;
|
73
|
-
}, [
|
74
|
-
isInsetEnabled,
|
75
|
-
whiteboard,
|
76
|
-
activeScreensharePeerId,
|
77
|
-
localPeerRole,
|
78
|
-
localPeerID,
|
79
|
-
prominentRoles,
|
80
|
-
peers,
|
81
|
-
pinnedTrack,
|
82
|
-
]);
|
70
|
+
}, [isInsetEnabled, activeScreensharePeerId, localPeerRole, localPeerID, prominentRoles, peers, pinnedTrack]);
|
83
71
|
const vanillaStore = useHMSVanillaStore();
|
84
72
|
const [sortedPeers, setSortedPeers] = useState(updatedPeers);
|
85
73
|
const peersSorter = useMemo(() => new PeersSorter(vanillaStore), [vanillaStore]);
|
@@ -116,17 +104,6 @@ export const GridLayout = ({
|
|
116
104
|
/>
|
117
105
|
</VideoTileContext.Provider>
|
118
106
|
);
|
119
|
-
} else if (whiteboard?.open) {
|
120
|
-
return (
|
121
|
-
<VideoTileContext.Provider value={tileLayout}>
|
122
|
-
<WhiteboardLayout
|
123
|
-
peers={sortedPeers}
|
124
|
-
onPageSize={setPageSize}
|
125
|
-
onPageChange={setMainPage}
|
126
|
-
edgeToEdge={edge_to_edge}
|
127
|
-
/>
|
128
|
-
</VideoTileContext.Provider>
|
129
|
-
);
|
130
107
|
} else if (isRoleProminence) {
|
131
108
|
return (
|
132
109
|
<VideoTileContext.Provider value={tileLayout}>
|
@@ -6,27 +6,19 @@ import { useScreenShare, useWhiteboard } from '@100mslive/react-sdk';
|
|
6
6
|
* close existing screenshare or whiteboard when the other is started
|
7
7
|
*/
|
8
8
|
export const useCloseScreenshareWhiteboard = () => {
|
9
|
-
const { amIScreenSharing,
|
9
|
+
const { amIScreenSharing, toggleScreenShare } = useScreenShare();
|
10
10
|
const { isOwner: isWhiteboardOwner, toggle: toggleWhiteboard } = useWhiteboard();
|
11
|
-
const prevScreenSharer = usePrevious(
|
11
|
+
const prevScreenSharer = usePrevious(amIScreenSharing);
|
12
12
|
const prevWhiteboardOwner = usePrevious(isWhiteboardOwner);
|
13
13
|
|
14
14
|
// if both screenshare and whiteboard are open, close the one that was open earlier
|
15
15
|
useEffect(() => {
|
16
|
-
if (isWhiteboardOwner &&
|
17
|
-
if (prevScreenSharer &&
|
16
|
+
if (isWhiteboardOwner && amIScreenSharing) {
|
17
|
+
if (prevScreenSharer && !prevWhiteboardOwner) {
|
18
18
|
toggleScreenShare?.();
|
19
19
|
} else if (prevWhiteboardOwner && !prevScreenSharer) {
|
20
20
|
toggleWhiteboard?.();
|
21
21
|
}
|
22
22
|
}
|
23
|
-
}, [
|
24
|
-
isWhiteboardOwner,
|
25
|
-
screenSharingPeerId,
|
26
|
-
amIScreenSharing,
|
27
|
-
prevScreenSharer,
|
28
|
-
prevWhiteboardOwner,
|
29
|
-
toggleScreenShare,
|
30
|
-
toggleWhiteboard,
|
31
|
-
]);
|
23
|
+
}, [isWhiteboardOwner, amIScreenSharing, prevScreenSharer, prevWhiteboardOwner, toggleScreenShare, toggleWhiteboard]);
|
32
24
|
};
|