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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (232) hide show
  1. package/dist/{HLSView-P57IRMAR.js → HLSView-HNVYG5VE.js} +309 -151
  2. package/dist/HLSView-HNVYG5VE.js.map +7 -0
  3. package/dist/Prebuilt/App.d.ts +3 -0
  4. package/dist/Prebuilt/AppContext.d.ts +13 -0
  5. package/dist/Prebuilt/common/PeersSorter.d.ts +21 -0
  6. package/dist/Prebuilt/components/Chat/ChatFooter.d.ts +7 -0
  7. package/dist/Prebuilt/components/Connection/ConnectionIndicator.d.ts +6 -0
  8. package/dist/Prebuilt/components/Connection/TileConnection.d.ts +10 -0
  9. package/dist/Prebuilt/components/Footer/ChatToggle.d.ts +4 -0
  10. package/dist/Prebuilt/components/Footer/Footer.d.ts +6 -0
  11. package/dist/Prebuilt/components/Footer/RoleAccordion.d.ts +14 -0
  12. package/dist/Prebuilt/components/Footer/RoleOptions.d.ts +6 -0
  13. package/dist/Prebuilt/components/Header/Header.d.ts +2 -0
  14. package/dist/Prebuilt/components/Header/StreamActions.d.ts +11 -0
  15. package/dist/Prebuilt/components/InsetTile.d.ts +2 -0
  16. package/dist/Prebuilt/components/Leave/DesktopLeaveRoom.d.ts +8 -0
  17. package/dist/Prebuilt/components/Leave/EndSessionContent.d.ts +9 -0
  18. package/dist/Prebuilt/components/Leave/LeaveAtoms.d.ts +2196 -0
  19. package/dist/Prebuilt/components/Leave/LeaveCard.d.ts +11 -0
  20. package/dist/Prebuilt/components/Leave/LeaveRoom.d.ts +5 -0
  21. package/dist/Prebuilt/components/Leave/LeaveSessionContent.d.ts +8 -0
  22. package/dist/Prebuilt/components/Leave/MwebLeaveRoom.d.ts +8 -0
  23. package/dist/Prebuilt/components/MoreSettings/MoreSettings.d.ts +6 -0
  24. package/dist/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.d.ts +6 -0
  25. package/dist/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.d.ts +6 -0
  26. package/dist/Prebuilt/components/Pagination.d.ts +6 -0
  27. package/dist/Prebuilt/components/Preview/PreviewContainer.d.ts +3 -0
  28. package/dist/Prebuilt/components/Preview/PreviewForm.d.ts +10 -0
  29. package/dist/Prebuilt/components/Preview/PreviewJoin.d.ts +16 -0
  30. package/dist/Prebuilt/components/RoleChangeRequestModal.d.ts +2 -0
  31. package/dist/Prebuilt/components/SecondaryTiles.d.ts +3 -0
  32. package/dist/Prebuilt/components/VideoLayouts/EqualProminence.d.ts +3 -0
  33. package/dist/Prebuilt/components/VideoLayouts/Grid.d.ts +6 -0
  34. package/dist/Prebuilt/components/VideoLayouts/GridLayout.d.ts +12 -0
  35. package/dist/Prebuilt/components/VideoLayouts/ProminenceLayout.d.ts +15 -0
  36. package/dist/Prebuilt/components/VideoLayouts/RoleProminence.d.ts +3 -0
  37. package/dist/Prebuilt/components/VideoLayouts/ScreenshareLayout.d.ts +3 -0
  38. package/dist/Prebuilt/components/VideoLayouts/interface.d.ts +9 -0
  39. package/dist/Prebuilt/components/hooks/useAutoStartStreaming.d.ts +1 -0
  40. package/dist/Prebuilt/components/hooks/useRedirectToLeave.d.ts +3 -0
  41. package/dist/Prebuilt/components/hooks/useRoleProminencePeers.d.ts +5 -0
  42. package/dist/Prebuilt/components/hooks/useTileLayout.d.ts +13 -0
  43. package/dist/Prebuilt/components/hooks/useVideoTileLayout.d.ts +13 -0
  44. package/dist/Prebuilt/layouts/SidePane.d.ts +9 -0
  45. package/dist/Prebuilt/layouts/VideoStreamingSection.d.ts +7 -0
  46. package/dist/Prebuilt/plugins/whiteboard/ToggleWhiteboard.d.ts +5 -0
  47. package/dist/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.d.ts +1 -0
  48. package/dist/Prebuilt/provider/roomLayoutProvider/hooks/useInsetEnabled.d.ts +1 -0
  49. package/dist/Prebuilt/provider/roomLayoutProvider/hooks/useRoomLayoutScreen.d.ts +17 -0
  50. package/dist/Prebuilt/provider/roomLayoutProvider/index.d.ts +6 -1
  51. package/dist/{VirtualBackground-GGCQJ5JM.js → VirtualBackground-UM2FOUHQ.js} +5 -11
  52. package/dist/VirtualBackground-UM2FOUHQ.js.map +7 -0
  53. package/dist/{chunk-P5X32KOD.js → chunk-364HP22I.js} +8 -5
  54. package/dist/chunk-364HP22I.js.map +7 -0
  55. package/dist/{chunk-OSM4QEQG.js → chunk-LYSAET4G.js} +3742 -5462
  56. package/dist/chunk-LYSAET4G.js.map +7 -0
  57. package/dist/chunk-POE7H4IE.js +898 -0
  58. package/dist/chunk-POE7H4IE.js.map +7 -0
  59. package/dist/conference-UWLJHMB2.js +5727 -0
  60. package/dist/conference-UWLJHMB2.js.map +7 -0
  61. package/dist/index.cjs.js +9655 -15326
  62. package/dist/index.cjs.js.map +4 -4
  63. package/dist/index.js +2 -2
  64. package/dist/meta.cjs.json +2513 -3456
  65. package/dist/meta.esbuild.json +2807 -3838
  66. package/package.json +8 -7
  67. package/src/Button/Button.tsx +2 -2
  68. package/src/Prebuilt/App.tsx +58 -53
  69. package/src/Prebuilt/{AppContext.jsx → AppContext.tsx} +11 -3
  70. package/src/Prebuilt/IconButton.jsx +11 -0
  71. package/src/Prebuilt/Prebuilt.stories.tsx +1 -0
  72. package/src/Prebuilt/common/{PeersSorter.js → PeersSorter.ts} +16 -11
  73. package/src/Prebuilt/common/constants.js +4 -114
  74. package/src/Prebuilt/common/hooks.js +34 -1
  75. package/src/Prebuilt/common/utils.js +1 -9
  76. package/src/Prebuilt/components/AppData/AppData.jsx +11 -15
  77. package/src/Prebuilt/components/AppData/useUISettings.js +6 -10
  78. package/src/Prebuilt/components/AudioVideoToggle.jsx +10 -2
  79. package/src/Prebuilt/components/AuthToken.jsx +11 -42
  80. package/src/Prebuilt/components/Chat/Chat.jsx +75 -27
  81. package/src/Prebuilt/components/Chat/ChatBody.jsx +95 -36
  82. package/src/Prebuilt/components/Chat/ChatFooter.tsx +199 -0
  83. package/src/Prebuilt/components/Chat/ChatParticipantHeader.jsx +84 -0
  84. package/src/Prebuilt/components/Chat/ChatSelector.jsx +16 -17
  85. package/src/Prebuilt/components/Chat/ChatSelectorContainer.jsx +81 -0
  86. package/src/Prebuilt/components/Chat/useEmojiPickerStyles.js +5 -4
  87. package/src/Prebuilt/components/Connection/{ConnectionIndicator.jsx → ConnectionIndicator.tsx} +12 -4
  88. package/src/Prebuilt/components/Connection/TileConnection.tsx +71 -0
  89. package/src/Prebuilt/components/EmojiReaction.jsx +19 -22
  90. package/src/Prebuilt/components/Footer/{ChatToggle.jsx → ChatToggle.tsx} +13 -9
  91. package/src/Prebuilt/components/Footer/Footer.tsx +98 -0
  92. package/src/Prebuilt/components/Footer/ParticipantList.jsx +187 -179
  93. package/src/Prebuilt/components/Footer/RoleAccordion.tsx +94 -0
  94. package/src/Prebuilt/components/Footer/RoleOptions.tsx +155 -0
  95. package/src/Prebuilt/components/FullPageProgress.jsx +3 -3
  96. package/src/Prebuilt/components/HMSVideo/Controls.jsx +3 -2
  97. package/src/Prebuilt/components/HMSVideo/HLSQualitySelector.jsx +63 -18
  98. package/src/Prebuilt/components/HMSVideo/HMSVideo.jsx +2 -2
  99. package/src/Prebuilt/components/HMSVideo/PlayButton.jsx +1 -1
  100. package/src/Prebuilt/components/HMSVideo/VideoProgress.jsx +5 -6
  101. package/src/Prebuilt/components/HMSVideo/VideoTime.jsx +3 -3
  102. package/src/Prebuilt/components/HMSVideo/VolumeControl.jsx +38 -9
  103. package/src/Prebuilt/components/Header/{ConferencingHeader.jsx → Header.tsx} +9 -7
  104. package/src/Prebuilt/components/Header/HeaderComponents.jsx +13 -4
  105. package/src/Prebuilt/components/Header/{StreamActions.jsx → StreamActions.tsx} +54 -67
  106. package/src/Prebuilt/components/Header/common.jsx +5 -2
  107. package/src/Prebuilt/components/Header/index.tsx +1 -0
  108. package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.jsx +23 -4
  109. package/src/Prebuilt/components/InsetTile.tsx +128 -0
  110. package/src/Prebuilt/components/{MoreSettings/SplitComponents/DesktopLeaveRoom.jsx → Leave/DesktopLeaveRoom.tsx} +67 -25
  111. package/src/Prebuilt/components/{EndSessionContent.jsx → Leave/EndSessionContent.tsx} +18 -11
  112. package/src/Prebuilt/components/Leave/LeaveAtoms.tsx +26 -0
  113. package/src/Prebuilt/components/Leave/LeaveCard.tsx +36 -0
  114. package/src/Prebuilt/components/Leave/LeaveRoom.tsx +66 -0
  115. package/src/Prebuilt/components/{LeaveSessionContent.jsx → Leave/LeaveSessionContent.tsx} +20 -6
  116. package/src/Prebuilt/components/{MoreSettings/SplitComponents/MwebLeaveRoom.jsx → Leave/MwebLeaveRoom.tsx} +43 -18
  117. package/src/Prebuilt/components/MetaActions.jsx +15 -23
  118. package/src/Prebuilt/components/MoreSettings/ActionTile.jsx +5 -0
  119. package/src/Prebuilt/components/MoreSettings/ChangeNameContent.jsx +16 -7
  120. package/src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx +1 -1
  121. package/src/Prebuilt/components/MoreSettings/FullScreenItem.jsx +1 -4
  122. package/src/Prebuilt/components/MoreSettings/MoreSettings.tsx +27 -0
  123. package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.tsx +216 -0
  124. package/src/Prebuilt/components/MoreSettings/SplitComponents/{MwebOptions.jsx → MwebOptions.tsx} +107 -45
  125. package/src/Prebuilt/components/Notifications/HLSFailureModal.jsx +3 -1
  126. package/src/Prebuilt/components/Notifications/Notifications.jsx +46 -30
  127. package/src/Prebuilt/components/Notifications/PeerNotifications.jsx +14 -2
  128. package/src/Prebuilt/components/Notifications/PermissionErrorModal.jsx +10 -4
  129. package/src/Prebuilt/components/Notifications/ReconnectNotifications.jsx +5 -11
  130. package/src/Prebuilt/components/PIP/PIPComponent.jsx +7 -16
  131. package/src/Prebuilt/components/PIP/PIPManager.js +1 -0
  132. package/src/Prebuilt/components/Pagination.tsx +60 -0
  133. package/src/Prebuilt/components/Playlist/Playlist.jsx +1 -6
  134. package/src/Prebuilt/components/PostLeave.jsx +7 -7
  135. package/src/Prebuilt/components/Preview/{PreviewContainer.jsx → PreviewContainer.tsx} +16 -15
  136. package/src/Prebuilt/components/Preview/{PreviewForm.jsx → PreviewForm.tsx} +16 -8
  137. package/src/Prebuilt/components/Preview/{PreviewJoin.jsx → PreviewJoin.tsx} +48 -22
  138. package/src/Prebuilt/components/RaiseHand.jsx +0 -7
  139. package/src/Prebuilt/components/RoleChangeRequestModal.tsx +119 -0
  140. package/src/Prebuilt/components/ScreenshareDisplay.jsx +4 -10
  141. package/src/Prebuilt/components/ScreenshareTile.jsx +43 -36
  142. package/src/Prebuilt/components/SecondaryTiles.tsx +36 -0
  143. package/src/Prebuilt/components/Settings/LayoutSettings.jsx +2 -12
  144. package/src/Prebuilt/components/Settings/NotificationSettings.jsx +3 -9
  145. package/src/Prebuilt/components/Settings/SettingsModal.jsx +3 -9
  146. package/src/Prebuilt/components/StatsForNerds.jsx +3 -1
  147. package/src/Prebuilt/components/TileMenu/TileMenu.jsx +16 -17
  148. package/src/Prebuilt/components/TileMenu/TileMenuContent.jsx +33 -27
  149. package/src/Prebuilt/components/Toast/ToastConfig.jsx +58 -15
  150. package/src/Prebuilt/components/VideoLayouts/EqualProminence.tsx +65 -0
  151. package/src/Prebuilt/components/VideoLayouts/Grid.tsx +43 -0
  152. package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +110 -0
  153. package/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +74 -0
  154. package/src/Prebuilt/components/VideoLayouts/RoleProminence.tsx +59 -0
  155. package/src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx +52 -0
  156. package/src/Prebuilt/components/VideoLayouts/interface.ts +10 -0
  157. package/src/Prebuilt/components/VideoTile.jsx +116 -74
  158. package/src/Prebuilt/components/conference.jsx +86 -85
  159. package/src/Prebuilt/components/hooks/useAutoStartStreaming.tsx +57 -0
  160. package/src/Prebuilt/components/hooks/useMetadata.jsx +19 -3
  161. package/src/Prebuilt/components/hooks/useRedirectToLeave.tsx +34 -0
  162. package/src/Prebuilt/components/hooks/useRoleProminencePeers.tsx +38 -0
  163. package/src/Prebuilt/components/hooks/useTileLayout.tsx +127 -0
  164. package/src/Prebuilt/components/hooks/useVideoTileLayout.ts +26 -0
  165. package/src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx +5 -72
  166. package/src/Prebuilt/components/pdfAnnotator/submitPdf.jsx +4 -45
  167. package/src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx +2 -17
  168. package/src/Prebuilt/components/peerTileUtils.jsx +1 -1
  169. package/src/Prebuilt/images/empty-chat.svg +12 -0
  170. package/src/Prebuilt/layouts/EmbedView.jsx +17 -50
  171. package/src/Prebuilt/layouts/HLSView.jsx +138 -51
  172. package/src/Prebuilt/layouts/PDFView.jsx +1 -11
  173. package/src/Prebuilt/layouts/SidePane.tsx +108 -0
  174. package/src/Prebuilt/layouts/VideoStreamingSection.tsx +96 -0
  175. package/src/Prebuilt/layouts/WhiteboardView.jsx +10 -34
  176. package/src/Prebuilt/plugins/FlyingEmoji.jsx +14 -2
  177. package/src/Prebuilt/plugins/VirtualBackground/VirtualBackground.jsx +1 -4
  178. package/src/Prebuilt/plugins/whiteboard/{ToggleWhiteboard.jsx → ToggleWhiteboard.tsx} +5 -9
  179. package/src/Prebuilt/primitives/DialogContent.jsx +15 -11
  180. package/src/Prebuilt/provider/roomLayoutProvider/constants/index.ts +17 -2
  181. package/src/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.ts +36 -13
  182. package/src/Prebuilt/provider/roomLayoutProvider/hooks/useInsetEnabled.ts +10 -0
  183. package/src/Prebuilt/provider/roomLayoutProvider/hooks/useRoomLayoutScreen.ts +65 -0
  184. package/src/Prebuilt/provider/roomLayoutProvider/index.tsx +17 -6
  185. package/src/Prebuilt/services/FeatureFlags.jsx +0 -1
  186. package/src/VideoTile/StyledVideoTile.tsx +1 -0
  187. package/dist/HLSView-P57IRMAR.js.map +0 -7
  188. package/dist/PinnedTrackView-4FYJEBTB.js +0 -102
  189. package/dist/PinnedTrackView-4FYJEBTB.js.map +0 -7
  190. package/dist/VirtualBackground-GGCQJ5JM.js.map +0 -7
  191. package/dist/chunk-IVTWKQI3.js +0 -827
  192. package/dist/chunk-IVTWKQI3.js.map +0 -7
  193. package/dist/chunk-OSM4QEQG.js.map +0 -7
  194. package/dist/chunk-P5X32KOD.js.map +0 -7
  195. package/dist/chunk-RVCZPPTL.js +0 -1100
  196. package/dist/chunk-RVCZPPTL.js.map +0 -7
  197. package/dist/conference-P6I6ESVF.js +0 -8995
  198. package/dist/conference-P6I6ESVF.js.map +0 -7
  199. package/src/Prebuilt/components/AudioLevel/BeamSpeakerLabelsLogging.jsx +0 -16
  200. package/src/Prebuilt/components/Chat/ChatFooter.jsx +0 -150
  201. package/src/Prebuilt/components/Chat/ChatHeader.jsx +0 -67
  202. package/src/Prebuilt/components/Connection/TileConnection.jsx +0 -39
  203. package/src/Prebuilt/components/EqualProminence.jsx +0 -180
  204. package/src/Prebuilt/components/FirstPersonDisplay.jsx +0 -50
  205. package/src/Prebuilt/components/Footer/Footer.jsx +0 -73
  206. package/src/Prebuilt/components/Header/Header.jsx +0 -8
  207. package/src/Prebuilt/components/Header/StreamingHeader.jsx +0 -54
  208. package/src/Prebuilt/components/LeaveCard.jsx +0 -19
  209. package/src/Prebuilt/components/LeaveRoom.jsx +0 -94
  210. package/src/Prebuilt/components/MoreSettings/MoreSettings.jsx +0 -10
  211. package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.jsx +0 -219
  212. package/src/Prebuilt/components/Notifications/MessageNotifications.jsx +0 -25
  213. package/src/Prebuilt/components/Pagination.jsx +0 -29
  214. package/src/Prebuilt/components/RoleChangeRequestModal.jsx +0 -26
  215. package/src/Prebuilt/components/VideoList.jsx +0 -73
  216. package/src/Prebuilt/components/gridView.jsx +0 -85
  217. package/src/Prebuilt/components/hooks/useFeatures.js +0 -22
  218. package/src/Prebuilt/components/hooks/useNavigation.js +0 -19
  219. package/src/Prebuilt/components/hooks/useSkipPreview.jsx +0 -20
  220. package/src/Prebuilt/components/pdfAnnotator/pdfErrorView.jsx +0 -29
  221. package/src/Prebuilt/images/Logo.svg +0 -8
  222. package/src/Prebuilt/layouts/ActiveSpeakerView.jsx +0 -34
  223. package/src/Prebuilt/layouts/InsetView.jsx +0 -260
  224. package/src/Prebuilt/layouts/PinnedTrackView.jsx +0 -59
  225. package/src/Prebuilt/layouts/SidePane.jsx +0 -52
  226. package/src/Prebuilt/layouts/mainGridView.jsx +0 -98
  227. package/src/Prebuilt/layouts/mainView.jsx +0 -141
  228. package/src/Prebuilt/layouts/screenShareView.jsx +0 -183
  229. /package/{src/Prebuilt/components/Header/index.jsx → dist/Prebuilt/components/Header/index.d.ts} +0 -0
  230. /package/src/Prebuilt/components/{ScreenShare.jsx → ScreenShareToggle.jsx} +0 -0
  231. /package/src/{assets → Prebuilt/images}/android-perm-1.png +0 -0
  232. /package/src/{assets → Prebuilt/images}/ios-perm-0.png +0 -0
@@ -5,9 +5,7 @@ import { Box, Dropdown, Flex, Text, Tooltip } from '../../../';
5
5
  import IconButton from '../../IconButton';
6
6
  import { AudioPlaylistControls } from './PlaylistControls';
7
7
  import { PlaylistItem } from './PlaylistItem';
8
- import { useIsFeatureEnabled } from '../hooks/useFeatures';
9
8
  import { usePlaylist } from '../hooks/usePlaylist';
10
- import { FEATURE_LIST } from '../../common/constants';
11
9
 
12
10
  const BrowseAndPlayFromLocal = ({ type, actions }) => {
13
11
  return (
@@ -44,10 +42,7 @@ export const Playlist = ({ type }) => {
44
42
  const [open, setOpen] = useState(false);
45
43
  const [collapse, setCollapse] = useState(false);
46
44
  const isAllowedToPublish = useHMSStore(selectIsAllowedToPublish);
47
- const isFeatureEnabled = useIsFeatureEnabled(
48
- isAudioPlaylist ? FEATURE_LIST.AUDIO_PLAYLIST : FEATURE_LIST.VIDEO_PLAYLIST,
49
- );
50
- if (!isAllowedToPublish.screen || playlist.length === 0 || !isFeatureEnabled) {
45
+ if (!isAllowedToPublish.screen || playlist.length === 0) {
51
46
  return null;
52
47
  }
53
48
 
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { useParams } from 'react-router-dom';
2
+ import { useNavigate, useParams } from 'react-router-dom';
3
3
  import { ExitIcon } from '@100mslive/react-icons';
4
4
  import { ToastManager } from './Toast/ToastManager';
5
5
  import { Button } from '../../Button';
@@ -7,14 +7,14 @@ import { Box, Flex } from '../../Layout';
7
7
  import { Text } from '../../Text';
8
8
  import { useHMSPrebuiltContext } from '../AppContext';
9
9
  import { Header } from './Header';
10
- import { useNavigation } from './hooks/useNavigation';
10
+ import { useRoomLayoutPreviewScreen } from '../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
11
11
  import { defaultPreviewPreference, UserPreferencesKeys, useUserPreferences } from './hooks/useUserPreferences';
12
- import { getRoutePrefix } from '../common/utils';
13
12
  import { textEllipsis } from '../../utils';
14
13
 
15
14
  const PostLeave = () => {
16
- const navigate = useNavigation();
17
- const { showPreview, roomCode } = useHMSPrebuiltContext();
15
+ const navigate = useNavigate();
16
+ const { isPreviewScreenEnabled } = useRoomLayoutPreviewScreen();
17
+ const { roomCode } = useHMSPrebuiltContext();
18
18
  const { roomId, role } = useParams();
19
19
  const [previewPreference] = useUserPreferences(UserPreferencesKeys.PREVIEW, defaultPreviewPreference);
20
20
  return (
@@ -32,7 +32,7 @@ const PostLeave = () => {
32
32
  👋
33
33
  </Text>
34
34
  <Text variant="h4" css={{ color: '$on_surface_high', fontWeight: '$semiBold', mt: '$12' }}>
35
- You left the {getRoutePrefix() ? 'stream' : 'room'}
35
+ You left the room
36
36
  </Text>
37
37
  <Text
38
38
  variant="body1"
@@ -57,7 +57,7 @@ const PostLeave = () => {
57
57
  </Text>
58
58
  <Button
59
59
  onClick={() => {
60
- let redirectUrl = `${showPreview ? '/preview/' : '/meeting/'}${roomCode || roomId}`;
60
+ let redirectUrl = `${isPreviewScreenEnabled ? '/preview/' : '/meeting/'}${roomCode || roomId}`;
61
61
  if (role && roomId) redirectUrl += '/' + role;
62
62
  navigate(redirectUrl);
63
63
  ToastManager.clearAllToast();
@@ -1,20 +1,23 @@
1
1
  import React from 'react';
2
- import { useParams } from 'react-router-dom';
2
+ import { useNavigate, useParams } from 'react-router-dom';
3
3
  import { useSearchParam } from 'react-use';
4
- import { Flex } from '../../../';
4
+ import { Flex } from '../../..';
5
5
  import { useHMSPrebuiltContext } from '../../AppContext';
6
- import SidePane from '../../layouts/SidePane';
7
6
  import { useRoomLayout } from '../../provider/roomLayoutProvider';
7
+ // @ts-ignore: No implicit Any
8
8
  import FullPageProgress from '../FullPageProgress';
9
+ // @ts-ignore: No implicit Any
9
10
  import PreviewJoin from './PreviewJoin';
11
+ import { useRoomLayoutPreviewScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
12
+ // @ts-ignore: No implicit Any
10
13
  import { useAuthToken } from '../AppData/useUISettings';
11
- import { useNavigation } from '../hooks/useNavigation';
12
- import { useSkipPreview } from '../hooks/useSkipPreview';
14
+ // @ts-ignore: No implicit Any
13
15
  import { QUERY_PARAM_PREVIEW_AS_ROLE } from '../../common/constants';
14
16
 
15
17
  const PreviewContainer = () => {
16
- const navigate = useNavigation();
17
- const skipPreview = useSkipPreview();
18
+ const navigate = useNavigate();
19
+ const { isPreviewScreenEnabled } = useRoomLayoutPreviewScreen();
20
+ const skipPreview = !isPreviewScreenEnabled;
18
21
  const previewAsRole = useSearchParam(QUERY_PARAM_PREVIEW_AS_ROLE);
19
22
  const { userName } = useHMSPrebuiltContext();
20
23
  const initialName = userName || (skipPreview ? 'Beam' : '');
@@ -38,17 +41,15 @@ const PreviewContainer = () => {
38
41
  align="center"
39
42
  >
40
43
  {authToken && Object.keys(previewHeader).length > 0 ? (
41
- <PreviewJoin initialName={initialName} skipPreview={skipPreview} asRole={previewAsRole} onJoin={onJoin} />
44
+ <PreviewJoin
45
+ initialName={initialName}
46
+ skipPreview={skipPreview}
47
+ asRole={previewAsRole ?? undefined}
48
+ onJoin={onJoin}
49
+ />
42
50
  ) : (
43
51
  <FullPageProgress />
44
52
  )}
45
- <SidePane
46
- css={{
47
- position: 'unset',
48
- mr: '$10',
49
- '@lg': { position: 'fixed', mr: '$0' },
50
- }}
51
- />
52
53
  </Flex>
53
54
  </Flex>
54
55
  );
@@ -1,11 +1,12 @@
1
1
  import React from 'react';
2
2
  import { useMedia } from 'react-use';
3
- import { selectPermissions, useHMSStore, useRecordingStreaming } from '@100mslive/react-sdk';
3
+ import { JoinForm_JoinBtnType } from '@100mslive/types-prebuilt/elements/join_form';
4
+ import { useRecordingStreaming } from '@100mslive/react-sdk';
4
5
  import { RadioIcon } from '@100mslive/react-icons';
5
6
  import { Button, config as cssConfig, Flex, Input, styled } from '../../..';
6
7
  import { useRoomLayout } from '../../provider/roomLayoutProvider';
8
+ // @ts-ignore: No implicit Any
7
9
  import { PreviewSettings } from './PreviewJoin';
8
- import { useShowStreamingUI } from '../../common/hooks';
9
10
 
10
11
  const PreviewForm = ({
11
12
  name,
@@ -14,18 +15,22 @@ const PreviewForm = ({
14
15
  enableJoin,
15
16
  cannotPublishVideo = false,
16
17
  cannotPublishAudio = false,
18
+ }: {
19
+ name: string;
20
+ onChange: (name: string) => void;
21
+ onJoin: () => void;
22
+ enableJoin: boolean;
23
+ cannotPublishVideo: boolean;
24
+ cannotPublishAudio: boolean;
17
25
  }) => {
18
- const formSubmit = e => {
26
+ const formSubmit = (e: React.SyntheticEvent) => {
19
27
  e.preventDefault();
20
28
  };
21
- const mediaQueryLg = cssConfig.media.md;
22
- const isMobile = useMedia(mediaQueryLg);
29
+ const isMobile = useMedia(cssConfig.media.md);
23
30
  const { isHLSRunning } = useRecordingStreaming();
24
- const permissions = useHMSStore(selectPermissions);
25
31
  const layout = useRoomLayout();
26
32
  const { join_form: joinForm = {} } = layout?.screens?.preview?.default?.elements || {};
27
- const showStreamingUI = useShowStreamingUI();
28
- const showGoLive = showStreamingUI && !isHLSRunning && permissions?.hlsStreaming;
33
+ const showGoLive = joinForm?.join_btn_type === JoinForm_JoinBtnType.JOIN_BTN_TYPE_JOIN_AND_GO_LIVE && !isHLSRunning;
29
34
 
30
35
  return (
31
36
  <Form
@@ -45,6 +50,9 @@ const PreviewForm = ({
45
50
  onKeyDown={e => {
46
51
  if (e.key === 'Enter' && name.trim().length > 0) {
47
52
  e.preventDefault();
53
+ if (isMobile) {
54
+ return;
55
+ }
48
56
  onJoin();
49
57
  }
50
58
  }}
@@ -1,4 +1,5 @@
1
1
  import React, { Fragment, Suspense, useCallback, useEffect, useState } from 'react';
2
+ import { useMedia } from 'react-use';
2
3
  import {
3
4
  HMSRoomState,
4
5
  selectIsLocalVideoEnabled,
@@ -12,22 +13,37 @@ import {
12
13
  useRecordingStreaming,
13
14
  } from '@100mslive/react-sdk';
14
15
  import { MicOffIcon, SettingsIcon } from '@100mslive/react-icons';
15
- import { Avatar, Box, Flex, flexCenter, styled, StyledVideoTile, Text, useBorderAudioLevel, Video } from '../../../';
16
+ import { Avatar, Box, config as cssConfig, Flex, flexCenter, styled, StyledVideoTile, Text, Video } from '../../..';
16
17
  import { useHMSPrebuiltContext } from '../../AppContext';
18
+ // @ts-ignore: No implicit Any
17
19
  import IconButton from '../../IconButton';
18
20
  import { useRoomLayout } from '../../provider/roomLayoutProvider';
21
+ // @ts-ignore: No implicit Any
19
22
  import { AudioVideoToggle } from '../AudioVideoToggle';
23
+ // @ts-ignore: No implicit Any
20
24
  import Chip from '../Chip';
25
+ // @ts-ignore: No implicit Any
21
26
  import TileConnection from '../Connection/TileConnection';
27
+ // @ts-ignore: No implicit Any
22
28
  import FullPageProgress from '../FullPageProgress';
29
+ // @ts-ignore: No implicit Any
23
30
  import { Logo } from '../Header/HeaderComponents';
31
+ // @ts-ignore: No implicit Any
24
32
  import SettingsModal from '../Settings/SettingsModal';
33
+ // @ts-ignore: No implicit Any
34
+ import { AudioLevel } from '../VideoTile';
35
+ // @ts-ignore: No implicit Any
25
36
  import PreviewForm from './PreviewForm';
37
+ // @ts-ignore: No implicit Any
26
38
  import { useAuthToken, useUISettings } from '../AppData/useUISettings';
39
+ // @ts-ignore: No implicit Any
27
40
  import { defaultPreviewPreference, UserPreferencesKeys, useUserPreferences } from '../hooks/useUserPreferences';
41
+ // @ts-ignore: No implicit Any
28
42
  import { getFormattedCount } from '../../common/utils';
43
+ // @ts-ignore: No implicit Any
29
44
  import { UI_SETTINGS } from '../../common/constants';
30
45
 
46
+ // @ts-ignore: No implicit Any
31
47
  const VirtualBackground = React.lazy(() => import('../../plugins/VirtualBackground/VirtualBackground'));
32
48
 
33
49
  const getParticipantChipContent = (peerCount = 0) => {
@@ -38,7 +54,17 @@ const getParticipantChipContent = (peerCount = 0) => {
38
54
  return `${formattedNum} other${parseInt(formattedNum) === 1 ? '' : 's'} in the session`;
39
55
  };
40
56
 
41
- const PreviewJoin = ({ onJoin, skipPreview, initialName, asRole }) => {
57
+ const PreviewJoin = ({
58
+ onJoin,
59
+ skipPreview,
60
+ initialName,
61
+ asRole,
62
+ }: {
63
+ onJoin: () => void;
64
+ skipPreview?: boolean;
65
+ initialName?: string;
66
+ asRole?: string;
67
+ }) => {
42
68
  const [previewPreference, setPreviewPreference] = useUserPreferences(
43
69
  UserPreferencesKeys.PREVIEW,
44
70
  defaultPreviewPreference,
@@ -46,7 +72,7 @@ const PreviewJoin = ({ onJoin, skipPreview, initialName, asRole }) => {
46
72
  const { isStreamingOn } = useRecordingStreaming();
47
73
  const authToken = useAuthToken();
48
74
  const [name, setName] = useState(initialName || previewPreference.name);
49
- const { isLocalAudioEnabled, isLocalVideoEnabled, toggleAudio, toggleVideo } = useAVToggle();
75
+ const { toggleAudio, toggleVideo } = useAVToggle();
50
76
  const [previewError, setPreviewError] = useState(false);
51
77
  const { endpoints } = useHMSPrebuiltContext();
52
78
  const { peerCount } = useParticipants();
@@ -72,12 +98,10 @@ const PreviewJoin = ({ onJoin, skipPreview, initialName, asRole }) => {
72
98
  const savePreferenceAndJoin = useCallback(() => {
73
99
  setPreviewPreference({
74
100
  name,
75
- isAudioMuted: !isLocalAudioEnabled,
76
- isVideoMuted: !isLocalVideoEnabled,
77
101
  });
78
102
  join();
79
103
  onJoin && onJoin();
80
- }, [join, isLocalAudioEnabled, isLocalVideoEnabled, name, setPreviewPreference, onJoin]);
104
+ }, [join, name, setPreviewPreference, onJoin]);
81
105
  const roomLayout = useRoomLayout();
82
106
 
83
107
  const { preview_header: previewHeader = {} } = roomLayout?.screens?.preview?.default?.elements || {};
@@ -143,11 +167,7 @@ const PreviewJoin = ({ onJoin, skipPreview, initialName, asRole }) => {
143
167
  </Flex>
144
168
  ) : null}
145
169
  <Box css={{ w: '100%', maxWidth: '640px' }}>
146
- <PreviewControls
147
- enableJoin={enableJoin}
148
- savePreferenceAndJoin={savePreferenceAndJoin}
149
- hideSettings={!toggleVideo && !toggleAudio}
150
- />
170
+ <PreviewControls hideSettings={!toggleVideo && !toggleAudio} />
151
171
  <PreviewForm
152
172
  name={name}
153
173
  onChange={setName}
@@ -170,30 +190,32 @@ const Container = styled('div', {
170
190
  px: '$10',
171
191
  });
172
192
 
173
- const PreviewTile = ({ name, error }) => {
193
+ export const PreviewTile = ({ name, error }: { name: string; error?: boolean }) => {
174
194
  const localPeer = useHMSStore(selectLocalPeer);
175
- const borderAudioRef = useBorderAudioLevel(localPeer?.audioTrack);
176
195
  const { isLocalAudioEnabled, toggleAudio } = useAVToggle();
177
196
  const isVideoOn = useHMSStore(selectIsLocalVideoEnabled);
178
197
  const mirrorLocalVideo = useUISettings(UI_SETTINGS.mirrorLocalVideo);
179
198
  const trackSelector = selectVideoTrackByID(localPeer?.videoTrack);
180
199
  const track = useHMSStore(trackSelector);
181
200
  const showMuteIcon = !isLocalAudioEnabled || !toggleAudio;
182
-
201
+ const videoTrack = useHMSStore(selectVideoTrackByID(localPeer?.videoTrack));
202
+ const isMobile = useMedia(cssConfig.media.md);
203
+ const aspectRatio =
204
+ videoTrack?.width && videoTrack?.height ? videoTrack.width / videoTrack.height : isMobile ? 9 / 16 : 16 / 9;
183
205
  return (
184
206
  <StyledVideoTile.Container
185
207
  css={{
186
208
  bg: '$surface_default',
187
- aspectRatio: 16 / 9,
188
- width: 'min(640px, 80vw)',
209
+ aspectRatio,
210
+ height: 'min(640px, 40vh)',
211
+ maxWidth: '640px',
189
212
  overflow: 'clip',
190
213
  '@md': {
191
- aspectRatio: 9 / 16,
192
- width: 'min(275px, 70vw)',
214
+ width: 'min(220px, 70vw)',
193
215
  maxWidth: '100%',
216
+ my: '$4',
194
217
  },
195
218
  }}
196
- ref={borderAudioRef}
197
219
  >
198
220
  {localPeer ? (
199
221
  <>
@@ -216,13 +238,17 @@ const PreviewTile = ({ name, error }) => {
216
238
  <StyledVideoTile.AudioIndicator size="medium">
217
239
  <MicOffIcon />
218
240
  </StyledVideoTile.AudioIndicator>
219
- ) : null}
241
+ ) : (
242
+ <AudioLevel trackId={localPeer?.audioTrack} />
243
+ )}
220
244
  </StyledVideoTile.Container>
221
245
  );
222
246
  };
223
247
 
224
- const PreviewControls = ({ hideSettings }) => {
248
+ export const PreviewControls = ({ hideSettings }: { hideSettings: boolean }) => {
225
249
  const isVideoOn = useHMSStore(selectIsLocalVideoEnabled);
250
+ const isMobile = useMedia(cssConfig.media.md);
251
+
226
252
  return (
227
253
  <Flex
228
254
  justify="between"
@@ -233,7 +259,7 @@ const PreviewControls = ({ hideSettings }) => {
233
259
  >
234
260
  <Flex css={{ gap: '$4' }}>
235
261
  <AudioVideoToggle compact />
236
- <Suspense fallback="">{isVideoOn ? <VirtualBackground /> : null}</Suspense>
262
+ <Suspense fallback="">{isVideoOn && !isMobile ? <VirtualBackground /> : null}</Suspense>
237
263
  </Flex>
238
264
  {!hideSettings ? <PreviewSettings /> : null}
239
265
  </Flex>
@@ -3,20 +3,13 @@ import { selectLocalPeer, selectPeerMetadata, useHMSStore } from '@100mslive/rea
3
3
  import { HandIcon } from '@100mslive/react-icons';
4
4
  import { Tooltip } from '../../Tooltip';
5
5
  import IconButton from '../IconButton';
6
- import { useIsFeatureEnabled } from './hooks/useFeatures';
7
6
  import { useMyMetadata } from './hooks/useMetadata';
8
- import { FEATURE_LIST } from '../common/constants';
9
7
 
10
8
  export const RaiseHand = () => {
11
- const isHandRaiseEnabled = useIsFeatureEnabled(FEATURE_LIST.HAND_RAISE);
12
9
  const { toggleHandRaise } = useMyMetadata();
13
10
  const localPeer = useHMSStore(selectLocalPeer);
14
11
  const isHandRaised = useHMSStore(selectPeerMetadata(localPeer.id))?.isHandRaised || false;
15
12
 
16
- if (!isHandRaiseEnabled) {
17
- return null;
18
- }
19
-
20
13
  return (
21
14
  <Tooltip title={isHandRaised ? 'Lower hand' : 'Raise hand'}>
22
15
  <IconButton active={!isHandRaised} onClick={toggleHandRaise}>
@@ -0,0 +1,119 @@
1
+ import React, { useEffect } from 'react';
2
+ import {
3
+ selectLocalPeerName,
4
+ selectLocalPeerRoleName,
5
+ selectRoleChangeRequest,
6
+ useCustomEvent,
7
+ useHMSActions,
8
+ useHMSStore,
9
+ } from '@100mslive/react-sdk';
10
+ // @ts-ignore: No implicit Any
11
+ import { PreviewControls, PreviewTile } from './Preview/PreviewJoin';
12
+ import { Box, Button, Dialog, Flex, Text } from '../..';
13
+ // @ts-ignore: No implicit Any
14
+ import { useMyMetadata } from './hooks/useMetadata';
15
+ // @ts-ignore: No implicit Any
16
+ import { ROLE_CHANGE_DECLINED } from '../common/constants';
17
+
18
+ export const RoleChangeRequestModal = () => {
19
+ const hmsActions = useHMSActions();
20
+ const { updateMetaData } = useMyMetadata();
21
+ const currentRole = useHMSStore(selectLocalPeerRoleName);
22
+ const roleChangeRequest = useHMSStore(selectRoleChangeRequest);
23
+ const name = useHMSStore(selectLocalPeerName);
24
+ const { sendEvent } = useCustomEvent({ type: ROLE_CHANGE_DECLINED });
25
+
26
+ useEffect(() => {
27
+ if (!roleChangeRequest?.role) {
28
+ return;
29
+ }
30
+
31
+ hmsActions.preview({ asRole: roleChangeRequest.role.name });
32
+ }, [hmsActions, roleChangeRequest]);
33
+
34
+ if (!roleChangeRequest?.role) {
35
+ return null;
36
+ }
37
+
38
+ const body = (
39
+ <>
40
+ <Text css={{ fontWeight: 400, c: '$on_surface_medium', textAlign: 'center' }}>
41
+ Setup your audio and video before joining
42
+ </Text>
43
+ <Flex
44
+ align="center"
45
+ justify="center"
46
+ css={{
47
+ '@sm': { width: '100%' },
48
+ flexDirection: 'column',
49
+ mt: '$6',
50
+ }}
51
+ >
52
+ <PreviewTile name={name || ''} />
53
+ <PreviewControls hideSettings={true} />
54
+ </Flex>
55
+ </>
56
+ );
57
+
58
+ return (
59
+ <RequestDialog
60
+ title={`You're invited to join the ${roleChangeRequest.role.name} role`}
61
+ onOpenChange={async value => {
62
+ if (!value) {
63
+ await hmsActions.rejectChangeRole(roleChangeRequest);
64
+ sendEvent({ ...roleChangeRequest, peerName: name }, { peerId: roleChangeRequest.requestedBy?.id });
65
+ await hmsActions.cancelMidCallPreview();
66
+ await updateMetaData({ isHandRaised: false });
67
+ }
68
+ }}
69
+ body={body}
70
+ onAction={async () => {
71
+ await hmsActions.acceptChangeRole(roleChangeRequest);
72
+ await updateMetaData({ isHandRaised: false, prevRole: currentRole });
73
+ }}
74
+ actionText="Accept"
75
+ />
76
+ );
77
+ };
78
+
79
+ const RequestDialog = ({
80
+ open = true,
81
+ onOpenChange,
82
+ title,
83
+ body,
84
+ actionText = 'Accept',
85
+ onAction,
86
+ }: {
87
+ open?: boolean;
88
+ onOpenChange: (value: boolean) => void;
89
+ title: string;
90
+ body: React.ReactNode;
91
+ actionText?: string;
92
+ onAction: () => void;
93
+ }) => (
94
+ <Dialog.Root open={open} onOpenChange={onOpenChange}>
95
+ <Dialog.Portal>
96
+ <Dialog.Overlay />
97
+ <Dialog.Content css={{ p: '$10' }}>
98
+ <Dialog.Title css={{ p: 0, display: 'flex', flexDirection: 'row', gap: '$md', justifyContent: 'center' }}>
99
+ <Text variant="h6">{title}</Text>
100
+ </Dialog.Title>
101
+ <Box css={{ mt: '$4', mb: '$10' }}>{body}</Box>
102
+ <Flex justify="center" align="center" css={{ width: '100%', gap: '$md' }}>
103
+ <Box css={{ width: '50%' }}>
104
+ <Dialog.Close css={{ width: '100%' }}>
105
+ <Button variant="standard" outlined css={{ width: '100%' }}>
106
+ Cancel
107
+ </Button>
108
+ </Dialog.Close>
109
+ </Box>
110
+ <Box css={{ width: '50%' }}>
111
+ <Button variant="primary" css={{ width: '100%' }} onClick={onAction}>
112
+ {actionText}
113
+ </Button>
114
+ </Box>
115
+ </Flex>
116
+ </Dialog.Content>
117
+ </Dialog.Portal>
118
+ </Dialog.Root>
119
+ );
@@ -14,24 +14,18 @@ export const ScreenshareDisplay = () => {
14
14
  align="center"
15
15
  justify="center"
16
16
  css={{
17
- position: 'relative',
18
- overflow: 'hidden',
19
- w: '37.5rem',
20
- maxWidth: '80%',
21
- h: '100%',
22
- r: '$3',
23
- m: '0 auto',
24
- color: '$on_surface_high',
17
+ size: '100%',
25
18
  bg: '$background_default',
26
- textAlign: 'center',
19
+ color: '$on_surface_high',
27
20
  }}
28
21
  >
29
22
  <ShareScreenIcon width={48} height={48} />
30
- <Text variant="h5" css={{ m: '$8 0', color: '$on_surface_high' }}>
23
+ <Text variant="h5" css={{ m: '$8 0' }}>
31
24
  You are sharing your screen
32
25
  </Text>
33
26
  <Button
34
27
  variant="danger"
28
+ css={{ fontWeight: '$semiBold' }}
35
29
  onClick={async () => {
36
30
  await hmsActions.setScreenShareEnabled(false);
37
31
  }}
@@ -14,15 +14,16 @@ import { VideoTileStats } from '../../Stats';
14
14
  import { Video } from '../../Video';
15
15
  import { StyledVideoTile } from '../../VideoTile';
16
16
  import { getVideoTileLabel } from './peerTileUtils';
17
- import { useIsHeadless, useUISettings } from './AppData/useUISettings';
17
+ import { ScreenshareDisplay } from './ScreenshareDisplay';
18
+ import { useUISettings } from './AppData/useUISettings';
18
19
  import { UI_SETTINGS } from '../common/constants';
19
20
 
20
21
  const labelStyles = {
21
22
  position: 'unset',
22
23
  width: '100%',
23
24
  textAlign: 'center',
25
+ c: '$on_surface_high',
24
26
  transform: 'none',
25
- mt: '$2',
26
27
  flexShrink: 0,
27
28
  };
28
29
 
@@ -31,7 +32,6 @@ const Tile = ({ peerId, width = '100%', height = '100%' }) => {
31
32
  const track = useHMSStore(selectScreenShareByPeerID(peerId));
32
33
  const peer = useHMSStore(selectPeerByID(peerId));
33
34
  const isAudioOnly = useUISettings(UI_SETTINGS.isAudioOnly);
34
- const isHeadless = useIsHeadless();
35
35
  const [isMouseHovered, setIsMouseHovered] = useState(false);
36
36
  const showStatsOnTiles = useUISettings(UI_SETTINGS.showStatsOnTiles);
37
37
  const label = getVideoTileLabel({
@@ -48,40 +48,47 @@ const Tile = ({ peerId, width = '100%', height = '100%' }) => {
48
48
  });
49
49
  const isFullScreenSupported = screenfull.isEnabled;
50
50
  const audioTrack = useHMSStore(selectScreenShareAudioByPeerID(peer?.id));
51
+
52
+ if (isLocal && !['browser', 'window', 'application'].includes(track?.displaySurface)) {
53
+ return <ScreenshareDisplay />;
54
+ }
55
+
56
+ if (!peer) {
57
+ return null;
58
+ }
51
59
  return (
52
- <StyledVideoTile.Root css={{ width, height, p: 0 }} data-testid="screenshare_tile">
53
- {peer ? (
54
- <StyledVideoTile.Container
55
- transparentBg
56
- ref={fullscreenRef}
57
- css={{ flexDirection: 'column' }}
58
- onMouseEnter={() => setIsMouseHovered(true)}
59
- onMouseLeave={() => {
60
- setIsMouseHovered(false);
61
- }}
62
- >
63
- {showStatsOnTiles ? (
64
- <VideoTileStats audioTrackID={audioTrack?.id} videoTrackID={track?.id} peerID={peerId} isLocal={isLocal} />
65
- ) : null}
66
- {isFullScreenSupported && !isHeadless ? (
67
- <StyledVideoTile.FullScreenButton onClick={() => setFullscreen(!fullscreen)}>
68
- {isFullscreen ? <ShrinkIcon /> : <ExpandIcon />}
69
- </StyledVideoTile.FullScreenButton>
70
- ) : null}
71
- {track ? (
72
- <Video
73
- screenShare={true}
74
- mirror={peer.isLocal && track?.source === 'regular'}
75
- attach={!isAudioOnly}
76
- trackId={track.id}
77
- />
78
- ) : null}
79
- <StyledVideoTile.Info css={labelStyles}>{label}</StyledVideoTile.Info>
80
- {isMouseHovered && !isHeadless && !peer?.isLocal ? (
81
- <TileMenu isScreenshare peerID={peer?.id} audioTrackID={audioTrack?.id} videoTrackID={track?.id} />
82
- ) : null}
83
- </StyledVideoTile.Container>
84
- ) : null}
60
+ <StyledVideoTile.Root css={{ width, height, p: 0, minHeight: 0 }} data-testid="screenshare_tile">
61
+ <StyledVideoTile.Container
62
+ transparentBg
63
+ ref={fullscreenRef}
64
+ css={{ flexDirection: 'column', gap: '$2' }}
65
+ onMouseEnter={() => setIsMouseHovered(true)}
66
+ onMouseLeave={() => {
67
+ setIsMouseHovered(false);
68
+ }}
69
+ >
70
+ {showStatsOnTiles ? (
71
+ <VideoTileStats audioTrackID={audioTrack?.id} videoTrackID={track?.id} peerID={peerId} isLocal={isLocal} />
72
+ ) : null}
73
+ {isFullScreenSupported && isMouseHovered ? (
74
+ <StyledVideoTile.FullScreenButton onClick={() => setFullscreen(!fullscreen)}>
75
+ {isFullscreen ? <ShrinkIcon /> : <ExpandIcon />}
76
+ </StyledVideoTile.FullScreenButton>
77
+ ) : null}
78
+ {track ? (
79
+ <Video
80
+ screenShare={true}
81
+ mirror={peer.isLocal && track?.source === 'regular'}
82
+ attach={!isAudioOnly}
83
+ trackId={track.id}
84
+ css={{ minHeight: 0 }}
85
+ />
86
+ ) : null}
87
+ <StyledVideoTile.Info css={labelStyles}>{label}</StyledVideoTile.Info>
88
+ {isMouseHovered && !peer?.isLocal ? (
89
+ <TileMenu isScreenshare peerID={peer?.id} audioTrackID={audioTrack?.id} videoTrackID={track?.id} />
90
+ ) : null}
91
+ </StyledVideoTile.Container>
85
92
  </StyledVideoTile.Root>
86
93
  );
87
94
  };
@@ -0,0 +1,36 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import { useMedia } from 'react-use';
3
+ import { LayoutProps } from './VideoLayouts/interface';
4
+ import { ProminenceLayout } from './VideoLayouts/ProminenceLayout';
5
+ import { config as cssConfig } from '../../Theme';
6
+ import { Pagination } from './Pagination';
7
+ import { usePagesWithTiles } from './hooks/useTileLayout';
8
+
9
+ export const SecondaryTiles = ({ peers, onPageChange, onPageSize, edgeToEdge }: LayoutProps) => {
10
+ const isMobile = useMedia(cssConfig.media.md);
11
+ const maxTileCount = isMobile ? 2 : 4;
12
+ const pagesWithTiles = usePagesWithTiles({ peers, maxTileCount });
13
+ const [page, setPage] = useState(0);
14
+ const pageSize = pagesWithTiles[0]?.length || 0;
15
+
16
+ useEffect(() => {
17
+ if (pageSize > 0) {
18
+ onPageSize?.(pageSize);
19
+ }
20
+ }, [pageSize, onPageSize]);
21
+
22
+ return (
23
+ <ProminenceLayout.SecondarySection tiles={pagesWithTiles[page]} edgeToEdge={edgeToEdge}>
24
+ {!edgeToEdge && (
25
+ <Pagination
26
+ page={page}
27
+ onPageChange={page => {
28
+ setPage(page);
29
+ onPageChange?.(page);
30
+ }}
31
+ numPages={pagesWithTiles.length}
32
+ />
33
+ )}
34
+ </ProminenceLayout.SecondarySection>
35
+ );
36
+ };