@100mslive/roomkit-react 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (459) hide show
  1. package/README.md +1 -0
  2. package/dist/Accordion/Accordion.d.ts +964 -0
  3. package/dist/Accordion/index.d.ts +979 -0
  4. package/dist/ActiveSpeakerView-H3VYXANB.js +39 -0
  5. package/dist/ActiveSpeakerView-H3VYXANB.js.map +7 -0
  6. package/dist/ActiveSpeakerView-REZLWPPI.css +11 -0
  7. package/dist/ActiveSpeakerView-REZLWPPI.css.map +7 -0
  8. package/dist/AudioLevel/AudioLevel.d.ts +8 -0
  9. package/dist/AudioLevel/index.d.ts +1 -0
  10. package/dist/Avatar/Avatar.d.ts +487 -0
  11. package/dist/Avatar/getAvatarBg.d.ts +7 -0
  12. package/dist/Avatar/index.d.ts +1 -0
  13. package/dist/Button/Button.d.ts +488 -0
  14. package/dist/Button/index.d.ts +1 -0
  15. package/dist/Checkbox/Checkbox.d.ts +958 -0
  16. package/dist/Checkbox/index.d.ts +1 -0
  17. package/dist/Collapsible/Collapsible.d.ts +1434 -0
  18. package/dist/Collapsible/index.d.ts +1 -0
  19. package/dist/Divider/Divider.d.ts +958 -0
  20. package/dist/Divider/index.d.ts +1 -0
  21. package/dist/Dropdown/Dropdown.d.ts +5728 -0
  22. package/dist/Dropdown/index.d.ts +1 -0
  23. package/dist/Fieldset/Fieldset.d.ts +477 -0
  24. package/dist/Fieldset/index.d.ts +1 -0
  25. package/dist/Footer/Footer.d.ts +3834 -0
  26. package/dist/Footer/index.d.ts +1 -0
  27. package/dist/HLSView-3RDXRV7Y.js +689 -0
  28. package/dist/HLSView-3RDXRV7Y.js.map +7 -0
  29. package/dist/HLSView-6BVBCQM7.css +11 -0
  30. package/dist/HLSView-6BVBCQM7.css.map +7 -0
  31. package/dist/IconButton/IconButton.d.ts +479 -0
  32. package/dist/IconButton/index.d.ts +1 -0
  33. package/dist/Input/Input.d.ts +2917 -0
  34. package/dist/Input/index.d.ts +1 -0
  35. package/dist/Label/Label.d.ts +479 -0
  36. package/dist/Label/index.d.ts +1 -0
  37. package/dist/Layout/Box.d.ts +477 -0
  38. package/dist/Layout/Flex.d.ts +482 -0
  39. package/dist/Layout/index.d.ts +2 -0
  40. package/dist/Link/Link.d.ts +489 -0
  41. package/dist/Link/index.d.ts +2 -0
  42. package/dist/Loading/Loading.d.ts +14 -0
  43. package/dist/Loading/index.d.ts +1 -0
  44. package/dist/Modal/Dialog.d.ts +3826 -0
  45. package/dist/Modal/DialogContent.d.ts +3343 -0
  46. package/dist/Modal/index.d.ts +1 -0
  47. package/dist/Pagination/StyledPagination.d.ts +1918 -0
  48. package/dist/Pagination/index.d.ts +1 -0
  49. package/dist/PinnedTrackView-453PELNU.js +70 -0
  50. package/dist/PinnedTrackView-453PELNU.js.map +7 -0
  51. package/dist/PinnedTrackView-QQ5FDXJX.css +11 -0
  52. package/dist/PinnedTrackView-QQ5FDXJX.css.map +7 -0
  53. package/dist/Popover/index.d.ts +1436 -0
  54. package/dist/Progress/index.d.ts +957 -0
  55. package/dist/QRCode/QRCode.d.ts +3 -0
  56. package/dist/QRCode/index.d.ts +1 -0
  57. package/dist/RadioGroup/RadioGroup.d.ts +1435 -0
  58. package/dist/RadioGroup/index.d.ts +1 -0
  59. package/dist/ReactSelect/ReactSelect.d.ts +4778 -0
  60. package/dist/ReactSelect/index.d.ts +1 -0
  61. package/dist/Select/Select.d.ts +1437 -0
  62. package/dist/Select/index.d.ts +1 -0
  63. package/dist/Slider/Slider.d.ts +488 -0
  64. package/dist/Slider/index.d.ts +1 -0
  65. package/dist/Stats/Stats.d.ts +19 -0
  66. package/dist/Stats/StyledStats.d.ts +2872 -0
  67. package/dist/Stats/formatBytes.d.ts +1 -0
  68. package/dist/Stats/index.d.ts +1 -0
  69. package/dist/Switch/Switch.d.ts +482 -0
  70. package/dist/Switch/index.d.ts +1 -0
  71. package/dist/Tabs/Tabs.d.ts +1912 -0
  72. package/dist/Tabs/index.d.ts +1 -0
  73. package/dist/Text/Text.d.ts +605 -0
  74. package/dist/Text/index.d.ts +1 -0
  75. package/dist/Theme/ThemeProvider.d.ts +397 -0
  76. package/dist/Theme/base.config.d.ts +417 -0
  77. package/dist/Theme/index.d.ts +3 -0
  78. package/dist/Theme/stitches.config.d.ts +4702 -0
  79. package/dist/Theme/themes.d.ts +64 -0
  80. package/dist/Theme/useSSR.d.ts +6 -0
  81. package/dist/TileMenu/StyledMenuTile.d.ts +3351 -0
  82. package/dist/TileMenu/TileMenu.d.ts +6 -0
  83. package/dist/TileMenu/index.d.ts +1 -0
  84. package/dist/Toast/Toast.d.ts +2881 -0
  85. package/dist/Toast/index.d.ts +1 -0
  86. package/dist/Tooltip/Tooltip.d.ts +14 -0
  87. package/dist/Tooltip/index.d.ts +1 -0
  88. package/dist/Video/Video.d.ts +499 -0
  89. package/dist/Video/index.d.ts +1 -0
  90. package/dist/VideoList/StyledVideoList.d.ts +1438 -0
  91. package/dist/VideoList/index.d.ts +2 -0
  92. package/dist/VideoList/videoListUtils.d.ts +1 -0
  93. package/dist/VideoTile/StyledVideoTile.d.ts +4309 -0
  94. package/dist/VideoTile/index.d.ts +1 -0
  95. package/dist/VirtualBackground-LHYBWUT5.js +158 -0
  96. package/dist/VirtualBackground-LHYBWUT5.js.map +7 -0
  97. package/dist/chunk-7YUYZ64D.js +6843 -0
  98. package/dist/chunk-7YUYZ64D.js.map +7 -0
  99. package/dist/chunk-HCAGFNXW.js +8270 -0
  100. package/dist/chunk-HCAGFNXW.js.map +7 -0
  101. package/dist/chunk-KYYP6ZVK.js +907 -0
  102. package/dist/chunk-KYYP6ZVK.js.map +7 -0
  103. package/dist/chunk-ULXGBUSC.js +65 -0
  104. package/dist/chunk-ULXGBUSC.js.map +7 -0
  105. package/dist/chunk-XRJXE6UO.js +243 -0
  106. package/dist/chunk-XRJXE6UO.js.map +7 -0
  107. package/dist/conference-IDNRO4WK.js +3812 -0
  108. package/dist/conference-IDNRO4WK.js.map +7 -0
  109. package/dist/conference-KN6OKGDU.css +11 -0
  110. package/dist/conference-KN6OKGDU.css.map +7 -0
  111. package/dist/fixtures/chats.d.ts +4 -0
  112. package/dist/fixtures/peers.d.ts +3 -0
  113. package/dist/fixtures/tracks.d.ts +2 -0
  114. package/dist/index.cjs.css +11 -0
  115. package/dist/index.cjs.css.map +7 -0
  116. package/dist/index.cjs.js +22987 -0
  117. package/dist/index.cjs.js.map +7 -0
  118. package/dist/index.css +11 -0
  119. package/dist/index.css.map +7 -0
  120. package/dist/index.d.ts +38 -0
  121. package/dist/index.js +133 -0
  122. package/dist/index.js.map +7 -0
  123. package/dist/meta.cjs.json +13085 -0
  124. package/dist/meta.esbuild.json +13693 -0
  125. package/dist/transcription-BTSB7FZH.js +356 -0
  126. package/dist/transcription-BTSB7FZH.js.map +7 -0
  127. package/dist/utils/animations.d.ts +92 -0
  128. package/dist/utils/index.d.ts +2 -0
  129. package/dist/utils/styles.d.ts +21 -0
  130. package/package.json +116 -0
  131. package/src/Accordion/Accordion.stories.tsx +50 -0
  132. package/src/Accordion/Accordion.tsx +88 -0
  133. package/src/Accordion/index.ts +8 -0
  134. package/src/AudioLevel/AudioLevel.tsx +34 -0
  135. package/src/AudioLevel/index.ts +1 -0
  136. package/src/Avatar/Avatar.stories.tsx +33 -0
  137. package/src/Avatar/Avatar.tsx +55 -0
  138. package/src/Avatar/getAvatarBg.ts +46 -0
  139. package/src/Avatar/index.ts +1 -0
  140. package/src/Button/Button.mdx +43 -0
  141. package/src/Button/Button.stories.tsx +52 -0
  142. package/src/Button/Button.tsx +144 -0
  143. package/src/Button/index.tsx +1 -0
  144. package/src/Chat/Chat.mdx +39 -0
  145. package/src/Chat/Chat.stories.tsx +39 -0
  146. package/src/Checkbox/Checkbox.stories.tsx +61 -0
  147. package/src/Checkbox/Checkbox.tsx +33 -0
  148. package/src/Checkbox/index.tsx +1 -0
  149. package/src/Collapsible/Collapsible.tsx +34 -0
  150. package/src/Collapsible/index.tsx +1 -0
  151. package/src/Divider/Divider.tsx +45 -0
  152. package/src/Divider/HorizontalDivider.stories.tsx +34 -0
  153. package/src/Divider/VerticalDivider.stories.tsx +40 -0
  154. package/src/Divider/index.ts +1 -0
  155. package/src/Dropdown/Dropdown.stories.tsx +94 -0
  156. package/src/Dropdown/Dropdown.tsx +142 -0
  157. package/src/Dropdown/index.tsx +1 -0
  158. package/src/Fieldset/Fieldset.stories.tsx +29 -0
  159. package/src/Fieldset/Fieldset.tsx +11 -0
  160. package/src/Fieldset/index.tsx +1 -0
  161. package/src/Footer/Footer.stories.tsx +61 -0
  162. package/src/Footer/Footer.tsx +47 -0
  163. package/src/Footer/index.tsx +1 -0
  164. package/src/IconButton/IconButton.tsx +45 -0
  165. package/src/IconButton/index.tsx +1 -0
  166. package/src/Icons/Icons.stories.mdx +10 -0
  167. package/src/Icons/IconsList.jsx +17 -0
  168. package/src/Input/Input.stories.tsx +25 -0
  169. package/src/Input/Input.tsx +105 -0
  170. package/src/Input/PasswordInput.stories.tsx +53 -0
  171. package/src/Input/index.tsx +1 -0
  172. package/src/Introduction/Integrating.stories.mdx +100 -0
  173. package/src/Introduction/Introduction.stories.mdx +9 -0
  174. package/src/Label/Label.tsx +8 -0
  175. package/src/Label/index.ts +1 -0
  176. package/src/Layout/Box.tsx +3 -0
  177. package/src/Layout/Flex.tsx +76 -0
  178. package/src/Layout/index.tsx +2 -0
  179. package/src/Link/Link.stories.tsx +18 -0
  180. package/src/Link/Link.tsx +54 -0
  181. package/src/Link/index.tsx +2 -0
  182. package/src/Loading/Loading.mdx +15 -0
  183. package/src/Loading/Loading.stories.tsx +37 -0
  184. package/src/Loading/Loading.tsx +33 -0
  185. package/src/Loading/index.ts +1 -0
  186. package/src/Modal/Dialog.mdx +19 -0
  187. package/src/Modal/Dialog.stories.tsx +68 -0
  188. package/src/Modal/Dialog.tsx +26 -0
  189. package/src/Modal/DialogContent.tsx +63 -0
  190. package/src/Modal/index.ts +1 -0
  191. package/src/Pagination/StyledPagination.stories.tsx +80 -0
  192. package/src/Pagination/StyledPagination.tsx +68 -0
  193. package/src/Pagination/index.tsx +1 -0
  194. package/src/Popover/Popover.mdx +9 -0
  195. package/src/Popover/Popover.stories.tsx +95 -0
  196. package/src/Popover/index.tsx +26 -0
  197. package/src/Prebuilt/App.jsx +273 -0
  198. package/src/Prebuilt/AppContext.jsx +21 -0
  199. package/src/Prebuilt/IconButton.jsx +19 -0
  200. package/src/Prebuilt/Prebuilt.stories.tsx +20 -0
  201. package/src/Prebuilt/common/PeersSorter.js +89 -0
  202. package/src/Prebuilt/common/constants.js +208 -0
  203. package/src/Prebuilt/common/hooks.js +47 -0
  204. package/src/Prebuilt/common/roles.js +4 -0
  205. package/src/Prebuilt/common/useSortedPeers.js +28 -0
  206. package/src/Prebuilt/common/utils.js +91 -0
  207. package/src/Prebuilt/components/AppData/AppData.jsx +189 -0
  208. package/src/Prebuilt/components/AppData/useAppConfig.js +7 -0
  209. package/src/Prebuilt/components/AppData/useAppLayout.js +6 -0
  210. package/src/Prebuilt/components/AppData/useChatState.js +18 -0
  211. package/src/Prebuilt/components/AppData/useSidepane.js +49 -0
  212. package/src/Prebuilt/components/AppData/useUISettings.js +164 -0
  213. package/src/Prebuilt/components/AudioLevel/BeamSpeakerLabelsLogging.jsx +16 -0
  214. package/src/Prebuilt/components/AudioVideoToggle.jsx +67 -0
  215. package/src/Prebuilt/components/AuthToken.jsx +133 -0
  216. package/src/Prebuilt/components/BottomActionSheet/BottomActionSheet.jsx +96 -0
  217. package/src/Prebuilt/components/BottomActionSheet/BottomActionSheet.stories.tsx +46 -0
  218. package/src/Prebuilt/components/Chat/Chat.jsx +155 -0
  219. package/src/Prebuilt/components/Chat/ChatBody.jsx +370 -0
  220. package/src/Prebuilt/components/Chat/ChatFooter.jsx +150 -0
  221. package/src/Prebuilt/components/Chat/ChatHeader.jsx +67 -0
  222. package/src/Prebuilt/components/Chat/ChatSelector.jsx +162 -0
  223. package/src/Prebuilt/components/Chat/useEmojiPickerStyles.js +30 -0
  224. package/src/Prebuilt/components/Chat/useUnreadCount.js +17 -0
  225. package/src/Prebuilt/components/Connection/ConnectionIndicator.jsx +80 -0
  226. package/src/Prebuilt/components/Connection/TileConnection.jsx +40 -0
  227. package/src/Prebuilt/components/Connection/connectionQualityUtils.js +39 -0
  228. package/src/Prebuilt/components/EmojiReaction.jsx +138 -0
  229. package/src/Prebuilt/components/ErrorBoundary.jsx +105 -0
  230. package/src/Prebuilt/components/FirstPersonDisplay.jsx +50 -0
  231. package/src/Prebuilt/components/Footer/ChatToggle.jsx +27 -0
  232. package/src/Prebuilt/components/Footer/ConferencingFooter.jsx +104 -0
  233. package/src/Prebuilt/components/Footer/StreamingFooter.jsx +71 -0
  234. package/src/Prebuilt/components/Footer.jsx +8 -0
  235. package/src/Prebuilt/components/FullPageProgress.jsx +11 -0
  236. package/src/Prebuilt/components/GoLiveButton.jsx +45 -0
  237. package/src/Prebuilt/components/HMSVideo/Controls.jsx +21 -0
  238. package/src/Prebuilt/components/HMSVideo/FullscreenButton.jsx +18 -0
  239. package/src/Prebuilt/components/HMSVideo/HLSAutoplayBlockedPrompt.jsx +35 -0
  240. package/src/Prebuilt/components/HMSVideo/HLSQualitySelector.jsx +82 -0
  241. package/src/Prebuilt/components/HMSVideo/HMSVIdeoUtils.js +27 -0
  242. package/src/Prebuilt/components/HMSVideo/HMSVideo.jsx +11 -0
  243. package/src/Prebuilt/components/HMSVideo/PlayButton.jsx +13 -0
  244. package/src/Prebuilt/components/HMSVideo/VideoProgress.jsx +77 -0
  245. package/src/Prebuilt/components/HMSVideo/VideoTime.jsx +31 -0
  246. package/src/Prebuilt/components/HMSVideo/VolumeControl.jsx +39 -0
  247. package/src/Prebuilt/components/HMSVideo/index.js +19 -0
  248. package/src/Prebuilt/components/Header/AdditionalRoomState.jsx +217 -0
  249. package/src/Prebuilt/components/Header/AmbientMusic.jsx +88 -0
  250. package/src/Prebuilt/components/Header/ConferencingHeader.jsx +29 -0
  251. package/src/Prebuilt/components/Header/Header.jsx +8 -0
  252. package/src/Prebuilt/components/Header/HeaderComponents.jsx +41 -0
  253. package/src/Prebuilt/components/Header/ParticipantFilter.jsx +91 -0
  254. package/src/Prebuilt/components/Header/ParticipantList.jsx +337 -0
  255. package/src/Prebuilt/components/Header/StreamActions.jsx +225 -0
  256. package/src/Prebuilt/components/Header/StreamingHeader.jsx +55 -0
  257. package/src/Prebuilt/components/Header/index.jsx +1 -0
  258. package/src/Prebuilt/components/HlsStatsOverlay.jsx +101 -0
  259. package/src/Prebuilt/components/Image.jsx +7 -0
  260. package/src/Prebuilt/components/Input/KeyboardInputManager.js +107 -0
  261. package/src/Prebuilt/components/LeaveRoom.jsx +202 -0
  262. package/src/Prebuilt/components/MetaActions.jsx +45 -0
  263. package/src/Prebuilt/components/MoreSettings/BulkRoleChangeModal.jsx +139 -0
  264. package/src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx +92 -0
  265. package/src/Prebuilt/components/MoreSettings/ChangeSelfRole.jsx +67 -0
  266. package/src/Prebuilt/components/MoreSettings/EmbedUrl.jsx +106 -0
  267. package/src/Prebuilt/components/MoreSettings/FullScreenItem.jsx +29 -0
  268. package/src/Prebuilt/components/MoreSettings/MoreSettings.jsx +225 -0
  269. package/src/Prebuilt/components/MoreSettings/MuteAllModal.jsx +90 -0
  270. package/src/Prebuilt/components/Notifications/AutoplayBlockedModal.jsx +38 -0
  271. package/src/Prebuilt/components/Notifications/InitErrorModal.jsx +39 -0
  272. package/src/Prebuilt/components/Notifications/MessageNotifications.jsx +25 -0
  273. package/src/Prebuilt/components/Notifications/Notifications.jsx +151 -0
  274. package/src/Prebuilt/components/Notifications/PeerNotifications.jsx +45 -0
  275. package/src/Prebuilt/components/Notifications/PermissionErrorModal.jsx +67 -0
  276. package/src/Prebuilt/components/Notifications/ReconnectNotifications.jsx +69 -0
  277. package/src/Prebuilt/components/Notifications/TrackBulkUnmuteModal.jsx +51 -0
  278. package/src/Prebuilt/components/Notifications/TrackNotifications.jsx +19 -0
  279. package/src/Prebuilt/components/Notifications/TrackUnmuteModal.jsx +49 -0
  280. package/src/Prebuilt/components/Notifications/index.jsx +1 -0
  281. package/src/Prebuilt/components/PIP/PIPComponent.jsx +82 -0
  282. package/src/Prebuilt/components/PIP/PIPManager.js +296 -0
  283. package/src/Prebuilt/components/PIP/SetupMediaSession.js +60 -0
  284. package/src/Prebuilt/components/PIP/index.jsx +11 -0
  285. package/src/Prebuilt/components/PIP/pip.test.js +72 -0
  286. package/src/Prebuilt/components/PIP/pipUtils.js +183 -0
  287. package/src/Prebuilt/components/Pagination.jsx +29 -0
  288. package/src/Prebuilt/components/Playlist/Playlist.jsx +129 -0
  289. package/src/Prebuilt/components/Playlist/PlaylistControls.jsx +172 -0
  290. package/src/Prebuilt/components/Playlist/PlaylistItem.jsx +51 -0
  291. package/src/Prebuilt/components/Playlist/VideoPlayer.jsx +95 -0
  292. package/src/Prebuilt/components/PostLeave.jsx +76 -0
  293. package/src/Prebuilt/components/Preview/PreviewContainer.jsx +51 -0
  294. package/src/Prebuilt/components/Preview/PreviewJoin.jsx +196 -0
  295. package/src/Prebuilt/components/Preview/PreviewName.jsx +37 -0
  296. package/src/Prebuilt/components/RoleChangeModal.jsx +185 -0
  297. package/src/Prebuilt/components/RoleChangeRequestModal.jsx +26 -0
  298. package/src/Prebuilt/components/ScreenShare.jsx +45 -0
  299. package/src/Prebuilt/components/ScreenshareDisplay.jsx +45 -0
  300. package/src/Prebuilt/components/ScreenshareHintModal.jsx +37 -0
  301. package/src/Prebuilt/components/ScreenshareTile.jsx +91 -0
  302. package/src/Prebuilt/components/Settings/DeviceSettings.jsx +220 -0
  303. package/src/Prebuilt/components/Settings/LayoutSettings.jsx +91 -0
  304. package/src/Prebuilt/components/Settings/NotificationSettings.jsx +61 -0
  305. package/src/Prebuilt/components/Settings/SettingsModal.jsx +171 -0
  306. package/src/Prebuilt/components/Settings/StartRecording.jsx +130 -0
  307. package/src/Prebuilt/components/Settings/SwitchWithLabel.jsx +40 -0
  308. package/src/Prebuilt/components/Settings/common.js +15 -0
  309. package/src/Prebuilt/components/ShareMenuIcon.jsx +26 -0
  310. package/src/Prebuilt/components/StatsForNerds.jsx +250 -0
  311. package/src/Prebuilt/components/Streaming/Common.jsx +132 -0
  312. package/src/Prebuilt/components/Streaming/HLSStreaming.jsx +226 -0
  313. package/src/Prebuilt/components/Streaming/RTMPIcon.jsx +24 -0
  314. package/src/Prebuilt/components/Streaming/RTMPStreaming.jsx +336 -0
  315. package/src/Prebuilt/components/Streaming/ResolutionInput.jsx +88 -0
  316. package/src/Prebuilt/components/Streaming/StreamingLanding.jsx +76 -0
  317. package/src/Prebuilt/components/TileMenu.jsx +275 -0
  318. package/src/Prebuilt/components/Toast/Toast.jsx +17 -0
  319. package/src/Prebuilt/components/Toast/ToastBatcher.js +57 -0
  320. package/src/Prebuilt/components/Toast/ToastConfig.jsx +134 -0
  321. package/src/Prebuilt/components/Toast/ToastContainer.jsx +30 -0
  322. package/src/Prebuilt/components/Toast/ToastManager.js +44 -0
  323. package/src/Prebuilt/components/VideoList.jsx +101 -0
  324. package/src/Prebuilt/components/VideoTile.jsx +177 -0
  325. package/src/Prebuilt/components/conference.jsx +164 -0
  326. package/src/Prebuilt/components/gridView.jsx +85 -0
  327. package/src/Prebuilt/components/hooks/useDropdownList.jsx +23 -0
  328. package/src/Prebuilt/components/hooks/useDropdownSelection.jsx +6 -0
  329. package/src/Prebuilt/components/hooks/useFeatures.js +22 -0
  330. package/src/Prebuilt/components/hooks/useFullscreen.js +43 -0
  331. package/src/Prebuilt/components/hooks/useMetadata.jsx +52 -0
  332. package/src/Prebuilt/components/hooks/useNavigation.js +19 -0
  333. package/src/Prebuilt/components/hooks/usePlaylist.js +25 -0
  334. package/src/Prebuilt/components/hooks/usePlaylistMusic.js +35 -0
  335. package/src/Prebuilt/components/hooks/useScreenshareAudio.js +28 -0
  336. package/src/Prebuilt/components/hooks/useSetPinnedMessage.js +38 -0
  337. package/src/Prebuilt/components/hooks/useSkipPreview.jsx +20 -0
  338. package/src/Prebuilt/components/hooks/useUserPreferences.jsx +25 -0
  339. package/src/Prebuilt/components/init/Init.jsx +58 -0
  340. package/src/Prebuilt/components/init/initUtils.js +90 -0
  341. package/src/Prebuilt/components/pdfAnnotator/pdfErrorView.jsx +29 -0
  342. package/src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx +108 -0
  343. package/src/Prebuilt/components/pdfAnnotator/pdfHeader.jsx +31 -0
  344. package/src/Prebuilt/components/pdfAnnotator/pdfInfo.jsx +32 -0
  345. package/src/Prebuilt/components/pdfAnnotator/shareScreenOptions.jsx +233 -0
  346. package/src/Prebuilt/components/pdfAnnotator/submitPdf.jsx +89 -0
  347. package/src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx +85 -0
  348. package/src/Prebuilt/components/peerTileUtils.jsx +27 -0
  349. package/src/Prebuilt/hms.js +7 -0
  350. package/src/Prebuilt/images/first_person.png +0 -0
  351. package/src/Prebuilt/index.d.ts +15 -0
  352. package/src/Prebuilt/index.js +2 -0
  353. package/src/Prebuilt/layouts/ActiveSpeakerView.jsx +34 -0
  354. package/src/Prebuilt/layouts/EmbedView.jsx +141 -0
  355. package/src/Prebuilt/layouts/HLSView.jsx +290 -0
  356. package/src/Prebuilt/layouts/InsetView.jsx +222 -0
  357. package/src/Prebuilt/layouts/NonPublisherView.jsx +51 -0
  358. package/src/Prebuilt/layouts/PDFView.jsx +122 -0
  359. package/src/Prebuilt/layouts/PinnedTrackView.jsx +59 -0
  360. package/src/Prebuilt/layouts/SidePane.jsx +51 -0
  361. package/src/Prebuilt/layouts/WaitingView.jsx +51 -0
  362. package/src/Prebuilt/layouts/WhiteboardView.jsx +66 -0
  363. package/src/Prebuilt/layouts/mainGridView.jsx +98 -0
  364. package/src/Prebuilt/layouts/mainView.jsx +113 -0
  365. package/src/Prebuilt/layouts/screenShareView.jsx +185 -0
  366. package/src/Prebuilt/plugins/FlyingEmoji.jsx +132 -0
  367. package/src/Prebuilt/plugins/RemoteStopScreenshare.jsx +18 -0
  368. package/src/Prebuilt/plugins/VirtualBackground/VirtualBackground.jsx +90 -0
  369. package/src/Prebuilt/plugins/VirtualBackground/vbutils.js +66 -0
  370. package/src/Prebuilt/plugins/confetti.jsx +60 -0
  371. package/src/Prebuilt/plugins/transcription/Transcriber.js +216 -0
  372. package/src/Prebuilt/plugins/transcription/TranscriptionButton.jsx +138 -0
  373. package/src/Prebuilt/plugins/transcription/index.jsx +1 -0
  374. package/src/Prebuilt/plugins/whiteboard/PusherCommunicationProvider.js +110 -0
  375. package/src/Prebuilt/plugins/whiteboard/README.md +29 -0
  376. package/src/Prebuilt/plugins/whiteboard/ToggleWhiteboard.jsx +43 -0
  377. package/src/Prebuilt/plugins/whiteboard/Whiteboard.css +12 -0
  378. package/src/Prebuilt/plugins/whiteboard/Whiteboard.jsx +11 -0
  379. package/src/Prebuilt/plugins/whiteboard/WhiteboardEvents.js +8 -0
  380. package/src/Prebuilt/plugins/whiteboard/index.js +3 -0
  381. package/src/Prebuilt/plugins/whiteboard/useMultiplayerState.js +212 -0
  382. package/src/Prebuilt/plugins/whiteboard/useWhiteboardMetadata.js +47 -0
  383. package/src/Prebuilt/primitives/DialogContent.jsx +280 -0
  384. package/src/Prebuilt/primitives/DropdownTrigger.jsx +46 -0
  385. package/src/Prebuilt/services/FeatureFlags.jsx +47 -0
  386. package/src/Prebuilt/services/tokenService.js +49 -0
  387. package/src/Progress/index.tsx +17 -0
  388. package/src/QRCode/QRCode.mdx +9 -0
  389. package/src/QRCode/QRCode.stories.tsx +29 -0
  390. package/src/QRCode/QRCode.tsx +6 -0
  391. package/src/QRCode/index.tsx +1 -0
  392. package/src/RadioGroup/RadioGroup.stories.tsx +32 -0
  393. package/src/RadioGroup/RadioGroup.tsx +33 -0
  394. package/src/RadioGroup/index.tsx +1 -0
  395. package/src/ReactSelect/ReactSelect.stories.tsx +83 -0
  396. package/src/ReactSelect/ReactSelect.tsx +97 -0
  397. package/src/ReactSelect/index.ts +1 -0
  398. package/src/Select/Select.stories.tsx +33 -0
  399. package/src/Select/Select.tsx +63 -0
  400. package/src/Select/index.ts +1 -0
  401. package/src/Slider/Slider.stories.tsx +21 -0
  402. package/src/Slider/Slider.tsx +70 -0
  403. package/src/Slider/index.ts +1 -0
  404. package/src/Stats/Stats.tsx +211 -0
  405. package/src/Stats/StyledStats.tsx +57 -0
  406. package/src/Stats/formatBytes.ts +19 -0
  407. package/src/Stats/index.tsx +1 -0
  408. package/src/Switch/Switch.mdx +11 -0
  409. package/src/Switch/Switch.stories.tsx +46 -0
  410. package/src/Switch/Switch.tsx +52 -0
  411. package/src/Switch/index.ts +1 -0
  412. package/src/Tabs/Tabs.stories.tsx +77 -0
  413. package/src/Tabs/Tabs.tsx +41 -0
  414. package/src/Tabs/index.tsx +1 -0
  415. package/src/Text/Text.stories.tsx +21 -0
  416. package/src/Text/Text.tsx +149 -0
  417. package/src/Text/index.tsx +1 -0
  418. package/src/Theme/Theme.stories.mdx +8 -0
  419. package/src/Theme/ThemeProvider.tsx +104 -0
  420. package/src/Theme/ThemeStory.jsx +58 -0
  421. package/src/Theme/base.config.ts +264 -0
  422. package/src/Theme/index.tsx +3 -0
  423. package/src/Theme/stitches.config.ts +100 -0
  424. package/src/Theme/themes.ts +70 -0
  425. package/src/Theme/useSSR.tsx +24 -0
  426. package/src/TileMenu/StyledMenuTile.tsx +101 -0
  427. package/src/TileMenu/TileMenu.tsx +96 -0
  428. package/src/TileMenu/index.tsx +1 -0
  429. package/src/Toast/AppToast.stories.tsx +56 -0
  430. package/src/Toast/Toast.mdx +19 -0
  431. package/src/Toast/Toast.stories.tsx +57 -0
  432. package/src/Toast/Toast.tsx +168 -0
  433. package/src/Toast/index.tsx +1 -0
  434. package/src/Tooltip/Tooltip.stories.tsx +62 -0
  435. package/src/Tooltip/Tooltip.tsx +79 -0
  436. package/src/Tooltip/index.ts +1 -0
  437. package/src/Video/UseVideo.mdx +22 -0
  438. package/src/Video/UseVideo.stories.tsx +26 -0
  439. package/src/Video/Video.mdx +24 -0
  440. package/src/Video/Video.stories.tsx +27 -0
  441. package/src/Video/Video.tsx +61 -0
  442. package/src/Video/index.tsx +1 -0
  443. package/src/VideoList/StyledVideoList.tsx +39 -0
  444. package/src/VideoList/VideoList.stories.tsx +92 -0
  445. package/src/VideoList/index.tsx +2 -0
  446. package/src/VideoList/videoListUtils.tsx +20 -0
  447. package/src/VideoTile/StyledVideoTile.tsx +148 -0
  448. package/src/VideoTile/VideoTile.mdx +28 -0
  449. package/src/VideoTile/VideoTile.stories.tsx +32 -0
  450. package/src/VideoTile/index.tsx +1 -0
  451. package/src/fixtures/chats.ts +25 -0
  452. package/src/fixtures/peers.ts +24 -0
  453. package/src/fixtures/tracks.ts +11 -0
  454. package/src/index.ts +38 -0
  455. package/src/store/SetupFakeStore.ts +33 -0
  456. package/src/store/StorybookSDK.ts +229 -0
  457. package/src/utils/animations.ts +90 -0
  458. package/src/utils/index.ts +2 -0
  459. package/src/utils/styles.ts +22 -0
@@ -0,0 +1,24 @@
1
+ export const RTMPIcon = props => {
2
+ return (
3
+ <svg width="49" height="50" viewBox="0 0 49 50" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
4
+ <rect x="1.368" y="22.63" width="21.148" height="21.148" rx="10.574" fill="#fff" />
5
+ <rect x="1.368" y="22.63" width="21.148" height="21.148" rx="10.574" fill="url(#a)" />
6
+ <rect x="1.368" y="22.63" width="21.148" height="21.148" rx="10.574" stroke="#1B1F26" />
7
+ <rect x="12.286" y=".786" width="26.527" height="27.423" rx="13.263" fill="url(#b)" stroke="#1B1F26" />
8
+ <rect x="20.243" y="21.029" width="27.893" height="27.893" rx="13.946" fill="#9146FF" />
9
+ <rect x="20.243" y="21.029" width="27.893" height="27.893" rx="13.946" fill="url(#c)" />
10
+ <rect x="20.243" y="21.029" width="27.893" height="27.893" rx="13.946" stroke="#1B1F26" />
11
+ <defs>
12
+ <pattern id="a" patternContentUnits="objectBoundingBox" width="1" height="1">
13
+ <use transform="matrix(.001 0 0 .001 .094 .095)" />
14
+ </pattern>
15
+ <pattern id="b" patternContentUnits="objectBoundingBox" width="1" height="1">
16
+ <use transform="matrix(.00065 0 0 .00063 -.018 0)" />
17
+ </pattern>
18
+ <pattern id="c" patternContentUnits="objectBoundingBox" width="1" height="1">
19
+ <use transform="translate(.078 .094) scale(.00117)" />
20
+ </pattern>
21
+ </defs>
22
+ </svg>
23
+ );
24
+ };
@@ -0,0 +1,336 @@
1
+ import React, { useEffect, useRef, useState } from 'react';
2
+ import { selectAppData, useHMSActions, useHMSStore, useRecordingStreaming } from '@100mslive/react-sdk';
3
+ import { AddCircleIcon, EndStreamIcon, GoLiveIcon, PencilIcon, SettingsIcon, TrashIcon } from '@100mslive/react-icons';
4
+ import { Accordion, Box, Button, Flex, Input, Label, Loading, Text } from '../../../';
5
+ import { Container, ContentBody, ContentHeader, ErrorText, RecordStream } from './Common';
6
+ import { ResolutionInput } from './ResolutionInput';
7
+ import { useSetAppDataByKey } from '../AppData/useUISettings';
8
+ import { UserPreferencesKeys, useUserPreferences } from '../hooks/useUserPreferences';
9
+ import { APP_DATA, RTMP_RECORD_DEFAULT_RESOLUTION } from '../../common/constants';
10
+
11
+ export const RTMPStreaming = ({ onBack }) => {
12
+ const { isRTMPRunning } = useRecordingStreaming();
13
+
14
+ return (
15
+ <Container>
16
+ <ContentHeader title="Start Streaming" content="Choose a destination" onBack={onBack} />
17
+ <ContentBody Icon={SettingsIcon} title="RTMP">
18
+ Live Stream your call to Twitch, YouTube, Facebook and any app which supports RTMP, all at the same time
19
+ </ContentBody>
20
+ {!isRTMPRunning ? <StartRTMP /> : <EndRTMP />}
21
+ </Container>
22
+ );
23
+ };
24
+
25
+ const StartRTMP = () => {
26
+ const [rtmpPreference = [], setRTMPPreference] = useUserPreferences(UserPreferencesKeys.RTMP_URLS);
27
+ const [rtmpStreams, setRTMPStreams] = useState(
28
+ rtmpPreference.length > 0
29
+ ? rtmpPreference
30
+ : [
31
+ {
32
+ name: 'Stream',
33
+ id: Date.now(),
34
+ rtmpURL: '',
35
+ streamKey: '',
36
+ },
37
+ ],
38
+ );
39
+ const hmsActions = useHMSActions();
40
+ const recordingUrl = useHMSStore(selectAppData(APP_DATA.recordingUrl));
41
+ const [error, setError] = useState(false);
42
+ const [record, setRecord] = useState(false);
43
+ const [resolution, setResolution] = useState(RTMP_RECORD_DEFAULT_RESOLUTION);
44
+ const [isRTMPStarted, setRTMPStarted] = useSetAppDataByKey(APP_DATA.rtmpStarted);
45
+ const hasRTMPURL = rtmpStreams.some(value => value.rtmpURL && value.streamKey);
46
+
47
+ return (
48
+ <Box
49
+ css={{ overflowY: 'auto' }}
50
+ as="form"
51
+ onSubmit={e => {
52
+ e.preventDefault();
53
+ }}
54
+ >
55
+ {rtmpStreams.length > 0 && (
56
+ <Box css={{ px: '$10' }}>
57
+ <Accordion.Root type="single" collapsible defaultValue={rtmpStreams[0].id}>
58
+ {rtmpStreams.map((rtmp, index) => {
59
+ return (
60
+ <Accordion.Item
61
+ value={rtmp.id}
62
+ key={rtmp.id}
63
+ css={{
64
+ border: '2px solid $surfaceLight !important',
65
+ r: '$1',
66
+ my: '$4',
67
+ }}
68
+ >
69
+ <AccordionHeader rtmp={rtmp} setRTMPStreams={setRTMPStreams} />
70
+ <Accordion.Content css={{ px: '$8', py: 0 }}>
71
+ <RTMPForm {...rtmp} setRTMPStreams={setRTMPStreams} testId={`${index}_rtmp`} />
72
+ </Accordion.Content>
73
+ </Accordion.Item>
74
+ );
75
+ })}
76
+ </Accordion.Root>
77
+ </Box>
78
+ )}
79
+ <ResolutionInput
80
+ testId="rtmp_resolution"
81
+ onResolutionChange={setResolution}
82
+ css={{
83
+ flexDirection: 'column',
84
+ alignItems: 'start',
85
+ px: '$10',
86
+ my: '$8',
87
+ }}
88
+ />
89
+ <RecordStream record={record} setRecord={setRecord} testId="rtmp_recording" />
90
+ <Box css={{ p: '$8 $10', '@lg': { display: 'flex', gap: '$4' } }}>
91
+ {rtmpStreams.length < 3 && (
92
+ <Button
93
+ data-testid="add_stream"
94
+ variant="standard"
95
+ outlined
96
+ icon
97
+ css={{ my: '$4', w: '100%' }}
98
+ onClick={() => {
99
+ setRTMPStreams(streams => [
100
+ ...streams,
101
+ {
102
+ name: 'Stream',
103
+ id: Date.now(),
104
+ rtmpURL: '',
105
+ streamKey: '',
106
+ },
107
+ ]);
108
+ }}
109
+ >
110
+ <AddCircleIcon /> Add Stream
111
+ </Button>
112
+ )}
113
+
114
+ <Button
115
+ data-testid="start_rtmp"
116
+ variant="primary"
117
+ icon
118
+ type="submit"
119
+ css={{ w: '100%', my: '$4' }}
120
+ disabled={isRTMPStarted || (rtmpStreams.length === 0 && !record)}
121
+ onClick={async () => {
122
+ try {
123
+ const hasInvalidData = rtmpStreams.find(
124
+ value => (value.rtmpURL && !value.streamKey) || (value.streamKey && !value.rtmpURL),
125
+ );
126
+ if (hasInvalidData || (rtmpStreams.length > 0 && !hasRTMPURL)) {
127
+ return;
128
+ }
129
+ setError('');
130
+ setRTMPStarted(true);
131
+ const urls = hasRTMPURL ? rtmpStreams.map(value => `${value.rtmpURL}/${value.streamKey}`) : [];
132
+ await hmsActions.startRTMPOrRecording({
133
+ rtmpURLs: urls,
134
+ meetingURL: recordingUrl,
135
+ resolution: getResolution(resolution),
136
+ record: record,
137
+ });
138
+ setRTMPPreference(rtmpStreams);
139
+ } catch (error) {
140
+ console.error(error);
141
+ setError(error.message);
142
+ setRTMPStarted(false);
143
+ }
144
+ }}
145
+ >
146
+ {isRTMPStarted ? <Loading size={24} color="currentColor" /> : <GoLiveIcon />}
147
+ {isRTMPStarted ? 'Starting stream...' : 'Go Live'}
148
+ </Button>
149
+ <ErrorText error={error} />
150
+ </Box>
151
+ </Box>
152
+ );
153
+ };
154
+
155
+ const EndRTMP = () => {
156
+ const hmsActions = useHMSActions();
157
+ const [inProgress, setInProgress] = useState(false);
158
+ const [error, setError] = useState('');
159
+ const { isRTMPRunning } = useRecordingStreaming();
160
+
161
+ useEffect(() => {
162
+ if (inProgress && !isRTMPRunning) {
163
+ setInProgress(false);
164
+ }
165
+ }, [inProgress, isRTMPRunning]);
166
+
167
+ return (
168
+ <Box css={{ p: '$4 $10' }}>
169
+ <ErrorText error={error} />
170
+ <Button
171
+ data-testid="stop_rtmp"
172
+ variant="danger"
173
+ css={{ w: '100%', r: '$0', my: '$8' }}
174
+ icon
175
+ loading={inProgress}
176
+ disabled={inProgress}
177
+ onClick={async () => {
178
+ try {
179
+ setInProgress(true);
180
+ await hmsActions.stopRTMPAndRecording();
181
+ } catch (error) {
182
+ setError(error.message);
183
+ setInProgress(false);
184
+ }
185
+ }}
186
+ >
187
+ <EndStreamIcon />
188
+ End Stream
189
+ </Button>
190
+ </Box>
191
+ );
192
+ };
193
+
194
+ const ActionIcon = ({ icon: Icon, onClick }) => {
195
+ return (
196
+ <Text as="span" css={{ mx: '$2', cursor: 'pointer' }} onClick={onClick}>
197
+ <Icon width={16} height={16} />
198
+ </Text>
199
+ );
200
+ };
201
+
202
+ const FormLabel = ({ id, children }) => {
203
+ return (
204
+ <Label htmlFor={id} css={{ color: '$textHighEmp', my: '$4', fontSize: '$sm' }}>
205
+ {children}
206
+ </Label>
207
+ );
208
+ };
209
+
210
+ const RTMPForm = ({ rtmpURL, id, streamKey, setRTMPStreams, testId }) => {
211
+ const formRef = useRef(null);
212
+ return (
213
+ <Flex id={id} direction="column" css={{ mb: '$8', px: '$8' }} ref={formRef}>
214
+ <FormLabel id="rtmpURL">
215
+ RTMP URL
216
+ <Asterik />
217
+ </FormLabel>
218
+ <Input
219
+ data-testid={`${testId}_url`}
220
+ placeholder="Enter RTMP URL"
221
+ id="rtmpURL"
222
+ name="rtmpURL"
223
+ value={rtmpURL}
224
+ onChange={e => {
225
+ setRTMPStreams(streams =>
226
+ updateStream({
227
+ streams,
228
+ id,
229
+ value: e.target.value,
230
+ key: e.target.name,
231
+ }),
232
+ );
233
+ }}
234
+ required
235
+ />
236
+ <FormLabel id="streamKey">
237
+ Stream Key
238
+ <Asterik />
239
+ </FormLabel>
240
+ <Input
241
+ placeholder="Enter Stream Key"
242
+ id="streamKey"
243
+ name="streamKey"
244
+ value={streamKey}
245
+ data-testid={`${testId}_key`}
246
+ onChange={e => {
247
+ setRTMPStreams(streams =>
248
+ updateStream({
249
+ streams,
250
+ id,
251
+ value: e.target.value,
252
+ key: e.target.name,
253
+ }),
254
+ );
255
+ }}
256
+ required
257
+ />
258
+ </Flex>
259
+ );
260
+ };
261
+
262
+ const Asterik = () => {
263
+ return (
264
+ <Text variant="sm" as="span" css={{ color: '$error', mx: '$2' }}>
265
+ *
266
+ </Text>
267
+ );
268
+ };
269
+ const AccordionHeader = ({ rtmp, setRTMPStreams }) => {
270
+ const [edit, setEdit] = useState(false);
271
+ return (
272
+ <Accordion.Header css={{ px: '$8' }}>
273
+ {edit ? (
274
+ <Input
275
+ defaultValue={rtmp.name}
276
+ autoFocus
277
+ onBlur={e => {
278
+ const value = e.currentTarget.value.trim();
279
+ if (value) {
280
+ setRTMPStreams(streams =>
281
+ streams.map(stream => {
282
+ if (stream.id === rtmp.id) {
283
+ stream.name = value;
284
+ }
285
+ return stream;
286
+ }),
287
+ );
288
+ setEdit(false);
289
+ }
290
+ }}
291
+ />
292
+ ) : (
293
+ <Text css={{ flex: '1 1 0' }}>{rtmp.name}</Text>
294
+ )}
295
+ <Flex css={{ mx: '$4', gap: '$2' }}>
296
+ <ActionIcon
297
+ onClick={e => {
298
+ e.stopPropagation();
299
+ setEdit(true);
300
+ }}
301
+ icon={PencilIcon}
302
+ />
303
+ <ActionIcon
304
+ onClick={() => {
305
+ setRTMPStreams(streams => streams.filter(stream => stream.id !== rtmp.id));
306
+ }}
307
+ icon={TrashIcon}
308
+ />
309
+ </Flex>
310
+ </Accordion.Header>
311
+ );
312
+ };
313
+
314
+ const updateStream = ({ streams, id, key, value }) =>
315
+ streams.map(stream => {
316
+ if (stream.id === id) {
317
+ return {
318
+ ...stream,
319
+ [key]: value,
320
+ };
321
+ }
322
+ return stream;
323
+ });
324
+
325
+ export function getResolution(recordingResolution) {
326
+ const resolution = {};
327
+ if (recordingResolution.width) {
328
+ resolution.width = recordingResolution.width;
329
+ }
330
+ if (recordingResolution.height) {
331
+ resolution.height = recordingResolution.height;
332
+ }
333
+ if (Object.keys(resolution).length > 0) {
334
+ return resolution;
335
+ }
336
+ }
@@ -0,0 +1,88 @@
1
+ import React, { useCallback, useState } from 'react';
2
+ import { InfoIcon } from '@100mslive/react-icons';
3
+ import { Flex, Input, Label, Text, Tooltip } from '../../../';
4
+ import { DialogRow } from '../../primitives/DialogContent';
5
+ import {
6
+ RTMP_RECORD_DEFAULT_RESOLUTION,
7
+ RTMP_RECORD_RESOLUTION_MAX,
8
+ RTMP_RECORD_RESOLUTION_MIN,
9
+ } from '../../common/constants';
10
+
11
+ export const ResolutionInput = ({ onResolutionChange, disabled, tooltipText, css, testId }) => {
12
+ const [resolution, setResolution] = useState(RTMP_RECORD_DEFAULT_RESOLUTION);
13
+
14
+ const resolutionChangeHandler = useCallback(
15
+ event => {
16
+ const { name, value } = event.target;
17
+ let width = name === 'resWidth' ? Number(value) : resolution.width;
18
+ let height = name === 'resHeight' ? Number(value) : resolution.height;
19
+
20
+ if (width === 0) {
21
+ width = null;
22
+ }
23
+ if (height === 0) {
24
+ height = null;
25
+ }
26
+ const newResolution = {
27
+ width: !isNaN(width) ? width : RTMP_RECORD_DEFAULT_RESOLUTION.width,
28
+ height: !isNaN(height) ? height : RTMP_RECORD_DEFAULT_RESOLUTION.height,
29
+ };
30
+ setResolution(newResolution);
31
+ },
32
+ [resolution],
33
+ );
34
+
35
+ return (
36
+ <DialogRow breakSm css={css}>
37
+ <Flex gap={1}>
38
+ <Label css={{ mb: '$8' }}>Resolution</Label>
39
+ {tooltipText && (
40
+ <Tooltip title={tooltipText}>
41
+ <div>
42
+ <InfoIcon color="#B0C3DB" />
43
+ </div>
44
+ </Tooltip>
45
+ )}
46
+ </Flex>
47
+ <Flex
48
+ justify="between"
49
+ css={{ width: !tooltipText ? '100%' : '70%', '@sm': { width: '100%' } }}
50
+ gap={2}
51
+ direction="column"
52
+ >
53
+ <Flex justify="between" gap={2}>
54
+ <Flex direction="column" css={{ width: '50%' }}>
55
+ <Text variant="xs">Width</Text>
56
+ <Input
57
+ data-testid={`${testId}_width`}
58
+ css={{ width: '100%', mt: '$4' }}
59
+ name="resWidth"
60
+ value={resolution.width}
61
+ onChange={resolutionChangeHandler}
62
+ readOnly={disabled}
63
+ min={RTMP_RECORD_RESOLUTION_MIN}
64
+ max={RTMP_RECORD_RESOLUTION_MAX}
65
+ onBlur={() => onResolutionChange(resolution)}
66
+ type="number"
67
+ />
68
+ </Flex>
69
+ <Flex direction="column" css={{ width: '50%' }}>
70
+ <Text variant="xs">Height</Text>
71
+ <Input
72
+ data-testid={`${testId}_height`}
73
+ css={{ width: '100%', mt: '$4' }}
74
+ name="resHeight"
75
+ value={resolution.height}
76
+ onChange={resolutionChangeHandler}
77
+ onBlur={() => onResolutionChange(resolution)}
78
+ readOnly={disabled}
79
+ min={RTMP_RECORD_RESOLUTION_MIN}
80
+ max={RTMP_RECORD_RESOLUTION_MAX}
81
+ type="number"
82
+ />
83
+ </Flex>
84
+ </Flex>
85
+ </Flex>
86
+ </DialogRow>
87
+ );
88
+ };
@@ -0,0 +1,76 @@
1
+ import React, { Fragment, useState } from 'react';
2
+ import { selectPermissions, useHMSStore, useRecordingStreaming } from '@100mslive/react-sdk';
3
+ import { ColoredHandIcon, CrossIcon, GoLiveIcon } from '@100mslive/react-icons';
4
+ import { Box, Flex } from '../../../Layout';
5
+ import { Text } from '../../../Text';
6
+ import IconButton from '../../IconButton';
7
+ import { StreamCard } from './Common';
8
+ import { HLSStreaming } from './HLSStreaming';
9
+ import { RTMPIcon } from './RTMPIcon';
10
+ import { RTMPStreaming } from './RTMPStreaming';
11
+ import { useSidepaneToggle } from '../AppData/useSidepane';
12
+ import { SIDE_PANE_OPTIONS } from '../../common/constants';
13
+
14
+ export const StreamingLanding = () => {
15
+ const toggleStreaming = useSidepaneToggle(SIDE_PANE_OPTIONS.STREAMING);
16
+ const { isHLSRunning, isRTMPRunning } = useRecordingStreaming();
17
+ const permissions = useHMSStore(selectPermissions);
18
+ const [showHLS, setShowHLS] = useState(isHLSRunning);
19
+ const [showRTMP, setShowRTMP] = useState(isRTMPRunning);
20
+
21
+ if (!permissions?.hlsStreaming && !permissions?.rtmpStreaming) {
22
+ toggleStreaming();
23
+ return null;
24
+ }
25
+
26
+ return (
27
+ <Fragment>
28
+ <Flex css={{ w: '100%', py: '$8' }}>
29
+ <Box
30
+ css={{
31
+ alignSelf: 'center',
32
+ p: '$4',
33
+ bg: '$surfaceLight',
34
+ r: '$round',
35
+ }}
36
+ >
37
+ <ColoredHandIcon width={40} height={40} />
38
+ </Box>
39
+ <Box css={{ flex: '1 1 0', mx: '$8' }}>
40
+ <Text variant="sm">Welcome !</Text>
41
+ <Text variant="h6">Let’s get you started</Text>
42
+ </Box>
43
+ <IconButton onClick={toggleStreaming} css={{ alignSelf: 'flex-start' }} data-testid="close_streaming">
44
+ <CrossIcon />
45
+ </IconButton>
46
+ </Flex>
47
+ <Text variant="tiny" color="$textMedEmp">
48
+ Start Streaming
49
+ </Text>
50
+ {permissions?.hlsStreaming && (
51
+ <StreamCard
52
+ testId="hls_stream"
53
+ title="Live Stream with HLS"
54
+ subtitle="Stream to millions, edit and control what the viewer sees and more!"
55
+ css={{ my: '$8' }}
56
+ onClick={() => setShowHLS(true)}
57
+ Icon={GoLiveIcon}
58
+ />
59
+ )}
60
+ {permissions?.rtmpStreaming && (
61
+ <StreamCard
62
+ testId="rtmp_stream"
63
+ title="Stream live to Facebook, Twitch, and others"
64
+ subtitle="Stream to a specific destination directly from your app."
65
+ css={{ my: '$8' }}
66
+ onClick={() => {
67
+ setShowRTMP(true);
68
+ }}
69
+ Icon={RTMPIcon}
70
+ />
71
+ )}
72
+ {showHLS && <HLSStreaming onBack={() => setShowHLS(false)} />}
73
+ {showRTMP && <RTMPStreaming onBack={() => setShowRTMP(false)} />}
74
+ </Fragment>
75
+ );
76
+ };