@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
@@ -0,0 +1,155 @@
1
+ import React, { useState } from 'react';
2
+ import { DefaultConferencingScreen_Elements } from '@100mslive/types-prebuilt';
3
+ import { HMSPeer, selectPermissions, useHMSActions, useHMSStore, useHMSVanillaStore } from '@100mslive/react-sdk';
4
+ import {
5
+ MicOffIcon,
6
+ MicOnIcon,
7
+ PersonRectangleIcon,
8
+ RemoveUserIcon,
9
+ VerticalMenuIcon,
10
+ VideoOffIcon,
11
+ VideoOnIcon,
12
+ } from '@100mslive/react-icons';
13
+ import { Dropdown } from '../../../Dropdown';
14
+ import { Flex } from '../../../Layout';
15
+ import { Text } from '../../../Text';
16
+ import { useRoomLayoutConferencingScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
17
+ // @ts-ignore: No implicit Any
18
+ import { getMetadata } from '../../common/utils';
19
+
20
+ const dropdownItemCSS = { backgroundColor: '$surface_default', gap: '$4', p: '$8' };
21
+ const optionTextCSS = { fontWeight: '$semiBold', color: '$on_surface_high', textTransform: 'none' };
22
+
23
+ export const RoleOptions = ({ roleName, peerList }: { roleName: string; peerList: HMSPeer[] }) => {
24
+ const [openOptions, setOpenOptions] = useState(false);
25
+ const permissions = useHMSStore(selectPermissions);
26
+ const hmsActions = useHMSActions();
27
+ const { elements } = useRoomLayoutConferencingScreen();
28
+ const { on_stage_role, off_stage_roles = [] } = (elements as DefaultConferencingScreen_Elements)?.on_stage_exp || {};
29
+
30
+ const vanillaStore = useHMSVanillaStore();
31
+ const store = vanillaStore.getState();
32
+
33
+ let allPeersHaveVideoOn = true;
34
+ let allPeersHaveAudioOn = true;
35
+
36
+ peerList.forEach(peer => {
37
+ const isAudioOn = !!peer.audioTrack && store.tracks[peer.audioTrack]?.enabled;
38
+ const isVideoOn = !!peer.videoTrack && store.tracks[peer.videoTrack]?.enabled;
39
+ allPeersHaveAudioOn = allPeersHaveAudioOn && isAudioOn;
40
+ allPeersHaveVideoOn = allPeersHaveVideoOn && isVideoOn;
41
+ });
42
+
43
+ const canMuteRole = permissions?.mute && roleName === on_stage_role;
44
+ const canRemoveRoleFromStage = permissions?.changeRole && roleName === on_stage_role;
45
+ // on stage and off stage roles
46
+ const canRemoveRoleFromRoom =
47
+ permissions?.removeOthers && (on_stage_role === roleName || off_stage_roles?.includes(roleName));
48
+
49
+ if (!(canMuteRole || canRemoveRoleFromStage || canRemoveRoleFromRoom)) {
50
+ return null;
51
+ }
52
+
53
+ const removeAllFromStage = () => {
54
+ peerList.forEach(peer => {
55
+ const prevRole = getMetadata(peer.metadata).prevRole;
56
+ if (prevRole) {
57
+ hmsActions.changeRoleOfPeer(peer.id, prevRole, true);
58
+ }
59
+ });
60
+ };
61
+
62
+ const setTrackEnabled = async (type: 'audio' | 'video', enabled = false) => {
63
+ try {
64
+ await hmsActions.setRemoteTracksEnabled({ roles: [roleName], source: 'regular', type, enabled });
65
+ } catch (e) {
66
+ console.error(e);
67
+ }
68
+ };
69
+
70
+ const removePeersFromRoom = async () => {
71
+ try {
72
+ peerList.forEach(async peer => {
73
+ await hmsActions.removePeer(peer.id, '');
74
+ });
75
+ } catch (e) {
76
+ console.error(e);
77
+ }
78
+ };
79
+
80
+ return (
81
+ <Dropdown.Root open={openOptions} onOpenChange={setOpenOptions}>
82
+ <Dropdown.Trigger
83
+ onClick={e => e.stopPropagation()}
84
+ className="role_actions"
85
+ asChild
86
+ css={{
87
+ p: '$1',
88
+ r: '$0',
89
+ c: '$on_surface_high',
90
+ visibility: openOptions ? 'visible' : 'hidden',
91
+ '&:hover': {
92
+ c: '$on_surface_medium',
93
+ },
94
+ '@md': {
95
+ visibility: 'visible',
96
+ },
97
+ }}
98
+ >
99
+ <Flex>
100
+ <VerticalMenuIcon />
101
+ </Flex>
102
+ </Dropdown.Trigger>
103
+ <Dropdown.Content
104
+ onClick={e => e.stopPropagation()}
105
+ css={{ w: 'max-content', maxWidth: '$64', bg: '$surface_default', py: 0 }}
106
+ align="end"
107
+ >
108
+ {canRemoveRoleFromStage && (
109
+ <Dropdown.Item
110
+ css={{ ...dropdownItemCSS, borderBottom: '1px solid $border_bright' }}
111
+ onClick={removeAllFromStage}
112
+ >
113
+ <PersonRectangleIcon />
114
+ <Text variant="sm" css={optionTextCSS}>
115
+ Remove all from Stage
116
+ </Text>
117
+ </Dropdown.Item>
118
+ )}
119
+
120
+ {canMuteRole && (
121
+ <>
122
+ <Dropdown.Item css={dropdownItemCSS} onClick={() => setTrackEnabled('audio', !allPeersHaveAudioOn)}>
123
+ {allPeersHaveAudioOn ? <MicOffIcon /> : <MicOnIcon />}
124
+ <Text variant="sm" css={optionTextCSS}>
125
+ {allPeersHaveAudioOn ? 'Mute' : 'Unmute'} Audio
126
+ </Text>
127
+ </Dropdown.Item>
128
+
129
+ <Dropdown.Item
130
+ css={{ ...dropdownItemCSS, borderTop: '1px solid $border_bright' }}
131
+ onClick={() => setTrackEnabled('video', !allPeersHaveVideoOn)}
132
+ >
133
+ {allPeersHaveVideoOn ? <VideoOffIcon /> : <VideoOnIcon />}
134
+ <Text variant="sm" css={optionTextCSS}>
135
+ {allPeersHaveVideoOn ? 'Mute' : 'Unmute'} Video
136
+ </Text>
137
+ </Dropdown.Item>
138
+ </>
139
+ )}
140
+
141
+ {canRemoveRoleFromRoom && (
142
+ <Dropdown.Item
143
+ css={{ ...dropdownItemCSS, borderTop: '1px solid $border_bright', color: '$alert_error_default' }}
144
+ onClick={removePeersFromRoom}
145
+ >
146
+ <RemoveUserIcon />
147
+ <Text variant="sm" css={{ ...optionTextCSS, color: 'inherit' }}>
148
+ Remove all from Room
149
+ </Text>
150
+ </Dropdown.Item>
151
+ )}
152
+ </Dropdown.Content>
153
+ </Dropdown.Root>
154
+ );
155
+ };
@@ -3,10 +3,10 @@ import { Flex } from '../../Layout';
3
3
  import { Loading } from '../../Loading';
4
4
  import { Text } from '../../Text';
5
5
 
6
- const FullPageProgress = ({ loaderColor = '$primary_default', loadingText = '' }) => (
7
- <Flex direction="column" justify="center" align="center" css={{ size: '100%', color: loaderColor }}>
6
+ const FullPageProgress = ({ loaderColor = '$primary_default', text = '', css = {} }) => (
7
+ <Flex direction="column" justify="center" align="center" css={{ size: '100%', color: loaderColor, ...css }}>
8
8
  <Loading color="currentColor" size={100} />
9
- {loadingText ? <Text css={{ mt: '$10', color: '$on_surface_high' }}>{loadingText}</Text> : null}
9
+ {text ? <Text css={{ mt: '$10', color: '$on_surface_high' }}>{text}</Text> : null}
10
10
  </Flex>
11
11
  );
12
12
 
@@ -3,6 +3,7 @@ import { Flex, styled } from '../../../';
3
3
  export const VideoControls = styled(Flex, {
4
4
  justifyContent: 'center',
5
5
  alignItems: 'center',
6
+ alignSelf: 'stretch',
6
7
  width: '100%',
7
8
  gap: '$2',
8
9
  });
@@ -11,11 +12,11 @@ export const LeftControls = styled(Flex, {
11
12
  justifyContent: 'flex-start',
12
13
  alignItems: 'center',
13
14
  width: '100%',
14
- gap: '$2',
15
+ gap: '$4',
15
16
  });
16
17
  export const RightControls = styled(Flex, {
17
18
  justifyContent: 'flex-end',
18
19
  alignItems: 'center',
19
20
  width: '100%',
20
- gap: '$2',
21
+ gap: '$4',
21
22
  });
@@ -1,12 +1,10 @@
1
- import React, { useState } from 'react';
2
- import { CheckCircleIcon, SettingsIcon } from '@100mslive/react-icons';
1
+ import React from 'react';
2
+ import { CheckIcon, SettingsIcon } from '@100mslive/react-icons';
3
3
  import { Box, Dropdown, Flex, Text, Tooltip } from '../../../';
4
4
 
5
- export function HLSQualitySelector({ layers, onQualityChange, selection, isAuto }) {
6
- const [qualityDropDownOpen, setQualityDropDownOpen] = useState(false);
7
-
5
+ export function HLSQualitySelector({ open, onOpen, layers, onQualityChange, selection, isAuto }) {
8
6
  return (
9
- <Dropdown.Root open={qualityDropDownOpen} onOpenChange={value => setQualityDropDownOpen(value)}>
7
+ <Dropdown.Root open={open} onOpenChange={value => onOpen(value)}>
10
8
  <Dropdown.Trigger asChild data-testid="quality_selector">
11
9
  <Flex
12
10
  css={{
@@ -24,6 +22,7 @@ export function HLSQualitySelector({ layers, onQualityChange, selection, isAuto
24
22
  h: '$9',
25
23
  display: 'inline-flex',
26
24
  alignItems: 'center',
25
+ c: '$on_surface_high',
27
26
  }}
28
27
  >
29
28
  <SettingsIcon />
@@ -34,7 +33,7 @@ export function HLSQualitySelector({ layers, onQualityChange, selection, isAuto
34
33
  '@sm': 'xs',
35
34
  '@xs': 'tiny',
36
35
  }}
37
- css={{ display: 'flex', alignItems: 'center', ml: '$2' }}
36
+ css={{ display: 'flex', alignItems: 'center', ml: '$2', c: '$on_surface_medium' }}
38
37
  >
39
38
  {isAuto && (
40
39
  <>
@@ -44,7 +43,7 @@ export function HLSQualitySelector({ layers, onQualityChange, selection, isAuto
44
43
  mx: '$2',
45
44
  w: '$2',
46
45
  h: '$2',
47
- background: '$on_primary_high',
46
+ background: '$on_surface_medium',
48
47
  r: '$1',
49
48
  }}
50
49
  />
@@ -57,26 +56,72 @@ export function HLSQualitySelector({ layers, onQualityChange, selection, isAuto
57
56
  </Flex>
58
57
  </Dropdown.Trigger>
59
58
  {layers.length > 0 && (
60
- <Dropdown.Content sideOffset={5} align="end" css={{ height: 'auto', maxHeight: '$96', w: '$64' }}>
61
- <Dropdown.Item onClick={() => onQualityChange({ height: 'auto' })} key="auto">
62
- <Text css={{ flex: '1 1 0' }}>Automatic</Text>
63
- {isAuto && <CheckCircleIcon />}
64
- </Dropdown.Item>
59
+ <Dropdown.Content
60
+ sideOffset={5}
61
+ align="end"
62
+ css={{
63
+ height: 'auto',
64
+ maxHeight: '$52',
65
+ w: '$40',
66
+ bg: '$surface_bright',
67
+ py: '$4',
68
+ gap: '$4',
69
+ display: 'grid',
70
+ }}
71
+ >
65
72
  {layers.map(layer => {
66
73
  return (
67
- <Dropdown.Item onClick={() => onQualityChange(layer)} key={layer.width}>
68
- <Text css={{ flex: '1 1 0' }}>{getQualityText(layer)}</Text>
74
+ <Dropdown.Item
75
+ onClick={() => onQualityChange(layer)}
76
+ key={layer.width}
77
+ css={{
78
+ bg:
79
+ !isAuto && layer.width === selection?.width && layer.height === selection?.height
80
+ ? '$surface_default'
81
+ : '$surface_bright',
82
+ '&:hover': {
83
+ bg: '$surface_brighter',
84
+ },
85
+ p: '$2 $4 $2 $8',
86
+ h: '$12',
87
+ gap: '$2',
88
+ }}
89
+ >
90
+ <Text variant="caption" css={{ fontWeight: '$semiBold' }}>
91
+ {getQualityText(layer)}
92
+ </Text>
93
+ <Text variant="caption" css={{ flex: '1 1 0', c: '$on_surface_low', pl: '$2' }}>
94
+ {getBitrateText(layer)}
95
+ </Text>
69
96
  {!isAuto && layer.width === selection?.width && layer.height === selection?.height && (
70
- <CheckCircleIcon />
97
+ <CheckIcon width="16px" height="16px" />
71
98
  )}
72
99
  </Dropdown.Item>
73
100
  );
74
101
  })}
102
+ <Dropdown.Item
103
+ onClick={() => onQualityChange({ height: 'auto' })}
104
+ key="auto"
105
+ css={{
106
+ bg: !isAuto ? '$surface_bright' : '$surface_default',
107
+ '&:hover': {
108
+ bg: '$surface_brighter',
109
+ },
110
+ p: '$2 $4 $2 $8',
111
+ h: '$12',
112
+ gap: '$2',
113
+ }}
114
+ >
115
+ <Text variant="caption" css={{ fontWeight: '$semiBold', flex: '1 1 0' }}>
116
+ Auto
117
+ </Text>
118
+ {isAuto && <CheckIcon width="16px" height="16px" />}
119
+ </Dropdown.Item>
75
120
  </Dropdown.Content>
76
121
  )}
77
122
  </Dropdown.Root>
78
123
  );
79
124
  }
80
125
 
81
- const getQualityText = layer =>
82
- `${Math.min(layer.height, layer.width)}p (${(Number(layer.bitrate / 1000) / 1000).toFixed(2)} Mbps)`;
126
+ const getQualityText = layer => `${Math.min(layer.height, layer.width)}p `;
127
+ const getBitrateText = layer => `(${(Number(layer.bitrate / 1000) / 1000).toFixed(2)} Mbps)`;
@@ -1,9 +1,9 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import { Flex } from '../../../';
3
3
 
4
- export const HMSVideo = forwardRef(({ children }, videoRef) => {
4
+ export const HMSVideo = forwardRef(({ children, ...props }, videoRef) => {
5
5
  return (
6
- <Flex data-testid="hms-video" css={{ size: '100%' }} direction="column">
6
+ <Flex data-testid="hms-video" css={{ size: '100%', position: 'relative' }} direction="column" {...props}>
7
7
  <video style={{ flex: '1 1 0', margin: '0 auto', minHeight: '0' }} ref={videoRef} playsInline />
8
8
  {children}
9
9
  </Flex>
@@ -6,7 +6,7 @@ export const PlayButton = ({ onClick, isPaused }) => {
6
6
  return (
7
7
  <Tooltip title={isPaused ? 'Play' : 'Pause'} side="top">
8
8
  <IconButton onClick={onClick} data-testid="play_pause_btn">
9
- {isPaused ? <PlayIcon width={32} height={32} /> : <PauseIcon width={32} height={32} />}
9
+ {isPaused ? <PlayIcon width={20} height={20} /> : <PauseIcon width={20} height={20} />}
10
10
  </IconButton>
11
11
  </Tooltip>
12
12
  );
@@ -44,7 +44,7 @@ export const VideoProgress = ({ onValueChange, hlsPlayer }) => {
44
44
  return hlsPlayer.getVideoElement() ? (
45
45
  <Flex
46
46
  ref={progressRootRef}
47
- css={{ paddingLeft: '$8', paddingRight: '$8', cursor: 'pointer' }}
47
+ css={{ cursor: 'pointer', h: '$4', alignSelf: 'stretch' }}
48
48
  onClick={onProgressChangeHandler}
49
49
  >
50
50
  <Box
@@ -53,23 +53,22 @@ export const VideoProgress = ({ onValueChange, hlsPlayer }) => {
53
53
  display: 'inline',
54
54
  width: `${videoProgress}%`,
55
55
  background: '$primary_default',
56
- height: '0.3rem',
57
56
  }}
58
57
  />
59
58
  <Box
60
59
  id="video-buffer"
61
60
  css={{
62
61
  width: `${bufferProgress - videoProgress}%`,
63
- background: '$primary_dim',
64
- height: '0.3rem',
62
+ background: '$on_surface_high',
63
+ opacity: '25%',
65
64
  }}
66
65
  />
67
66
  <Box
68
67
  id="video-rest"
69
68
  css={{
70
69
  width: `${100 - bufferProgress}%`,
71
- background: '$surface_brighter',
72
- height: '0.3rem',
70
+ background: '$on_surface_high',
71
+ opacity: '10%',
73
72
  }}
74
73
  />
75
74
  </Flex>
@@ -22,9 +22,9 @@ export const VideoTime = ({ hlsPlayer }) => {
22
22
  <Text
23
23
  css={{
24
24
  minWidth: '$16',
25
- }}
26
- variant={{
27
- '@sm': 'xs',
25
+ c: '$on_surface_medium',
26
+ display: 'flex',
27
+ justifyContent: 'center',
28
28
  }}
29
29
  >
30
30
  {videoTime}
@@ -1,18 +1,33 @@
1
1
  import React, { useState } from 'react';
2
- import { SpeakerIcon } from '@100mslive/react-icons';
2
+ import { VolumeOneIcon, VolumeTwoIcon, VolumeZeroIcon } from '@100mslive/react-icons';
3
3
  import { Flex, Slider } from '../../../';
4
4
 
5
5
  export const VolumeControl = ({ hlsPlayer }) => {
6
6
  const [volume, setVolume] = useState(hlsPlayer?.volume ?? 100);
7
+ const [showSlider, setShowSlider] = useState(false);
7
8
 
8
9
  return (
9
- <Flex align="center" css={{ color: '$on_primary_high' }}>
10
- <SpeakerIcon
11
- style={{ cursor: 'pointer' }}
10
+ <Flex
11
+ align="center"
12
+ css={{ color: '$on_surface_high' }}
13
+ onMouseOver={event => {
14
+ event.stopPropagation();
15
+ setShowSlider(true);
16
+ }}
17
+ onMouseLeave={event => {
18
+ event.stopPropagation();
19
+ setShowSlider(false);
20
+ }}
21
+ >
22
+ <VolumeIcon
23
+ volume={volume}
12
24
  onClick={() => {
13
- setVolume(0);
14
- if (hlsPlayer) {
15
- hlsPlayer.setVolume(0);
25
+ if (volume > 0) {
26
+ setVolume(0);
27
+ hlsPlayer?.setVolume(0);
28
+ } else {
29
+ setVolume(100);
30
+ hlsPlayer?.setVolume(100);
16
31
  }
17
32
  }}
18
33
  />
@@ -23,17 +38,31 @@ export const VolumeControl = ({ hlsPlayer }) => {
23
38
  cursor: 'pointer',
24
39
  '@sm': { w: '$14' },
25
40
  '@xs': { w: '$14' },
41
+ opacity: showSlider ? '1' : '0',
42
+ display: showSlider ? '' : 'none',
43
+ transition: `all .2s ease .5s`,
26
44
  }}
27
45
  min={0}
28
46
  max={100}
29
47
  step={1}
30
48
  value={[volume]}
31
49
  onValueChange={volume => {
32
- hlsPlayer.setVolume(volume);
33
- setVolume(volume);
50
+ hlsPlayer.setVolume(volume[0]);
51
+ setVolume(volume[0]);
34
52
  }}
35
53
  thumbStyles={{ w: '$6', h: '$6' }}
36
54
  />
37
55
  </Flex>
38
56
  );
39
57
  };
58
+
59
+ const VolumeIcon = ({ volume, onClick }) => {
60
+ if (volume === 0) {
61
+ return <VolumeZeroIcon style={{ cursor: 'pointer', transition: 'color 0.3s' }} onClick={onClick} />;
62
+ }
63
+ return volume < 50 ? (
64
+ <VolumeOneIcon style={{ cursor: 'pointer', transition: 'color 0.3s' }} onClick={onClick} />
65
+ ) : (
66
+ <VolumeTwoIcon style={{ cursor: 'pointer', transition: 'color 0.3s' }} onClick={onClick} />
67
+ );
68
+ };
@@ -1,17 +1,19 @@
1
1
  import React from 'react';
2
2
  import { useMedia } from 'react-use';
3
3
  import { HMSRoomState, selectRoomState, useHMSStore } from '@100mslive/react-sdk';
4
- import { config as cssConfig, Flex } from '../../../';
4
+ import { config as cssConfig, Flex } from '../../..';
5
+ // @ts-ignore: No implicit any
5
6
  import { Logo, SpeakerTag } from './HeaderComponents';
7
+ // @ts-ignore: No implicit any
6
8
  import { LiveStatus, RecordingStatus, StreamActions } from './StreamActions';
9
+ // @ts-ignore: No implicit any
7
10
  import { AudioOutputActions, CamaraFlipActions } from './common';
8
11
 
9
- export const ConferencingHeader = () => {
12
+ export const Header = () => {
10
13
  const roomState = useHMSStore(selectRoomState);
11
14
  const isMobile = useMedia(cssConfig.media.md);
12
- const isPreview = roomState === HMSRoomState.Preview;
13
- // no header if there in preview
14
- if (isPreview) {
15
+ // Header should be present only inside the call - not in preview, leave room states
16
+ if (roomState !== HMSRoomState.Connected) {
15
17
  return <></>;
16
18
  }
17
19
  return (
@@ -35,12 +37,12 @@ export const ConferencingHeader = () => {
35
37
  }}
36
38
  >
37
39
  <StreamActions />
38
- {isMobile && (
40
+ {isMobile ? (
39
41
  <>
40
42
  <CamaraFlipActions />
41
43
  <AudioOutputActions />
42
44
  </>
43
- )}
45
+ ) : null}
44
46
  </Flex>
45
47
  </Flex>
46
48
  );
@@ -1,10 +1,9 @@
1
- import React from 'react';
1
+ import React, { useState } from 'react';
2
2
  import { useMedia } from 'react-use';
3
3
  import { selectDominantSpeaker, selectIsConnectedToRoom, useHMSStore } from '@100mslive/react-sdk';
4
4
  import { VolumeOneIcon } from '@100mslive/react-icons';
5
5
  import { config as cssConfig, Flex, styled, Text, textEllipsis, VerticalDivider } from '../../../';
6
6
  import { useRoomLayout } from '../../provider/roomLayoutProvider';
7
- import { isStreamingKit } from '../../common/utils';
8
7
 
9
8
  export const SpeakerTag = () => {
10
9
  const dominantSpeaker = useHMSStore(selectDominantSpeaker);
@@ -40,9 +39,19 @@ export const Logo = () => {
40
39
  const logo = roomLayout?.logo?.url;
41
40
  const isMobile = useMedia(cssConfig.media.md);
42
41
  const isConnected = useHMSStore(selectIsConnectedToRoom);
42
+ const [hideImage, setHideImage] = useState(false);
43
43
  // Hide logo for now as there is not enough space
44
- if (isConnected && isMobile && isStreamingKit()) {
44
+ if (isConnected && isMobile) {
45
45
  return null;
46
46
  }
47
- return logo ? <LogoImg src={logo} alt="Brand Logo" /> : null;
47
+ return logo && !hideImage ? (
48
+ <LogoImg
49
+ src={logo}
50
+ alt="Brand Logo"
51
+ onError={e => {
52
+ e.target.onerror = null;
53
+ setHideImage(true);
54
+ }}
55
+ />
56
+ ) : null;
48
57
  };