@100mslive/roomkit-react 0.1.4 → 0.1.6-alpha.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (197) hide show
  1. package/dist/{HLSView-CTAJQUU4.js → HLSView-PY2FKWX3.js} +191 -123
  2. package/dist/HLSView-PY2FKWX3.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/Footer/Footer.d.ts +6 -0
  7. package/dist/Prebuilt/components/Header/Header.d.ts +2 -0
  8. package/dist/Prebuilt/components/InsetTile.d.ts +2 -0
  9. package/dist/Prebuilt/components/Leave/DesktopLeaveRoom.d.ts +7 -0
  10. package/dist/Prebuilt/components/Leave/EndSessionContent.d.ts +8 -0
  11. package/dist/Prebuilt/components/Leave/LeaveAtoms.d.ts +2196 -0
  12. package/dist/Prebuilt/components/Leave/LeaveCard.d.ts +12 -0
  13. package/dist/Prebuilt/components/Leave/LeaveRoom.d.ts +5 -0
  14. package/dist/Prebuilt/components/Leave/LeaveSessionContent.d.ts +6 -0
  15. package/dist/Prebuilt/components/Leave/MwebLeaveRoom.d.ts +7 -0
  16. package/dist/Prebuilt/components/MoreSettings/MoreSettings.d.ts +6 -0
  17. package/dist/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.d.ts +6 -0
  18. package/dist/Prebuilt/components/Pagination.d.ts +6 -0
  19. package/dist/Prebuilt/components/Preview/PreviewForm.d.ts +10 -0
  20. package/dist/Prebuilt/components/SecondaryTiles.d.ts +3 -0
  21. package/dist/Prebuilt/components/VideoLayouts/EqualProminence.d.ts +3 -0
  22. package/dist/Prebuilt/components/VideoLayouts/Grid.d.ts +5 -0
  23. package/dist/Prebuilt/components/VideoLayouts/GridLayout.d.ts +10 -0
  24. package/dist/Prebuilt/components/VideoLayouts/ProminenceLayout.d.ts +12 -0
  25. package/dist/Prebuilt/components/VideoLayouts/RoleProminence.d.ts +3 -0
  26. package/dist/Prebuilt/components/VideoLayouts/ScreenshareLayout.d.ts +3 -0
  27. package/dist/Prebuilt/components/VideoLayouts/interface.d.ts +8 -0
  28. package/dist/Prebuilt/components/hooks/useRoleProminencePeers.d.ts +5 -0
  29. package/dist/Prebuilt/components/hooks/useTileLayout.d.ts +12 -0
  30. package/dist/Prebuilt/components/hooks/useVideoTileLayout.d.ts +11 -0
  31. package/dist/Prebuilt/layouts/SidePane.d.ts +6 -0
  32. package/dist/Prebuilt/layouts/VideoStreamingSection.d.ts +6 -0
  33. package/dist/Prebuilt/plugins/whiteboard/ToggleWhiteboard.d.ts +5 -0
  34. package/dist/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.d.ts +1 -0
  35. package/dist/Prebuilt/provider/roomLayoutProvider/hooks/useInsetEnabled.d.ts +1 -0
  36. package/dist/Prebuilt/provider/roomLayoutProvider/hooks/useRoomLayoutScreen.d.ts +17 -0
  37. package/dist/Prebuilt/provider/roomLayoutProvider/index.d.ts +6 -1
  38. package/dist/{VirtualBackground-GGGBJYVY.js → VirtualBackground-AYDHYLIZ.js} +5 -11
  39. package/dist/VirtualBackground-AYDHYLIZ.js.map +7 -0
  40. package/dist/{chunk-TJNDX446.js → chunk-E2M2ZSOL.js} +8 -5
  41. package/dist/chunk-E2M2ZSOL.js.map +7 -0
  42. package/dist/chunk-GQD2AGWW.js +888 -0
  43. package/dist/chunk-GQD2AGWW.js.map +7 -0
  44. package/dist/{chunk-L2SX7GBO.js → chunk-RXTHJUMZ.js} +2462 -4738
  45. package/dist/chunk-RXTHJUMZ.js.map +7 -0
  46. package/dist/conference-V2XZGTKU.js +5927 -0
  47. package/dist/conference-V2XZGTKU.js.map +7 -0
  48. package/dist/index.cjs.js +9414 -15534
  49. package/dist/index.cjs.js.map +4 -4
  50. package/dist/index.js +2 -2
  51. package/dist/meta.cjs.json +2156 -3347
  52. package/dist/meta.esbuild.json +2601 -3885
  53. package/package.json +7 -7
  54. package/src/Button/Button.tsx +2 -2
  55. package/src/Prebuilt/App.tsx +49 -33
  56. package/src/Prebuilt/{AppContext.jsx → AppContext.tsx} +11 -3
  57. package/src/Prebuilt/IconButton.jsx +1 -0
  58. package/src/Prebuilt/Prebuilt.stories.tsx +1 -0
  59. package/src/Prebuilt/common/{PeersSorter.js → PeersSorter.ts} +15 -10
  60. package/src/Prebuilt/common/constants.js +3 -112
  61. package/src/Prebuilt/common/hooks.js +34 -1
  62. package/src/Prebuilt/common/utils.js +0 -8
  63. package/src/Prebuilt/components/AppData/AppData.jsx +3 -13
  64. package/src/Prebuilt/components/AppData/useUISettings.js +0 -4
  65. package/src/Prebuilt/components/AudioVideoToggle.jsx +6 -0
  66. package/src/Prebuilt/components/AuthToken.jsx +11 -42
  67. package/src/Prebuilt/components/Chat/Chat.jsx +57 -26
  68. package/src/Prebuilt/components/Chat/ChatBody.jsx +92 -32
  69. package/src/Prebuilt/components/Chat/ChatFooter.jsx +72 -48
  70. package/src/Prebuilt/components/Chat/ChatParticipantHeader.jsx +73 -0
  71. package/src/Prebuilt/components/Chat/ChatSelector.jsx +16 -17
  72. package/src/Prebuilt/components/Chat/ChatSelectorContainer.jsx +81 -0
  73. package/src/Prebuilt/components/Connection/TileConnection.jsx +30 -12
  74. package/src/Prebuilt/components/EmojiReaction.jsx +18 -17
  75. package/src/Prebuilt/components/Footer/ChatToggle.jsx +1 -7
  76. package/src/Prebuilt/components/Footer/Footer.tsx +89 -0
  77. package/src/Prebuilt/components/Footer/ParticipantList.jsx +213 -173
  78. package/src/Prebuilt/components/Footer/RoleAccordion.jsx +78 -0
  79. package/src/Prebuilt/components/HMSVideo/Controls.jsx +2 -2
  80. package/src/Prebuilt/components/HMSVideo/HLSQualitySelector.jsx +33 -10
  81. package/src/Prebuilt/components/HMSVideo/PlayButton.jsx +1 -1
  82. package/src/Prebuilt/components/HMSVideo/VideoTime.jsx +3 -3
  83. package/src/Prebuilt/components/HMSVideo/VolumeControl.jsx +38 -9
  84. package/src/Prebuilt/components/Header/{ConferencingHeader.jsx → Header.tsx} +9 -7
  85. package/src/Prebuilt/components/Header/HeaderComponents.jsx +13 -4
  86. package/src/Prebuilt/components/Header/StreamActions.jsx +33 -60
  87. package/src/Prebuilt/components/Header/index.tsx +1 -0
  88. package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.jsx +17 -3
  89. package/src/Prebuilt/components/InsetTile.tsx +122 -0
  90. package/src/Prebuilt/components/{MoreSettings/SplitComponents/DesktopLeaveRoom.jsx → Leave/DesktopLeaveRoom.tsx} +50 -18
  91. package/src/Prebuilt/components/{EndSessionContent.jsx → Leave/EndSessionContent.tsx} +19 -9
  92. package/src/Prebuilt/components/Leave/LeaveAtoms.tsx +26 -0
  93. package/src/Prebuilt/components/{LeaveCard.jsx → Leave/LeaveCard.tsx} +22 -3
  94. package/src/Prebuilt/components/Leave/LeaveRoom.tsx +63 -0
  95. package/src/Prebuilt/components/{LeaveSessionContent.jsx → Leave/LeaveSessionContent.tsx} +13 -5
  96. package/src/Prebuilt/components/{MoreSettings/SplitComponents/MwebLeaveRoom.jsx → Leave/MwebLeaveRoom.tsx} +38 -13
  97. package/src/Prebuilt/components/MetaActions.jsx +15 -23
  98. package/src/Prebuilt/components/MoreSettings/ActionTile.jsx +5 -0
  99. package/src/Prebuilt/components/MoreSettings/ChangeNameContent.jsx +12 -7
  100. package/src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx +1 -1
  101. package/src/Prebuilt/components/MoreSettings/FullScreenItem.jsx +1 -4
  102. package/src/Prebuilt/components/MoreSettings/MoreSettings.tsx +27 -0
  103. package/src/Prebuilt/components/MoreSettings/SplitComponents/{DesktopOptions.jsx → DesktopOptions.tsx} +86 -75
  104. package/src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.jsx +20 -19
  105. package/src/Prebuilt/components/Notifications/HLSFailureModal.jsx +3 -1
  106. package/src/Prebuilt/components/Notifications/Notifications.jsx +18 -11
  107. package/src/Prebuilt/components/Notifications/PeerNotifications.jsx +14 -2
  108. package/src/Prebuilt/components/Notifications/PermissionErrorModal.jsx +10 -4
  109. package/src/Prebuilt/components/PIP/PIPComponent.jsx +7 -16
  110. package/src/Prebuilt/components/PIP/PIPManager.js +1 -0
  111. package/src/Prebuilt/components/{Pagination.jsx → Pagination.tsx} +35 -6
  112. package/src/Prebuilt/components/Playlist/Playlist.jsx +1 -6
  113. package/src/Prebuilt/components/PostLeave.jsx +7 -7
  114. package/src/Prebuilt/components/Preview/PreviewContainer.jsx +5 -13
  115. package/src/Prebuilt/components/Preview/{PreviewForm.jsx → PreviewForm.tsx} +14 -4
  116. package/src/Prebuilt/components/Preview/PreviewJoin.jsx +9 -7
  117. package/src/Prebuilt/components/RaiseHand.jsx +0 -7
  118. package/src/Prebuilt/components/RoleChangeRequestModal.jsx +82 -6
  119. package/src/Prebuilt/components/ScreenshareDisplay.jsx +4 -10
  120. package/src/Prebuilt/components/ScreenshareTile.jsx +41 -33
  121. package/src/Prebuilt/components/SecondaryTiles.tsx +34 -0
  122. package/src/Prebuilt/components/Settings/LayoutSettings.jsx +2 -12
  123. package/src/Prebuilt/components/Settings/NotificationSettings.jsx +3 -9
  124. package/src/Prebuilt/components/Settings/SettingsModal.jsx +3 -9
  125. package/src/Prebuilt/components/StatsForNerds.jsx +3 -1
  126. package/src/Prebuilt/components/TileMenu/TileMenu.jsx +15 -16
  127. package/src/Prebuilt/components/TileMenu/TileMenuContent.jsx +21 -19
  128. package/src/Prebuilt/components/Toast/ToastConfig.jsx +53 -11
  129. package/src/Prebuilt/components/VideoLayouts/EqualProminence.tsx +62 -0
  130. package/src/Prebuilt/components/VideoLayouts/Grid.tsx +41 -0
  131. package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +92 -0
  132. package/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +60 -0
  133. package/src/Prebuilt/components/VideoLayouts/RoleProminence.tsx +56 -0
  134. package/src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx +36 -0
  135. package/src/Prebuilt/components/VideoLayouts/interface.ts +9 -0
  136. package/src/Prebuilt/components/VideoTile.jsx +93 -43
  137. package/src/Prebuilt/components/conference.jsx +24 -20
  138. package/src/Prebuilt/components/hooks/useMetadata.jsx +7 -0
  139. package/src/Prebuilt/components/hooks/useRoleProminencePeers.tsx +38 -0
  140. package/src/Prebuilt/components/hooks/useTileLayout.tsx +121 -0
  141. package/src/Prebuilt/components/hooks/useVideoTileLayout.ts +22 -0
  142. package/src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx +5 -72
  143. package/src/Prebuilt/components/pdfAnnotator/submitPdf.jsx +4 -45
  144. package/src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx +2 -17
  145. package/src/Prebuilt/components/peerTileUtils.jsx +1 -1
  146. package/src/Prebuilt/images/empty-chat.svg +12 -0
  147. package/src/Prebuilt/layouts/EmbedView.jsx +17 -40
  148. package/src/Prebuilt/layouts/HLSView.jsx +83 -66
  149. package/src/Prebuilt/layouts/PDFView.jsx +1 -11
  150. package/src/Prebuilt/layouts/SidePane.tsx +96 -0
  151. package/src/Prebuilt/layouts/{mainView.jsx → VideoStreamingSection.tsx} +38 -47
  152. package/src/Prebuilt/layouts/WhiteboardView.jsx +10 -34
  153. package/src/Prebuilt/plugins/VirtualBackground/VirtualBackground.jsx +1 -4
  154. package/src/Prebuilt/plugins/whiteboard/{ToggleWhiteboard.jsx → ToggleWhiteboard.tsx} +5 -9
  155. package/src/Prebuilt/primitives/DialogContent.jsx +15 -11
  156. package/src/Prebuilt/provider/roomLayoutProvider/constants/index.ts +17 -2
  157. package/src/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.ts +36 -13
  158. package/src/Prebuilt/provider/roomLayoutProvider/hooks/useInsetEnabled.ts +10 -0
  159. package/src/Prebuilt/provider/roomLayoutProvider/hooks/useRoomLayoutScreen.ts +65 -0
  160. package/src/Prebuilt/provider/roomLayoutProvider/index.tsx +17 -6
  161. package/dist/HLSView-CTAJQUU4.js.map +0 -7
  162. package/dist/PinnedTrackView-CQKONH4O.js +0 -102
  163. package/dist/PinnedTrackView-CQKONH4O.js.map +0 -7
  164. package/dist/VirtualBackground-GGGBJYVY.js.map +0 -7
  165. package/dist/chunk-I2FJWE74.js +0 -827
  166. package/dist/chunk-I2FJWE74.js.map +0 -7
  167. package/dist/chunk-L2SX7GBO.js.map +0 -7
  168. package/dist/chunk-NOKIGB6Y.js +0 -1100
  169. package/dist/chunk-NOKIGB6Y.js.map +0 -7
  170. package/dist/chunk-TJNDX446.js.map +0 -7
  171. package/dist/conference-OEO7VOJD.js +0 -8995
  172. package/dist/conference-OEO7VOJD.js.map +0 -7
  173. package/src/Prebuilt/components/Chat/ChatHeader.jsx +0 -67
  174. package/src/Prebuilt/components/EqualProminence.jsx +0 -180
  175. package/src/Prebuilt/components/FirstPersonDisplay.jsx +0 -50
  176. package/src/Prebuilt/components/Footer/Footer.jsx +0 -73
  177. package/src/Prebuilt/components/Header/Header.jsx +0 -8
  178. package/src/Prebuilt/components/Header/StreamingHeader.jsx +0 -54
  179. package/src/Prebuilt/components/LeaveRoom.jsx +0 -94
  180. package/src/Prebuilt/components/MoreSettings/MoreSettings.jsx +0 -10
  181. package/src/Prebuilt/components/Notifications/MessageNotifications.jsx +0 -25
  182. package/src/Prebuilt/components/gridView.jsx +0 -85
  183. package/src/Prebuilt/components/hooks/useFeatures.js +0 -22
  184. package/src/Prebuilt/components/hooks/useNavigation.js +0 -19
  185. package/src/Prebuilt/components/hooks/useSkipPreview.jsx +0 -20
  186. package/src/Prebuilt/components/pdfAnnotator/pdfErrorView.jsx +0 -29
  187. package/src/Prebuilt/images/Logo.svg +0 -8
  188. package/src/Prebuilt/layouts/ActiveSpeakerView.jsx +0 -34
  189. package/src/Prebuilt/layouts/InsetView.jsx +0 -260
  190. package/src/Prebuilt/layouts/PinnedTrackView.jsx +0 -59
  191. package/src/Prebuilt/layouts/SidePane.jsx +0 -52
  192. package/src/Prebuilt/layouts/mainGridView.jsx +0 -98
  193. package/src/Prebuilt/layouts/screenShareView.jsx +0 -183
  194. /package/{src/Prebuilt/components/Header/index.jsx → dist/Prebuilt/components/Header/index.d.ts} +0 -0
  195. /package/src/Prebuilt/components/{ScreenShare.jsx → ScreenShareToggle.jsx} +0 -0
  196. /package/src/{assets → Prebuilt/images}/android-perm-1.png +0 -0
  197. /package/src/{assets → Prebuilt/images}/ios-perm-0.png +0 -0
@@ -1,102 +0,0 @@
1
- import {
2
- VideoList_default,
3
- VideoTile_default,
4
- useAppConfig
5
- } from "./chunk-I2FJWE74.js";
6
- import {
7
- useIsHeadless,
8
- usePinnedTrack,
9
- useTheme
10
- } from "./chunk-L2SX7GBO.js";
11
- import {
12
- Flex,
13
- define_process_env_default,
14
- init_define_process_env
15
- } from "./chunk-NOKIGB6Y.js";
16
-
17
- // src/Prebuilt/layouts/PinnedTrackView.jsx
18
- init_define_process_env();
19
- import React2 from "react";
20
- import { useMeasure } from "react-use";
21
- import { selectPeers, selectVideoTrackByPeerID, useHMSStore } from "@100mslive/react-sdk";
22
-
23
- // src/Prebuilt/components/gridView.jsx
24
- init_define_process_env();
25
- import React, { Fragment } from "react";
26
- import { useMedia } from "react-use";
27
- var webinarProps = JSON.parse(define_process_env_default.REACT_APP_WEBINAR_PROPS || "{}");
28
- var eventRoomIDs = (webinarProps == null ? void 0 : webinarProps.ROOM_IDS) || [];
29
- var eventsImg = (webinarProps == null ? void 0 : webinarProps.IMAGE_FILE) || "";
30
- var webinarInfoLink = (webinarProps == null ? void 0 : webinarProps.LINK_HREF) || "https://100ms.live/";
31
- var GridSidePaneView = ({ peers }) => {
32
- const headlessConfig = useAppConfig("headlessConfig");
33
- const isHeadless = useIsHeadless();
34
- return /* @__PURE__ */ React.createElement(
35
- Flex,
36
- {
37
- direction: "column",
38
- css: {
39
- flex: "0 0 20%",
40
- mx: isHeadless && Number(headlessConfig == null ? void 0 : headlessConfig.tileOffset) === 0 ? "0" : "$8",
41
- "@lg": {
42
- flex: "0 0 25%"
43
- },
44
- "@md": {
45
- flex: "1 1 0"
46
- }
47
- }
48
- },
49
- /* @__PURE__ */ React.createElement(Flex, { css: { flex: "1 1 0" }, align: "end" }, peers && peers.length > 0 && /* @__PURE__ */ React.createElement(VideoList_default, { peers, maxColCount: 1 }))
50
- );
51
- };
52
-
53
- // src/Prebuilt/layouts/PinnedTrackView.jsx
54
- var PinnedPeerView = () => {
55
- const { aspectRatio } = useTheme();
56
- const pinnedTrack = usePinnedTrack();
57
- const peerVideoTrack = useHMSStore(selectVideoTrackByPeerID(pinnedTrack.peerId));
58
- const pinnedVideoTrack = pinnedTrack && pinnedTrack.type === "audio" ? peerVideoTrack : pinnedTrack;
59
- const [ref, { height, width }] = useMeasure();
60
- const peers = (useHMSStore(selectPeers) || []).filter(
61
- (peer) => peer.videoTrack || peer.audioTrack || peer.auxiliaryTracks.length > 0
62
- );
63
- if (peers.length === 0) {
64
- return null;
65
- }
66
- const showSidePane = pinnedTrack && peers.length > 1;
67
- let finalWidth = aspectRatio.width / aspectRatio.height * height;
68
- let finalHeight = height;
69
- if (finalWidth > width) {
70
- finalWidth = width;
71
- finalHeight = aspectRatio.height / aspectRatio.width * width;
72
- }
73
- return /* @__PURE__ */ React2.createElement(Flex, { css: { size: "100%", "@lg": { flexDirection: "column" } } }, /* @__PURE__ */ React2.createElement(
74
- Flex,
75
- {
76
- css: {
77
- flex: "1 1 0",
78
- p: "$8",
79
- minHeight: 0,
80
- minWidth: 0,
81
- justifyContent: "center",
82
- alignItems: "center"
83
- },
84
- ref
85
- },
86
- /* @__PURE__ */ React2.createElement(
87
- VideoTile_default,
88
- {
89
- key: pinnedTrack.id,
90
- trackId: pinnedVideoTrack == null ? void 0 : pinnedVideoTrack.id,
91
- peerId: pinnedTrack.peerId,
92
- height: finalHeight,
93
- width: finalWidth
94
- }
95
- )
96
- ), showSidePane && /* @__PURE__ */ React2.createElement(GridSidePaneView, { peers: peers.filter((peer) => peer.id !== pinnedTrack.peerId) }));
97
- };
98
- var PinnedTrackView_default = PinnedPeerView;
99
- export {
100
- PinnedTrackView_default as default
101
- };
102
- //# sourceMappingURL=PinnedTrackView-CQKONH4O.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/Prebuilt/layouts/PinnedTrackView.jsx", "../src/Prebuilt/components/gridView.jsx"],
4
- "sourcesContent": ["import React from 'react';\nimport { useMeasure } from 'react-use';\nimport { selectPeers, selectVideoTrackByPeerID, useHMSStore } from '@100mslive/react-sdk';\nimport { GridSidePaneView } from '../components/gridView';\nimport VideoTile from '../components/VideoTile';\nimport { Flex } from '../../Layout';\nimport { useTheme } from '../../Theme';\nimport { usePinnedTrack } from '../components/AppData/useUISettings';\n\nconst PinnedPeerView = () => {\n const { aspectRatio } = useTheme();\n // can be audio or video track, if tile with only audio track is pinned\n const pinnedTrack = usePinnedTrack();\n const peerVideoTrack = useHMSStore(selectVideoTrackByPeerID(pinnedTrack.peerId));\n const pinnedVideoTrack = pinnedTrack && pinnedTrack.type === 'audio' ? peerVideoTrack : pinnedTrack;\n const [ref, { height, width }] = useMeasure();\n const peers = (useHMSStore(selectPeers) || []).filter(\n peer => peer.videoTrack || peer.audioTrack || peer.auxiliaryTracks.length > 0,\n );\n if (peers.length === 0) {\n return null;\n }\n const showSidePane = pinnedTrack && peers.length > 1;\n\n let finalWidth = (aspectRatio.width / aspectRatio.height) * height;\n let finalHeight = height;\n\n if (finalWidth > width) {\n finalWidth = width;\n finalHeight = (aspectRatio.height / aspectRatio.width) * width;\n }\n\n return (\n <Flex css={{ size: '100%', '@lg': { flexDirection: 'column' } }}>\n <Flex\n css={{\n flex: '1 1 0',\n p: '$8',\n minHeight: 0,\n minWidth: 0,\n justifyContent: 'center',\n alignItems: 'center',\n }}\n ref={ref}\n >\n <VideoTile\n key={pinnedTrack.id}\n trackId={pinnedVideoTrack?.id}\n peerId={pinnedTrack.peerId}\n height={finalHeight}\n width={finalWidth}\n />\n </Flex>\n {showSidePane && <GridSidePaneView peers={peers.filter(peer => peer.id !== pinnedTrack.peerId)} />}\n </Flex>\n );\n};\n\nexport default PinnedPeerView;\n", "import React, { Fragment } from 'react';\nimport { useMedia } from 'react-use';\nimport { Box, Flex } from '../../Layout';\nimport { config as cssConfig } from '../../Theme';\nimport { FirstPersonDisplay } from './FirstPersonDisplay';\nimport { Image } from './Image';\nimport VideoList from './VideoList';\nimport { useAppConfig } from './AppData/useAppConfig';\nimport { useIsHeadless } from './AppData/useUISettings';\n\nconst MAX_TILES_FOR_MOBILE = 4;\n\n/**\n * the below variables are for showing webinar etc. related image if required on certain meeting urls\n */\nconst webinarProps = JSON.parse(process.env.REACT_APP_WEBINAR_PROPS || '{}');\nconst eventRoomIDs = webinarProps?.ROOM_IDS || [];\nconst eventsImg = webinarProps?.IMAGE_FILE || ''; // the image to show in center\n// the link to navigate to when user clicks on the image\nconst webinarInfoLink = webinarProps?.LINK_HREF || 'https://100ms.live/';\n\n// The center of the screen shows bigger tiles\nexport const GridCenterView = ({ peers, maxTileCount }) => {\n const mediaQueryLg = cssConfig.media.md;\n const limitMaxTiles = useMedia(mediaQueryLg);\n\n const headlessConfig = useAppConfig('headlessConfig');\n const isHeadless = useIsHeadless();\n return (\n <Fragment>\n <Box\n css={{\n flex: '1 1 0',\n height: '100%',\n mx: isHeadless && Number(headlessConfig?.tileOffset) === 0 ? '0' : '$8',\n '@md': { flex: '2 1 0' },\n }}\n >\n {peers && peers.length > 0 ? (\n <VideoList peers={peers} maxTileCount={limitMaxTiles ? MAX_TILES_FOR_MOBILE : maxTileCount} />\n ) : eventRoomIDs.some(id => window.location.href.includes(id)) ? (\n <Box\n css={{\n display: 'grid',\n placeItems: 'center',\n size: '100%',\n p: '$12',\n }}\n >\n <a href={webinarInfoLink} target=\"_blank\" rel=\"noreferrer\">\n <Image css={{ p: '$4', boxShadow: '$sm' }} alt=\"Event template\" src={eventsImg} />\n </a>\n </Box>\n ) : (\n <FirstPersonDisplay />\n )}\n </Box>\n </Fragment>\n );\n};\n\n// Side pane shows smaller tiles\nexport const GridSidePaneView = ({ peers }) => {\n const headlessConfig = useAppConfig('headlessConfig');\n const isHeadless = useIsHeadless();\n return (\n <Flex\n direction=\"column\"\n css={{\n flex: '0 0 20%',\n mx: isHeadless && Number(headlessConfig?.tileOffset) === 0 ? '0' : '$8',\n '@lg': {\n flex: '0 0 25%',\n },\n '@md': {\n flex: '1 1 0',\n },\n }}\n >\n <Flex css={{ flex: '1 1 0' }} align=\"end\">\n {peers && peers.length > 0 && <VideoList peers={peers} maxColCount={1} />}\n </Flex>\n </Flex>\n );\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA,OAAOA,YAAW;AAClB,SAAS,kBAAkB;AAC3B,SAAS,aAAa,0BAA0B,mBAAmB;;;ACFnE;AAAA,OAAO,SAAS,gBAAgB;AAChC,SAAS,gBAAgB;AAczB,IAAM,eAAe,KAAK,MAAM,2BAAY,2BAA2B,IAAI;AAC3E,IAAM,gBAAe,6CAAc,aAAY,CAAC;AAChD,IAAM,aAAY,6CAAc,eAAc;AAE9C,IAAM,mBAAkB,6CAAc,cAAa;AA2C5C,IAAM,mBAAmB,CAAC,EAAE,MAAM,MAAM;AAC7C,QAAM,iBAAiB,aAAa,gBAAgB;AACpD,QAAM,aAAa,cAAc;AACjC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,KAAK;AAAA,QACH,MAAM;AAAA,QACN,IAAI,cAAc,OAAO,iDAAgB,UAAU,MAAM,IAAI,MAAM;AAAA,QACnE,OAAO;AAAA,UACL,MAAM;AAAA,QACR;AAAA,QACA,OAAO;AAAA,UACL,MAAM;AAAA,QACR;AAAA,MACF;AAAA;AAAA,IAEA,oCAAC,QAAK,KAAK,EAAE,MAAM,QAAQ,GAAG,OAAM,SACjC,SAAS,MAAM,SAAS,KAAK,oCAAC,qBAAU,OAAc,aAAa,GAAG,CACzE;AAAA,EACF;AAEJ;;;AD3EA,IAAM,iBAAiB,MAAM;AAC3B,QAAM,EAAE,YAAY,IAA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sources": ["../src/Prebuilt/plugins/VirtualBackground/VirtualBackground.jsx", "../src/Prebuilt/plugins/VirtualBackground/vbutils.js"],
4
- "sourcesContent": ["import React, { useEffect, useRef, useState } from 'react';\nimport { HMSVirtualBackgroundTypes } from '@100mslive/hms-virtual-background';\nimport {\n selectIsAllowedToPublish,\n selectIsLocalVideoPluginPresent,\n selectLocalPeerRole,\n selectLocalVideoTrackID,\n useHMSActions,\n useHMSStore,\n} from '@100mslive/react-sdk';\nimport { VirtualBackgroundIcon } from '@100mslive/react-icons';\nimport { ActionTile } from '../../components/MoreSettings/ActionTile';\nimport { Loading } from '../../../Loading';\nimport { Tooltip } from '../../../Tooltip';\nimport IconButton from '../../IconButton';\nimport { useIsFeatureEnabled } from '../../components/hooks/useFeatures';\nimport { getRandomVirtualBackground } from './vbutils';\nimport { FEATURE_LIST } from '../../common/constants';\n\nexport const VirtualBackground = ({\n asActionTile = false,\n onVBClick = () => {\n return;\n },\n}) => {\n const pluginRef = useRef(null);\n const hmsActions = useHMSActions();\n const isAllowedToPublish = useHMSStore(selectIsAllowedToPublish);\n const role = useHMSStore(selectLocalPeerRole);\n const [isVBLoading, setIsVBLoading] = useState(false);\n const [isVBSupported, setIsVBSupported] = useState(false);\n const [isVBOn, setIsVBOn] = useState(false);\n const localPeerVideoTrackID = useHMSStore(selectLocalVideoTrackID);\n const isVBPresent = useHMSStore(selectIsLocalVideoPluginPresent('HMSVB'));\n const isFeatureEnabled = useIsFeatureEnabled(FEATURE_LIST.VIDEO_PLUGINS);\n\n async function createPlugin() {\n if (!pluginRef.current) {\n const { HMSVBPlugin } = await import('@100mslive/hms-virtual-background');\n pluginRef.current = new HMSVBPlugin(HMSVirtualBackgroundTypes.NONE, HMSVirtualBackgroundTypes.NONE);\n }\n }\n useEffect(() => {\n if (!localPeerVideoTrackID) {\n return;\n }\n createPlugin().then(() => {\n //check support of plugin\n const pluginSupport = hmsActions.validateVideoPluginSupport(pluginRef.current);\n setIsVBSupported(pluginSupport.isSupported);\n });\n }, [hmsActions, localPeerVideoTrackID]);\n\n async function addPlugin() {\n setIsVBLoading(true);\n try {\n await createPlugin();\n window.HMS.virtualBackground = pluginRef.current;\n const { background, backgroundType } = getRandomVirtualBackground();\n await pluginRef.current.setBackground(background, backgroundType);\n await hmsActions.addPluginToVideoTrack(pluginRef.current, Math.floor(role.publishParams.video.frameRate / 2));\n } catch (err) {\n console.error('add virtual background plugin failed', err);\n }\n setIsVBLoading(false);\n }\n\n async function removePlugin() {\n if (pluginRef.current) {\n await hmsActions.removePluginFromVideoTrack(pluginRef.current);\n pluginRef.current = null;\n }\n }\n\n if (!isAllowedToPublish.video || !isVBSupported || !isFeatureEnabled) {\n return null;\n }\n if (asActionTile) {\n return (\n <ActionTile.Root\n data-testid=\"virtual_bg_btn\"\n active={isVBPresent}\n disabled={isVBLoading}\n onClick={() => {\n setIsVBOn(!isVBOn);\n !isVBPresent ? addPlugin() : removePlugin();\n onVBClick();\n }}\n >\n <VirtualBackgroundIcon />\n <ActionTile.Title>Virtual Background</ActionTile.Title>\n </ActionTile.Root>\n );\n }\n\n return (\n <Tooltip\n boxCss={{ zIndex: '100' }}\n title={isVBLoading ? 'Adding virtual background' : `Turn ${!isVBPresent ? 'on' : 'off'} virtual background`}\n >\n <IconButton\n active={!isVBPresent}\n disabled={isVBLoading}\n onClick={() => {\n !isVBPresent ? addPlugin() : removePlugin();\n }}\n data-testid=\"virtual_bg_btn\"\n >\n {isVBLoading ? <Loading /> : <VirtualBackgroundIcon />}\n </IconButton>\n </Tooltip>\n );\n};\n\nexport default VirtualBackground;\n", "/* eslint-disable no-case-declarations */\nimport { HMSVirtualBackgroundTypes } from '@100mslive/hms-virtual-background';\nexport function getRandomVirtualBackground() {\n const backgroundList = [\n {\n background: HMSVirtualBackgroundTypes.BLUR,\n backgroundType: HMSVirtualBackgroundTypes.BLUR,\n },\n ];\n\n const images = [\n 'https://www.100ms.live/images/vb-1.jpeg',\n 'https://www.100ms.live/images/vb-2.jpg',\n 'https://www.100ms.live/images/vb-3.png',\n 'https://d2qi07yyjujoxr.cloudfront.net/webapp/vb/hms1.png',\n 'https://d2qi07yyjujoxr.cloudfront.net/webapp/vb/hms2.png',\n 'https://d2qi07yyjujoxr.cloudfront.net/webapp/vb/hms3.png',\n 'https://d2qi07yyjujoxr.cloudfront.net/webapp/vb/hms4.png',\n ].map(url => ({\n background: url,\n backgroundType: HMSVirtualBackgroundTypes.IMAGE,\n }));\n\n backgroundList.push(...images);\n\n /* \n //TODO: update with a better quality gif.\n const gifList = [\n {\n background: \"https://www.100ms.live/images/vb-1.gif\",\n backgroundType: HMSVirtualBackgroundTypes.GIF,\n },\n ];\n backgroundList.push(...gifList); \n */\n\n const videoList = [\n 'https://www.100ms.live/images/video-1.mp4',\n 'https://www.100ms.live/images/video-2.mp4',\n 'https://www.100ms.live/images/video-5.mp4',\n 'https://www.100ms.live/images/video-7.mp4',\n 'https://www.100ms.live/images/video-8.mp4',\n ].map(url => ({\n background: url,\n backgroundType: HMSVirtualBackgroundTypes.VIDEO,\n }));\n backgroundList.push(...videoList);\n\n const randomIdx = Math.floor(Math.random() * backgroundList.length);\n const virtualBackground = backgroundList[randomIdx];\n switch (virtualBackground.backgroundType) {\n case HMSVirtualBackgroundTypes.IMAGE:\n const img = document.createElement('img');\n img.alt = 'VB';\n img.src = backgroundList[randomIdx].background;\n virtualBackground.background = img;\n return virtualBackground;\n case HMSVirtualBackgroundTypes.VIDEO:\n const videoEl = document.createElement('video');\n videoEl.src = backgroundList[randomIdx].background;\n virtualBackground.background = videoEl;\n return virtualBackground;\n default:\n return virtualBackground;\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA,OAAO,SAAS,WAAW,QAAQ,gBAAgB;AACnD,SAAS,6BAAAA,kCAAiC;AAC1C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,6BAA6B;;;ACVtC;AACA,SAAS,iCAAiC;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