@100mslive/roomkit-react 0.1.6-alpha.1 → 0.1.6-alpha.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. package/dist/{HLSView-HNVYG5VE.js → HLSView-HL455FYH.js} +3 -3
  2. package/dist/Prebuilt/components/Footer/ChatToggle.d.ts +1 -3
  3. package/dist/Prebuilt/components/Leave/DesktopLeaveRoom.d.ts +2 -1
  4. package/dist/Prebuilt/components/Leave/MwebLeaveRoom.d.ts +2 -1
  5. package/dist/Prebuilt/components/SidePaneTabs.d.ts +7 -0
  6. package/dist/{VirtualBackground-UM2FOUHQ.js → VirtualBackground-6EP3X7MO.js} +6 -6
  7. package/dist/VirtualBackground-6EP3X7MO.js.map +7 -0
  8. package/dist/{chunk-LYSAET4G.js → chunk-6JF3GAOH.js} +109 -127
  9. package/dist/chunk-6JF3GAOH.js.map +7 -0
  10. package/dist/{chunk-POE7H4IE.js → chunk-KAJJ56J4.js} +2 -2
  11. package/dist/{chunk-POE7H4IE.js.map → chunk-KAJJ56J4.js.map} +1 -1
  12. package/dist/{chunk-364HP22I.js → chunk-UXBTLGWY.js} +2 -2
  13. package/dist/{conference-UWLJHMB2.js → conference-MPZNWHV5.js} +472 -415
  14. package/dist/conference-MPZNWHV5.js.map +7 -0
  15. package/dist/index.cjs.js +714 -678
  16. package/dist/index.cjs.js.map +4 -4
  17. package/dist/index.js +2 -2
  18. package/dist/meta.cjs.json +153 -153
  19. package/dist/meta.esbuild.json +185 -184
  20. package/package.json +6 -6
  21. package/src/Button/Button.tsx +6 -6
  22. package/src/Prebuilt/components/Chat/Chat.jsx +3 -9
  23. package/src/Prebuilt/components/Chat/useEmojiPickerStyles.js +1 -0
  24. package/src/Prebuilt/components/Footer/ChatToggle.tsx +2 -9
  25. package/src/Prebuilt/components/Footer/Footer.tsx +23 -7
  26. package/src/Prebuilt/components/Footer/ParticipantList.jsx +4 -5
  27. package/src/Prebuilt/components/Footer/RoleAccordion.tsx +1 -1
  28. package/src/Prebuilt/components/Header/HeaderComponents.jsx +10 -9
  29. package/src/Prebuilt/components/InsetTile.tsx +1 -0
  30. package/src/Prebuilt/components/Leave/DesktopLeaveRoom.tsx +7 -9
  31. package/src/Prebuilt/components/Leave/LeaveRoom.tsx +6 -2
  32. package/src/Prebuilt/components/Leave/MwebLeaveRoom.tsx +7 -4
  33. package/src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.tsx +1 -1
  34. package/src/Prebuilt/components/Notifications/Notifications.jsx +4 -3
  35. package/src/Prebuilt/components/Preview/PreviewJoin.tsx +2 -3
  36. package/src/Prebuilt/components/RoleChangeRequestModal.tsx +4 -3
  37. package/src/Prebuilt/components/ScreenshareTile.jsx +15 -7
  38. package/src/Prebuilt/components/SidePaneTabs.tsx +141 -0
  39. package/src/Prebuilt/components/conference.jsx +9 -1
  40. package/src/Prebuilt/components/hooks/useMetadata.jsx +7 -25
  41. package/src/Prebuilt/layouts/SidePane.tsx +12 -10
  42. package/src/Prebuilt/plugins/VirtualBackground/VirtualBackground.jsx +3 -3
  43. package/src/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.ts +2 -2
  44. package/dist/VirtualBackground-UM2FOUHQ.js.map +0 -7
  45. package/dist/chunk-LYSAET4G.js.map +0 -7
  46. package/dist/conference-UWLJHMB2.js.map +0 -7
  47. package/src/Prebuilt/components/Chat/ChatParticipantHeader.jsx +0 -84
  48. /package/dist/{HLSView-HNVYG5VE.js.map → HLSView-HL455FYH.js.map} +0 -0
  49. /package/dist/{chunk-364HP22I.js.map → chunk-UXBTLGWY.js.map} +0 -0
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "prebuilt",
11
11
  "roomkit"
12
12
  ],
13
- "version": "0.1.6-alpha.1",
13
+ "version": "0.1.6-alpha.3",
14
14
  "author": "100ms",
15
15
  "license": "MIT",
16
16
  "files": [
@@ -76,10 +76,10 @@
76
76
  "react": ">=17.0.2 <19.0.0"
77
77
  },
78
78
  "dependencies": {
79
- "@100mslive/hls-player": "0.1.15-alpha.1",
80
- "@100mslive/hms-virtual-background": "1.11.15-alpha.1",
81
- "@100mslive/react-icons": "0.8.15-alpha.1",
82
- "@100mslive/react-sdk": "0.8.15-alpha.1",
79
+ "@100mslive/hls-player": "0.1.15-alpha.3",
80
+ "@100mslive/hms-virtual-background": "1.11.15-alpha.3",
81
+ "@100mslive/react-icons": "0.8.15-alpha.3",
82
+ "@100mslive/react-sdk": "0.8.15-alpha.3",
83
83
  "@100mslive/types-prebuilt": "0.12.0",
84
84
  "@emoji-mart/data": "^1.0.6",
85
85
  "@emoji-mart/react": "^1.0.1",
@@ -115,5 +115,5 @@
115
115
  "uuid": "^8.3.2",
116
116
  "worker-timers": "^7.0.40"
117
117
  },
118
- "gitHead": "d3f042d48bb30f16c6c63f2a75c406611c0f2831"
118
+ "gitHead": "1724f0ddfffa3cd09487ab41c065c426c70c2bc3"
119
119
  }
@@ -139,12 +139,12 @@ const StyledButton = styled('button', {
139
139
  variants: {
140
140
  variant: {
141
141
  standard: getButtonVariants(
142
- '$secondary_default',
143
- '$secondary_bright',
144
- '$secondary_dim',
145
- '$secondary_disabled',
146
- '$on_secondary_high',
147
- '$on_secondary_low',
142
+ '$surface_brighter',
143
+ '$surface_bright',
144
+ '$surface_default',
145
+ '$surface_dim',
146
+ '$on_surface_high',
147
+ '$on_surface_low',
148
148
  ),
149
149
  danger: getButtonVariants(
150
150
  '$alert_error_default',
@@ -17,7 +17,6 @@ import { Text } from '../../../Text';
17
17
  import { config as cssConfig } from '../../../Theme';
18
18
  import { AnnotisedMessage, ChatBody } from './ChatBody';
19
19
  import { ChatFooter } from './ChatFooter';
20
- import { ChatParticipantHeader } from './ChatParticipantHeader';
21
20
  import { useRoomLayoutConferencingScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
22
21
  import { useSetSubscribedChatSelector } from '../AppData/useUISettings';
23
22
  import { useSetPinnedMessage } from '../hooks/useSetPinnedMessage';
@@ -67,7 +66,7 @@ const PinnedMessage = ({ clearPinnedMessage }) => {
67
66
  ) : null;
68
67
  };
69
68
 
70
- export const Chat = ({ screenType, hideControls = false }) => {
69
+ export const Chat = ({ screenType }) => {
71
70
  const notification = useHMSNotifications(HMSNotificationTypes.PEER_LEFT);
72
71
  const [peerSelector, setPeerSelector] = useSetSubscribedChatSelector(CHAT_SELECTOR.PEER_ID);
73
72
  const [roleSelector, setRoleSelector] = useSetSubscribedChatSelector(CHAT_SELECTOR.ROLE);
@@ -77,7 +76,7 @@ export const Chat = ({ screenType, hideControls = false }) => {
77
76
  peerId: peerSelector && peerName ? peerSelector : '',
78
77
  selection: roleSelector ? roleSelector : peerSelector && peerName ? peerName : 'Everyone',
79
78
  });
80
- const [isSelectorOpen, setSelectorOpen] = useState(false);
79
+ const [isSelectorOpen] = useState(false);
81
80
  const listRef = useRef(null);
82
81
  const hmsActions = useHMSActions();
83
82
  const { setPinnedMessage } = useSetPinnedMessage();
@@ -123,15 +122,10 @@ export const Chat = ({ screenType, hideControls = false }) => {
123
122
  css={{
124
123
  size: '100%',
125
124
  gap: '$4',
126
- marginTop: hideControls && elements?.chat?.is_overlay ? '$17' : '0',
127
- transition: 'margin 0.3s ease-in-out',
128
125
  }}
129
126
  >
130
127
  {isMobile && elements?.chat?.is_overlay ? null : (
131
- <>
132
- <ChatParticipantHeader selectorOpen={isSelectorOpen} onToggle={() => setSelectorOpen(value => !value)} />
133
- {elements?.chat?.allow_pinning_messages ? <PinnedMessage clearPinnedMessage={setPinnedMessage} /> : null}
134
- </>
128
+ <>{elements?.chat?.allow_pinning_messages ? <PinnedMessage clearPinnedMessage={setPinnedMessage} /> : null}</>
135
129
  )}
136
130
 
137
131
  <ChatBody
@@ -18,6 +18,7 @@ export const useEmojiPickerStyles = showing => {
18
18
  font-family: var(--hms-ui-fonts-sans);
19
19
  }
20
20
  .sticky {
21
+ top: 0.25rem;
21
22
  background-color: var(--hms-ui-colors-surface_bright);
22
23
  margin-top: 0.5rem;
23
24
  }
@@ -1,4 +1,4 @@
1
- import React, { useEffect } from 'react';
1
+ import React from 'react';
2
2
  import { selectUnreadHMSMessagesCount, useHMSStore } from '@100mslive/react-sdk';
3
3
  import { ChatIcon, ChatUnreadIcon } from '@100mslive/react-icons';
4
4
  import { Tooltip } from '../../..';
@@ -9,18 +9,11 @@ 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 = ({ openByDefault }: { openByDefault: boolean }) => {
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);
16
16
 
17
- useEffect(() => {
18
- if (!isChatOpen && openByDefault) {
19
- toggleChat();
20
- }
21
- // eslint-disable-next-line react-hooks/exhaustive-deps
22
- }, [toggleChat, openByDefault]);
23
-
24
17
  return (
25
18
  <Tooltip key="chat" title={`${isChatOpen ? 'Close' : 'Open'} chat`}>
26
19
  <IconButton onClick={toggleChat} active={!isChatOpen} data-testid="chat_btn">
@@ -1,4 +1,4 @@
1
- import React, { Suspense } from 'react';
1
+ import React, { Suspense, useEffect } from 'react';
2
2
  import { useMedia } from 'react-use';
3
3
  import {
4
4
  ConferencingScreen,
@@ -6,7 +6,6 @@ import {
6
6
  HLSLiveStreamingScreen_Elements,
7
7
  } from '@100mslive/types-prebuilt';
8
8
  import { Chat_ChatState } from '@100mslive/types-prebuilt/elements/chat';
9
- import { selectIsLocalVideoEnabled, useHMSStore } from '@100mslive/react-sdk';
10
9
  import { config as cssConfig, Footer as AppFooter } from '../../..';
11
10
  // @ts-ignore: No implicit Any
12
11
  import { AudioVideoToggle } from '../AudioVideoToggle';
@@ -25,6 +24,10 @@ import { ChatToggle } from './ChatToggle';
25
24
  // @ts-ignore: No implicit Any
26
25
  import { ParticipantCount } from './ParticipantList';
27
26
  // @ts-ignore: No implicit Any
27
+ import { useIsSidepaneTypeOpen, useSidepaneToggle } from '../AppData/useSidepane';
28
+ // @ts-ignore: No implicit Any
29
+ import { SIDE_PANE_OPTIONS } from '../../common/constants';
30
+ // @ts-ignore: No implicit Any
28
31
  const VirtualBackground = React.lazy(() => import('../../plugins/VirtualBackground/VirtualBackground'));
29
32
 
30
33
  export const Footer = ({
@@ -37,7 +40,16 @@ export const Footer = ({
37
40
  const isMobile = useMedia(cssConfig.media.md);
38
41
  const isOverlayChat = !!elements?.chat?.is_overlay;
39
42
  const openByDefault = elements?.chat?.initial_state === Chat_ChatState.CHAT_STATE_OPEN;
40
- const isVideoOn = useHMSStore(selectIsLocalVideoEnabled);
43
+
44
+ const isChatOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.CHAT);
45
+ const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
46
+
47
+ useEffect(() => {
48
+ if (!isChatOpen && openByDefault) {
49
+ toggleChat();
50
+ }
51
+ // eslint-disable-next-line react-hooks/exhaustive-deps
52
+ }, [toggleChat, openByDefault]);
41
53
 
42
54
  return (
43
55
  <AppFooter.Root
@@ -48,7 +60,7 @@ export const Footer = ({
48
60
  gap: '$10',
49
61
  position: 'relative',
50
62
  // To prevent it from showing over the sidepane if chat type is not overlay
51
- zIndex: isOverlayChat ? 20 : 1,
63
+ zIndex: isOverlayChat && isChatOpen ? 20 : 1,
52
64
  },
53
65
  }}
54
66
  >
@@ -63,7 +75,11 @@ export const Footer = ({
63
75
  >
64
76
  {isMobile ? <LeaveRoom screenType={screenType} /> : null}
65
77
  <AudioVideoToggle />
66
- {isMobile ? null : <Suspense fallback={<></>}>{isVideoOn ? <VirtualBackground /> : null}</Suspense>}
78
+ {isMobile ? null : (
79
+ <Suspense fallback={<></>}>
80
+ <VirtualBackground />
81
+ </Suspense>
82
+ )}
67
83
  </AppFooter.Left>
68
84
  <AppFooter.Center
69
85
  css={{
@@ -76,7 +92,7 @@ export const Footer = ({
76
92
  {isMobile ? (
77
93
  <>
78
94
  {screenType === 'hls_live_streaming' ? <RaiseHand /> : null}
79
- {elements?.chat && <ChatToggle openByDefault={openByDefault} />}
95
+ {elements?.chat && <ChatToggle />}
80
96
  <MoreSettings elements={elements} screenType={screenType} />
81
97
  </>
82
98
  ) : (
@@ -89,7 +105,7 @@ export const Footer = ({
89
105
  )}
90
106
  </AppFooter.Center>
91
107
  <AppFooter.Right>
92
- {!isMobile && elements?.chat && <ChatToggle openByDefault={openByDefault} />}
108
+ {!isMobile && elements?.chat && <ChatToggle />}
93
109
  {elements?.participant_list && <ParticipantCount />}
94
110
  <MoreSettings elements={elements} screenType={screenType} />
95
111
  </AppFooter.Right>
@@ -21,7 +21,6 @@ import {
21
21
  } from '@100mslive/react-icons';
22
22
  import { Box, config as cssConfig, Dropdown, Flex, Input, Text, textEllipsis } from '../../..';
23
23
  import IconButton from '../../IconButton';
24
- import { ChatParticipantHeader } from '../Chat/ChatParticipantHeader';
25
24
  import { ConnectionIndicator } from '../Connection/ConnectionIndicator';
26
25
  import { ToastManager } from '../Toast/ToastManager';
27
26
  import { RoleAccordion } from './RoleAccordion';
@@ -61,7 +60,6 @@ export const ParticipantList = () => {
61
60
  return (
62
61
  <Fragment>
63
62
  <Flex direction="column" css={{ size: '100%', gap: '$4' }}>
64
- <ChatParticipantHeader activeTabValue={SIDE_PANE_OPTIONS.PARTICIPANTS} />
65
63
  {!filter?.search && participants.length === 0 ? null : <ParticipantSearch onSearch={onSearch} inSidePane />}
66
64
  {participants.length === 0 ? (
67
65
  <Flex align="center" justify="center" css={{ w: '100%', p: '$8 0' }}>
@@ -121,10 +119,11 @@ const VirtualizedParticipants = ({ peersOrderedByRoles = {}, isConnected, filter
121
119
  direction="column"
122
120
  css={{
123
121
  gap: '$8',
124
- maxHeight: '100%',
125
122
  overflowY: 'auto',
126
123
  overflowX: 'hidden',
127
- pr: '$3',
124
+ pr: '$10',
125
+ mr: '-$10',
126
+ flex: '1 1 0',
128
127
  }}
129
128
  >
130
129
  <RoleAccordion
@@ -318,7 +317,7 @@ export const ParticipantSearch = ({ onSearch, placeholder, inSidePane = false })
318
317
  <Flex
319
318
  align="center"
320
319
  css={{
321
- p: isMobile ? '$0 $6' : '$2 0',
320
+ p: isMobile ? '0' : '$2 0',
322
321
  mb: '$2',
323
322
  position: 'relative',
324
323
  color: '$on_surface_medium',
@@ -46,7 +46,7 @@ export const RoleAccordion = ({
46
46
  const height = ROW_HEIGHT * peerList.length;
47
47
 
48
48
  return (
49
- <Flex direction="column" css={{ flexGrow: 1, '&:hover .role_actions': { visibility: 'visible' } }} ref={ref}>
49
+ <Flex direction="column" css={{ '&:hover .role_actions': { visibility: 'visible' } }} ref={ref}>
50
50
  <Accordion.Root
51
51
  type="single"
52
52
  collapsible
@@ -1,8 +1,7 @@
1
- import React, { useState } from 'react';
2
- import { useMedia } from 'react-use';
3
- import { selectDominantSpeaker, selectIsConnectedToRoom, useHMSStore } from '@100mslive/react-sdk';
1
+ import React, { useEffect, useState } from 'react';
2
+ import { selectDominantSpeaker, useHMSStore } from '@100mslive/react-sdk';
4
3
  import { VolumeOneIcon } from '@100mslive/react-icons';
5
- import { config as cssConfig, Flex, styled, Text, textEllipsis, VerticalDivider } from '../../../';
4
+ import { Flex, styled, Text, textEllipsis, VerticalDivider } from '../../../';
6
5
  import { useRoomLayout } from '../../provider/roomLayoutProvider';
7
6
 
8
7
  export const SpeakerTag = () => {
@@ -37,13 +36,15 @@ const LogoImg = styled('img', {
37
36
  export const Logo = () => {
38
37
  const roomLayout = useRoomLayout();
39
38
  const logo = roomLayout?.logo?.url;
40
- const isMobile = useMedia(cssConfig.media.md);
41
- const isConnected = useHMSStore(selectIsConnectedToRoom);
42
39
  const [hideImage, setHideImage] = useState(false);
43
40
  // Hide logo for now as there is not enough space
44
- if (isConnected && isMobile) {
45
- return null;
46
- }
41
+ useEffect(() => {
42
+ if (hideImage) {
43
+ setHideImage(false);
44
+ }
45
+ // eslint-disable-next-line react-hooks/exhaustive-deps
46
+ }, [logo]);
47
+
47
48
  return logo && !hideImage ? (
48
49
  <LogoImg
49
50
  src={logo}
@@ -120,6 +120,7 @@ export const InsetTile = () => {
120
120
  canMinimise
121
121
  isDragabble
122
122
  {...videoTileProps}
123
+ hideParticipantNameOnTile
123
124
  />
124
125
  )}
125
126
  </Box>
@@ -16,9 +16,11 @@ import { useDropdownList } from '../hooks/useDropdownList';
16
16
  export const DesktopLeaveRoom = ({
17
17
  leaveRoom,
18
18
  screenType,
19
+ endRoom,
19
20
  }: {
20
21
  leaveRoom: (args: { endstream: boolean }) => void;
21
22
  screenType: keyof ConferencingScreen;
23
+ endRoom: () => void;
22
24
  }) => {
23
25
  const [open, setOpen] = useState(false);
24
26
  const [showLeaveRoomAlert, setShowLeaveRoomAlert] = useState(false);
@@ -26,7 +28,7 @@ export const DesktopLeaveRoom = ({
26
28
  const isConnected = useHMSStore(selectIsConnectedToRoom);
27
29
  const permissions = useHMSStore(selectPermissions);
28
30
  const { isStreamingOn } = useRecordingStreaming();
29
- const showStream = permissions?.hlsStreaming && isStreamingOn;
31
+ const showStream = screenType !== 'hls_live_streaming' && isStreamingOn;
30
32
 
31
33
  useDropdownList({ open: open || showEndStreamAlert || showLeaveRoomAlert, name: 'LeaveRoom' });
32
34
 
@@ -36,7 +38,7 @@ export const DesktopLeaveRoom = ({
36
38
 
37
39
  return (
38
40
  <Fragment>
39
- {permissions.hlsStreaming ? (
41
+ {screenType !== 'hls_live_streaming' && (permissions?.hlsStreaming || permissions?.endRoom) ? (
40
42
  <Flex>
41
43
  <LeaveIconButton
42
44
  key="LeaveRoom"
@@ -46,11 +48,7 @@ export const DesktopLeaveRoom = ({
46
48
  borderBottomRightRadius: 0,
47
49
  }}
48
50
  onClick={() => {
49
- if (screenType === 'hls_live_streaming') {
50
- setShowLeaveRoomAlert(true);
51
- } else {
52
- leaveRoom({ endstream: false });
53
- }
51
+ leaveRoom({ endstream: false });
54
52
  }}
55
53
  >
56
54
  <Tooltip title="Leave Room">
@@ -94,7 +92,7 @@ export const DesktopLeaveRoom = ({
94
92
  css={{ p: 0 }}
95
93
  />
96
94
  </Dropdown.Item>
97
- {isStreamingOn && permissions?.hlsStreaming ? (
95
+ {permissions?.endRoom || permissions?.hlsStreaming ? (
98
96
  <Dropdown.Item
99
97
  css={{
100
98
  bg: '$alert_error_dim',
@@ -148,7 +146,7 @@ export const DesktopLeaveRoom = ({
148
146
  <Dialog.Content css={{ w: 'min(420px, 90%)', p: '$8', bg: '$surface_dim' }}>
149
147
  <EndSessionContent
150
148
  setShowEndStreamAlert={setShowEndStreamAlert}
151
- leaveRoom={leaveRoom}
149
+ leaveRoom={isStreamingOn ? leaveRoom : endRoom}
152
150
  isStreamingOn={isStreamingOn}
153
151
  isModal
154
152
  />
@@ -46,6 +46,10 @@ export const LeaveRoom = ({ screenType }: { screenType: keyof ConferencingScreen
46
46
  ToastManager.addToast({ title: 'Error in stopping the stream', type: 'error' });
47
47
  }
48
48
  };
49
+ const endRoom = () => {
50
+ hmsActions.endRoom(false, 'End Room');
51
+ redirectToLeave();
52
+ };
49
53
 
50
54
  const leaveRoom = async ({ endstream = false }) => {
51
55
  if (endstream || (hlsState.running && peersWithStreamingRights.length === 1)) {
@@ -59,8 +63,8 @@ export const LeaveRoom = ({ screenType }: { screenType: keyof ConferencingScreen
59
63
  return null;
60
64
  }
61
65
  return isMobile ? (
62
- <MwebLeaveRoom leaveRoom={leaveRoom} screenType={screenType} />
66
+ <MwebLeaveRoom leaveRoom={leaveRoom} screenType={screenType} endRoom={endRoom} />
63
67
  ) : (
64
- <DesktopLeaveRoom leaveRoom={leaveRoom} screenType={screenType} />
68
+ <DesktopLeaveRoom leaveRoom={leaveRoom} screenType={screenType} endRoom={endRoom} />
65
69
  );
66
70
  };
@@ -17,9 +17,11 @@ import { useDropdownList } from '../hooks/useDropdownList';
17
17
  export const MwebLeaveRoom = ({
18
18
  leaveRoom,
19
19
  screenType,
20
+ endRoom,
20
21
  }: {
21
22
  leaveRoom: (args: { endstream: boolean }) => void;
22
23
  screenType: keyof ConferencingScreen;
24
+ endRoom: () => void;
23
25
  }) => {
24
26
  const [open, setOpen] = useState(false);
25
27
  const [showLeaveRoomAlert, setShowLeaveRoomAlert] = useState(false);
@@ -27,8 +29,8 @@ export const MwebLeaveRoom = ({
27
29
  const isConnected = useHMSStore(selectIsConnectedToRoom);
28
30
  const permissions = useHMSStore(selectPermissions);
29
31
  const { isStreamingOn } = useRecordingStreaming();
32
+ const showStream = screenType !== 'hls_live_streaming' && isStreamingOn;
30
33
 
31
- const showStream = permissions?.hlsStreaming && isStreamingOn;
32
34
  useDropdownList({ open, name: 'LeaveRoom' });
33
35
 
34
36
  if (!permissions || !isConnected) {
@@ -37,7 +39,7 @@ export const MwebLeaveRoom = ({
37
39
 
38
40
  return (
39
41
  <Fragment>
40
- {permissions?.hlsStreaming ? (
42
+ {screenType !== 'hls_live_streaming' ? (
41
43
  <Sheet.Root open={open} onOpenChange={setOpen}>
42
44
  <Sheet.Trigger asChild>
43
45
  <LeaveIconButton
@@ -67,7 +69,8 @@ export const MwebLeaveRoom = ({
67
69
  onClick={() => leaveRoom({ endstream: false })}
68
70
  css={{ pt: 0, mt: '$10', color: '$on_surface_low', '&:hover': { color: '$on_surface_high' } }}
69
71
  />
70
- {isStreamingOn && permissions?.hlsStreaming ? (
72
+
73
+ {permissions?.endRoom || permissions?.hlsStreaming ? (
71
74
  <LeaveCard
72
75
  title={showStream ? 'End Stream' : 'End Session'}
73
76
  subtitle={`The will end the ${
@@ -108,7 +111,7 @@ export const MwebLeaveRoom = ({
108
111
  <Sheet.Content css={{ bg: '$surface_dim', p: '$10', pb: '$12' }}>
109
112
  <EndSessionContent
110
113
  setShowEndStreamAlert={setShowEndStreamAlert}
111
- leaveRoom={leaveRoom}
114
+ leaveRoom={isStreamingOn ? leaveRoom : endRoom}
112
115
  isStreamingOn={isStreamingOn}
113
116
  />
114
117
  </Sheet.Content>
@@ -266,7 +266,7 @@ export const MwebOptions = ({
266
266
  </Box>
267
267
  </Sheet.Content>
268
268
  </Sheet.Root>
269
- <SettingsModal open={openSettingsSheet} onOpenChange={setOpenSettingsSheet} />
269
+ <SettingsModal open={openSettingsSheet} onOpenChange={setOpenSettingsSheet} screenType={screenType} />
270
270
  {openModals.has(MODALS.MUTE_ALL) && (
271
271
  <MuteAllModal onOpenChange={(value: boolean) => updateState(MODALS.MUTE_ALL, value)} isMobile />
272
272
  )}
@@ -53,8 +53,8 @@ export function Notifications() {
53
53
  if (roomState !== HMSRoomState.Connected) {
54
54
  return;
55
55
  }
56
- // Don't toast message when metadata is updated and raiseHand is false.
57
- // Don't toast message in case of local peer.
56
+ // Don't show toast message when metadata is updated and raiseHand is false.
57
+ // Don't show toast message in case of local peer.
58
58
  const metadata = getMetadata(notification.data?.metadata);
59
59
  if (!metadata?.isHandRaised || notification.data.isLocal) return;
60
60
 
@@ -108,7 +108,7 @@ export function Notifications() {
108
108
  title: `Error: ${notification.data?.message} - ${notification.data?.description}`,
109
109
  });
110
110
  break;
111
- case HMSNotificationTypes.ROLE_UPDATED:
111
+ case HMSNotificationTypes.ROLE_UPDATED: {
112
112
  if (notification.data?.isLocal) {
113
113
  ToastManager.addToast({
114
114
  title: `You are now a ${notification.data.roleName}`,
@@ -116,6 +116,7 @@ export function Notifications() {
116
116
  updateRoomLayoutForRole(notification.data.roleName);
117
117
  }
118
118
  break;
119
+ }
119
120
  case HMSNotificationTypes.CHANGE_TRACK_STATE_REQUEST:
120
121
  const track = notification.data?.track;
121
122
  if (!notification.data.enabled) {
@@ -246,7 +246,6 @@ export const PreviewTile = ({ name, error }: { name: string; error?: boolean })
246
246
  };
247
247
 
248
248
  export const PreviewControls = ({ hideSettings }: { hideSettings: boolean }) => {
249
- const isVideoOn = useHMSStore(selectIsLocalVideoEnabled);
250
249
  const isMobile = useMedia(cssConfig.media.md);
251
250
 
252
251
  return (
@@ -258,8 +257,8 @@ export const PreviewControls = ({ hideSettings }: { hideSettings: boolean }) =>
258
257
  }}
259
258
  >
260
259
  <Flex css={{ gap: '$4' }}>
261
- <AudioVideoToggle compact />
262
- <Suspense fallback="">{isVideoOn && !isMobile ? <VirtualBackground /> : null}</Suspense>
260
+ <AudioVideoToggle />
261
+ <Suspense fallback="">{!isMobile ? <VirtualBackground /> : null}</Suspense>
263
262
  </Flex>
264
263
  {!hideSettings ? <PreviewSettings /> : null}
265
264
  </Flex>
@@ -27,9 +27,10 @@ export const RoleChangeRequestModal = () => {
27
27
  if (!roleChangeRequest?.role) {
28
28
  return;
29
29
  }
30
-
31
- hmsActions.preview({ asRole: roleChangeRequest.role.name });
32
- }, [hmsActions, roleChangeRequest]);
30
+ (async () => {
31
+ await hmsActions.preview({ asRole: roleChangeRequest.role.name });
32
+ })();
33
+ }, [hmsActions, roleChangeRequest, currentRole, updateMetaData]);
33
34
 
34
35
  if (!roleChangeRequest?.role) {
35
36
  return null;
@@ -34,11 +34,6 @@ const Tile = ({ peerId, width = '100%', height = '100%' }) => {
34
34
  const isAudioOnly = useUISettings(UI_SETTINGS.isAudioOnly);
35
35
  const [isMouseHovered, setIsMouseHovered] = useState(false);
36
36
  const showStatsOnTiles = useUISettings(UI_SETTINGS.showStatsOnTiles);
37
- const label = getVideoTileLabel({
38
- peerName: peer.name,
39
- isLocal: false,
40
- track,
41
- });
42
37
  const fullscreenRef = useRef(null);
43
38
  // fullscreen is for desired state
44
39
  const [fullscreen, setFullscreen] = useState(false);
@@ -56,6 +51,13 @@ const Tile = ({ peerId, width = '100%', height = '100%' }) => {
56
51
  if (!peer) {
57
52
  return null;
58
53
  }
54
+
55
+ const label = getVideoTileLabel({
56
+ peerName: peer?.name,
57
+ isLocal: false,
58
+ track,
59
+ });
60
+
59
61
  return (
60
62
  <StyledVideoTile.Root css={{ width, height, p: 0, minHeight: 0 }} data-testid="screenshare_tile">
61
63
  <StyledVideoTile.Container
@@ -85,8 +87,14 @@ const Tile = ({ peerId, width = '100%', height = '100%' }) => {
85
87
  />
86
88
  ) : null}
87
89
  <StyledVideoTile.Info css={labelStyles}>{label}</StyledVideoTile.Info>
88
- {isMouseHovered && !peer?.isLocal ? (
89
- <TileMenu isScreenshare peerID={peer?.id} audioTrackID={audioTrack?.id} videoTrackID={track?.id} />
90
+ {isMouseHovered && !peer.isLocal ? (
91
+ <TileMenu
92
+ isScreenshare
93
+ peerID={peer.id}
94
+ audioTrackID={audioTrack?.id}
95
+ videoTrackID={track?.id}
96
+ enableSpotlightingPeer={false}
97
+ />
90
98
  ) : null}
91
99
  </StyledVideoTile.Container>
92
100
  </StyledVideoTile.Root>