@100mslive/roomkit-react 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -0
- package/dist/Accordion/Accordion.d.ts +964 -0
- package/dist/Accordion/index.d.ts +979 -0
- package/dist/ActiveSpeakerView-H3VYXANB.js +39 -0
- package/dist/ActiveSpeakerView-H3VYXANB.js.map +7 -0
- package/dist/ActiveSpeakerView-REZLWPPI.css +11 -0
- package/dist/ActiveSpeakerView-REZLWPPI.css.map +7 -0
- package/dist/AudioLevel/AudioLevel.d.ts +8 -0
- package/dist/AudioLevel/index.d.ts +1 -0
- package/dist/Avatar/Avatar.d.ts +487 -0
- package/dist/Avatar/getAvatarBg.d.ts +7 -0
- package/dist/Avatar/index.d.ts +1 -0
- package/dist/Button/Button.d.ts +488 -0
- package/dist/Button/index.d.ts +1 -0
- package/dist/Checkbox/Checkbox.d.ts +958 -0
- package/dist/Checkbox/index.d.ts +1 -0
- package/dist/Collapsible/Collapsible.d.ts +1434 -0
- package/dist/Collapsible/index.d.ts +1 -0
- package/dist/Divider/Divider.d.ts +958 -0
- package/dist/Divider/index.d.ts +1 -0
- package/dist/Dropdown/Dropdown.d.ts +5728 -0
- package/dist/Dropdown/index.d.ts +1 -0
- package/dist/Fieldset/Fieldset.d.ts +477 -0
- package/dist/Fieldset/index.d.ts +1 -0
- package/dist/Footer/Footer.d.ts +3834 -0
- package/dist/Footer/index.d.ts +1 -0
- package/dist/HLSView-3RDXRV7Y.js +689 -0
- package/dist/HLSView-3RDXRV7Y.js.map +7 -0
- package/dist/HLSView-6BVBCQM7.css +11 -0
- package/dist/HLSView-6BVBCQM7.css.map +7 -0
- package/dist/IconButton/IconButton.d.ts +479 -0
- package/dist/IconButton/index.d.ts +1 -0
- package/dist/Input/Input.d.ts +2917 -0
- package/dist/Input/index.d.ts +1 -0
- package/dist/Label/Label.d.ts +479 -0
- package/dist/Label/index.d.ts +1 -0
- package/dist/Layout/Box.d.ts +477 -0
- package/dist/Layout/Flex.d.ts +482 -0
- package/dist/Layout/index.d.ts +2 -0
- package/dist/Link/Link.d.ts +489 -0
- package/dist/Link/index.d.ts +2 -0
- package/dist/Loading/Loading.d.ts +14 -0
- package/dist/Loading/index.d.ts +1 -0
- package/dist/Modal/Dialog.d.ts +3826 -0
- package/dist/Modal/DialogContent.d.ts +3343 -0
- package/dist/Modal/index.d.ts +1 -0
- package/dist/Pagination/StyledPagination.d.ts +1918 -0
- package/dist/Pagination/index.d.ts +1 -0
- package/dist/PinnedTrackView-453PELNU.js +70 -0
- package/dist/PinnedTrackView-453PELNU.js.map +7 -0
- package/dist/PinnedTrackView-QQ5FDXJX.css +11 -0
- package/dist/PinnedTrackView-QQ5FDXJX.css.map +7 -0
- package/dist/Popover/index.d.ts +1436 -0
- package/dist/Progress/index.d.ts +957 -0
- package/dist/QRCode/QRCode.d.ts +3 -0
- package/dist/QRCode/index.d.ts +1 -0
- package/dist/RadioGroup/RadioGroup.d.ts +1435 -0
- package/dist/RadioGroup/index.d.ts +1 -0
- package/dist/ReactSelect/ReactSelect.d.ts +4778 -0
- package/dist/ReactSelect/index.d.ts +1 -0
- package/dist/Select/Select.d.ts +1437 -0
- package/dist/Select/index.d.ts +1 -0
- package/dist/Slider/Slider.d.ts +488 -0
- package/dist/Slider/index.d.ts +1 -0
- package/dist/Stats/Stats.d.ts +19 -0
- package/dist/Stats/StyledStats.d.ts +2872 -0
- package/dist/Stats/formatBytes.d.ts +1 -0
- package/dist/Stats/index.d.ts +1 -0
- package/dist/Switch/Switch.d.ts +482 -0
- package/dist/Switch/index.d.ts +1 -0
- package/dist/Tabs/Tabs.d.ts +1912 -0
- package/dist/Tabs/index.d.ts +1 -0
- package/dist/Text/Text.d.ts +605 -0
- package/dist/Text/index.d.ts +1 -0
- package/dist/Theme/ThemeProvider.d.ts +397 -0
- package/dist/Theme/base.config.d.ts +417 -0
- package/dist/Theme/index.d.ts +3 -0
- package/dist/Theme/stitches.config.d.ts +4702 -0
- package/dist/Theme/themes.d.ts +64 -0
- package/dist/Theme/useSSR.d.ts +6 -0
- package/dist/TileMenu/StyledMenuTile.d.ts +3351 -0
- package/dist/TileMenu/TileMenu.d.ts +6 -0
- package/dist/TileMenu/index.d.ts +1 -0
- package/dist/Toast/Toast.d.ts +2881 -0
- package/dist/Toast/index.d.ts +1 -0
- package/dist/Tooltip/Tooltip.d.ts +14 -0
- package/dist/Tooltip/index.d.ts +1 -0
- package/dist/Video/Video.d.ts +499 -0
- package/dist/Video/index.d.ts +1 -0
- package/dist/VideoList/StyledVideoList.d.ts +1438 -0
- package/dist/VideoList/index.d.ts +2 -0
- package/dist/VideoList/videoListUtils.d.ts +1 -0
- package/dist/VideoTile/StyledVideoTile.d.ts +4309 -0
- package/dist/VideoTile/index.d.ts +1 -0
- package/dist/VirtualBackground-LHYBWUT5.js +158 -0
- package/dist/VirtualBackground-LHYBWUT5.js.map +7 -0
- package/dist/chunk-7YUYZ64D.js +6843 -0
- package/dist/chunk-7YUYZ64D.js.map +7 -0
- package/dist/chunk-HCAGFNXW.js +8270 -0
- package/dist/chunk-HCAGFNXW.js.map +7 -0
- package/dist/chunk-KYYP6ZVK.js +907 -0
- package/dist/chunk-KYYP6ZVK.js.map +7 -0
- package/dist/chunk-ULXGBUSC.js +65 -0
- package/dist/chunk-ULXGBUSC.js.map +7 -0
- package/dist/chunk-XRJXE6UO.js +243 -0
- package/dist/chunk-XRJXE6UO.js.map +7 -0
- package/dist/conference-IDNRO4WK.js +3812 -0
- package/dist/conference-IDNRO4WK.js.map +7 -0
- package/dist/conference-KN6OKGDU.css +11 -0
- package/dist/conference-KN6OKGDU.css.map +7 -0
- package/dist/fixtures/chats.d.ts +4 -0
- package/dist/fixtures/peers.d.ts +3 -0
- package/dist/fixtures/tracks.d.ts +2 -0
- package/dist/index.cjs.css +11 -0
- package/dist/index.cjs.css.map +7 -0
- package/dist/index.cjs.js +22987 -0
- package/dist/index.cjs.js.map +7 -0
- package/dist/index.css +11 -0
- package/dist/index.css.map +7 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.js +133 -0
- package/dist/index.js.map +7 -0
- package/dist/meta.cjs.json +13085 -0
- package/dist/meta.esbuild.json +13693 -0
- package/dist/transcription-BTSB7FZH.js +356 -0
- package/dist/transcription-BTSB7FZH.js.map +7 -0
- package/dist/utils/animations.d.ts +92 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/styles.d.ts +21 -0
- package/package.json +116 -0
- package/src/Accordion/Accordion.stories.tsx +50 -0
- package/src/Accordion/Accordion.tsx +88 -0
- package/src/Accordion/index.ts +8 -0
- package/src/AudioLevel/AudioLevel.tsx +34 -0
- package/src/AudioLevel/index.ts +1 -0
- package/src/Avatar/Avatar.stories.tsx +33 -0
- package/src/Avatar/Avatar.tsx +55 -0
- package/src/Avatar/getAvatarBg.ts +46 -0
- package/src/Avatar/index.ts +1 -0
- package/src/Button/Button.mdx +43 -0
- package/src/Button/Button.stories.tsx +52 -0
- package/src/Button/Button.tsx +144 -0
- package/src/Button/index.tsx +1 -0
- package/src/Chat/Chat.mdx +39 -0
- package/src/Chat/Chat.stories.tsx +39 -0
- package/src/Checkbox/Checkbox.stories.tsx +61 -0
- package/src/Checkbox/Checkbox.tsx +33 -0
- package/src/Checkbox/index.tsx +1 -0
- package/src/Collapsible/Collapsible.tsx +34 -0
- package/src/Collapsible/index.tsx +1 -0
- package/src/Divider/Divider.tsx +45 -0
- package/src/Divider/HorizontalDivider.stories.tsx +34 -0
- package/src/Divider/VerticalDivider.stories.tsx +40 -0
- package/src/Divider/index.ts +1 -0
- package/src/Dropdown/Dropdown.stories.tsx +94 -0
- package/src/Dropdown/Dropdown.tsx +142 -0
- package/src/Dropdown/index.tsx +1 -0
- package/src/Fieldset/Fieldset.stories.tsx +29 -0
- package/src/Fieldset/Fieldset.tsx +11 -0
- package/src/Fieldset/index.tsx +1 -0
- package/src/Footer/Footer.stories.tsx +61 -0
- package/src/Footer/Footer.tsx +47 -0
- package/src/Footer/index.tsx +1 -0
- package/src/IconButton/IconButton.tsx +45 -0
- package/src/IconButton/index.tsx +1 -0
- package/src/Icons/Icons.stories.mdx +10 -0
- package/src/Icons/IconsList.jsx +17 -0
- package/src/Input/Input.stories.tsx +25 -0
- package/src/Input/Input.tsx +105 -0
- package/src/Input/PasswordInput.stories.tsx +53 -0
- package/src/Input/index.tsx +1 -0
- package/src/Introduction/Integrating.stories.mdx +100 -0
- package/src/Introduction/Introduction.stories.mdx +9 -0
- package/src/Label/Label.tsx +8 -0
- package/src/Label/index.ts +1 -0
- package/src/Layout/Box.tsx +3 -0
- package/src/Layout/Flex.tsx +76 -0
- package/src/Layout/index.tsx +2 -0
- package/src/Link/Link.stories.tsx +18 -0
- package/src/Link/Link.tsx +54 -0
- package/src/Link/index.tsx +2 -0
- package/src/Loading/Loading.mdx +15 -0
- package/src/Loading/Loading.stories.tsx +37 -0
- package/src/Loading/Loading.tsx +33 -0
- package/src/Loading/index.ts +1 -0
- package/src/Modal/Dialog.mdx +19 -0
- package/src/Modal/Dialog.stories.tsx +68 -0
- package/src/Modal/Dialog.tsx +26 -0
- package/src/Modal/DialogContent.tsx +63 -0
- package/src/Modal/index.ts +1 -0
- package/src/Pagination/StyledPagination.stories.tsx +80 -0
- package/src/Pagination/StyledPagination.tsx +68 -0
- package/src/Pagination/index.tsx +1 -0
- package/src/Popover/Popover.mdx +9 -0
- package/src/Popover/Popover.stories.tsx +95 -0
- package/src/Popover/index.tsx +26 -0
- package/src/Prebuilt/App.jsx +273 -0
- package/src/Prebuilt/AppContext.jsx +21 -0
- package/src/Prebuilt/IconButton.jsx +19 -0
- package/src/Prebuilt/Prebuilt.stories.tsx +20 -0
- package/src/Prebuilt/common/PeersSorter.js +89 -0
- package/src/Prebuilt/common/constants.js +208 -0
- package/src/Prebuilt/common/hooks.js +47 -0
- package/src/Prebuilt/common/roles.js +4 -0
- package/src/Prebuilt/common/useSortedPeers.js +28 -0
- package/src/Prebuilt/common/utils.js +91 -0
- package/src/Prebuilt/components/AppData/AppData.jsx +189 -0
- package/src/Prebuilt/components/AppData/useAppConfig.js +7 -0
- package/src/Prebuilt/components/AppData/useAppLayout.js +6 -0
- package/src/Prebuilt/components/AppData/useChatState.js +18 -0
- package/src/Prebuilt/components/AppData/useSidepane.js +49 -0
- package/src/Prebuilt/components/AppData/useUISettings.js +164 -0
- package/src/Prebuilt/components/AudioLevel/BeamSpeakerLabelsLogging.jsx +16 -0
- package/src/Prebuilt/components/AudioVideoToggle.jsx +67 -0
- package/src/Prebuilt/components/AuthToken.jsx +133 -0
- package/src/Prebuilt/components/BottomActionSheet/BottomActionSheet.jsx +96 -0
- package/src/Prebuilt/components/BottomActionSheet/BottomActionSheet.stories.tsx +46 -0
- package/src/Prebuilt/components/Chat/Chat.jsx +155 -0
- package/src/Prebuilt/components/Chat/ChatBody.jsx +370 -0
- package/src/Prebuilt/components/Chat/ChatFooter.jsx +150 -0
- package/src/Prebuilt/components/Chat/ChatHeader.jsx +67 -0
- package/src/Prebuilt/components/Chat/ChatSelector.jsx +162 -0
- package/src/Prebuilt/components/Chat/useEmojiPickerStyles.js +30 -0
- package/src/Prebuilt/components/Chat/useUnreadCount.js +17 -0
- package/src/Prebuilt/components/Connection/ConnectionIndicator.jsx +80 -0
- package/src/Prebuilt/components/Connection/TileConnection.jsx +40 -0
- package/src/Prebuilt/components/Connection/connectionQualityUtils.js +39 -0
- package/src/Prebuilt/components/EmojiReaction.jsx +138 -0
- package/src/Prebuilt/components/ErrorBoundary.jsx +105 -0
- package/src/Prebuilt/components/FirstPersonDisplay.jsx +50 -0
- package/src/Prebuilt/components/Footer/ChatToggle.jsx +27 -0
- package/src/Prebuilt/components/Footer/ConferencingFooter.jsx +104 -0
- package/src/Prebuilt/components/Footer/StreamingFooter.jsx +71 -0
- package/src/Prebuilt/components/Footer.jsx +8 -0
- package/src/Prebuilt/components/FullPageProgress.jsx +11 -0
- package/src/Prebuilt/components/GoLiveButton.jsx +45 -0
- package/src/Prebuilt/components/HMSVideo/Controls.jsx +21 -0
- package/src/Prebuilt/components/HMSVideo/FullscreenButton.jsx +18 -0
- package/src/Prebuilt/components/HMSVideo/HLSAutoplayBlockedPrompt.jsx +35 -0
- package/src/Prebuilt/components/HMSVideo/HLSQualitySelector.jsx +82 -0
- package/src/Prebuilt/components/HMSVideo/HMSVIdeoUtils.js +27 -0
- package/src/Prebuilt/components/HMSVideo/HMSVideo.jsx +11 -0
- package/src/Prebuilt/components/HMSVideo/PlayButton.jsx +13 -0
- package/src/Prebuilt/components/HMSVideo/VideoProgress.jsx +77 -0
- package/src/Prebuilt/components/HMSVideo/VideoTime.jsx +31 -0
- package/src/Prebuilt/components/HMSVideo/VolumeControl.jsx +39 -0
- package/src/Prebuilt/components/HMSVideo/index.js +19 -0
- package/src/Prebuilt/components/Header/AdditionalRoomState.jsx +217 -0
- package/src/Prebuilt/components/Header/AmbientMusic.jsx +88 -0
- package/src/Prebuilt/components/Header/ConferencingHeader.jsx +29 -0
- package/src/Prebuilt/components/Header/Header.jsx +8 -0
- package/src/Prebuilt/components/Header/HeaderComponents.jsx +41 -0
- package/src/Prebuilt/components/Header/ParticipantFilter.jsx +91 -0
- package/src/Prebuilt/components/Header/ParticipantList.jsx +337 -0
- package/src/Prebuilt/components/Header/StreamActions.jsx +225 -0
- package/src/Prebuilt/components/Header/StreamingHeader.jsx +55 -0
- package/src/Prebuilt/components/Header/index.jsx +1 -0
- package/src/Prebuilt/components/HlsStatsOverlay.jsx +101 -0
- package/src/Prebuilt/components/Image.jsx +7 -0
- package/src/Prebuilt/components/Input/KeyboardInputManager.js +107 -0
- package/src/Prebuilt/components/LeaveRoom.jsx +202 -0
- package/src/Prebuilt/components/MetaActions.jsx +45 -0
- package/src/Prebuilt/components/MoreSettings/BulkRoleChangeModal.jsx +139 -0
- package/src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx +92 -0
- package/src/Prebuilt/components/MoreSettings/ChangeSelfRole.jsx +67 -0
- package/src/Prebuilt/components/MoreSettings/EmbedUrl.jsx +106 -0
- package/src/Prebuilt/components/MoreSettings/FullScreenItem.jsx +29 -0
- package/src/Prebuilt/components/MoreSettings/MoreSettings.jsx +225 -0
- package/src/Prebuilt/components/MoreSettings/MuteAllModal.jsx +90 -0
- package/src/Prebuilt/components/Notifications/AutoplayBlockedModal.jsx +38 -0
- package/src/Prebuilt/components/Notifications/InitErrorModal.jsx +39 -0
- package/src/Prebuilt/components/Notifications/MessageNotifications.jsx +25 -0
- package/src/Prebuilt/components/Notifications/Notifications.jsx +151 -0
- package/src/Prebuilt/components/Notifications/PeerNotifications.jsx +45 -0
- package/src/Prebuilt/components/Notifications/PermissionErrorModal.jsx +67 -0
- package/src/Prebuilt/components/Notifications/ReconnectNotifications.jsx +69 -0
- package/src/Prebuilt/components/Notifications/TrackBulkUnmuteModal.jsx +51 -0
- package/src/Prebuilt/components/Notifications/TrackNotifications.jsx +19 -0
- package/src/Prebuilt/components/Notifications/TrackUnmuteModal.jsx +49 -0
- package/src/Prebuilt/components/Notifications/index.jsx +1 -0
- package/src/Prebuilt/components/PIP/PIPComponent.jsx +82 -0
- package/src/Prebuilt/components/PIP/PIPManager.js +296 -0
- package/src/Prebuilt/components/PIP/SetupMediaSession.js +60 -0
- package/src/Prebuilt/components/PIP/index.jsx +11 -0
- package/src/Prebuilt/components/PIP/pip.test.js +72 -0
- package/src/Prebuilt/components/PIP/pipUtils.js +183 -0
- package/src/Prebuilt/components/Pagination.jsx +29 -0
- package/src/Prebuilt/components/Playlist/Playlist.jsx +129 -0
- package/src/Prebuilt/components/Playlist/PlaylistControls.jsx +172 -0
- package/src/Prebuilt/components/Playlist/PlaylistItem.jsx +51 -0
- package/src/Prebuilt/components/Playlist/VideoPlayer.jsx +95 -0
- package/src/Prebuilt/components/PostLeave.jsx +76 -0
- package/src/Prebuilt/components/Preview/PreviewContainer.jsx +51 -0
- package/src/Prebuilt/components/Preview/PreviewJoin.jsx +196 -0
- package/src/Prebuilt/components/Preview/PreviewName.jsx +37 -0
- package/src/Prebuilt/components/RoleChangeModal.jsx +185 -0
- package/src/Prebuilt/components/RoleChangeRequestModal.jsx +26 -0
- package/src/Prebuilt/components/ScreenShare.jsx +45 -0
- package/src/Prebuilt/components/ScreenshareDisplay.jsx +45 -0
- package/src/Prebuilt/components/ScreenshareHintModal.jsx +37 -0
- package/src/Prebuilt/components/ScreenshareTile.jsx +91 -0
- package/src/Prebuilt/components/Settings/DeviceSettings.jsx +220 -0
- package/src/Prebuilt/components/Settings/LayoutSettings.jsx +91 -0
- package/src/Prebuilt/components/Settings/NotificationSettings.jsx +61 -0
- package/src/Prebuilt/components/Settings/SettingsModal.jsx +171 -0
- package/src/Prebuilt/components/Settings/StartRecording.jsx +130 -0
- package/src/Prebuilt/components/Settings/SwitchWithLabel.jsx +40 -0
- package/src/Prebuilt/components/Settings/common.js +15 -0
- package/src/Prebuilt/components/ShareMenuIcon.jsx +26 -0
- package/src/Prebuilt/components/StatsForNerds.jsx +250 -0
- package/src/Prebuilt/components/Streaming/Common.jsx +132 -0
- package/src/Prebuilt/components/Streaming/HLSStreaming.jsx +226 -0
- package/src/Prebuilt/components/Streaming/RTMPIcon.jsx +24 -0
- package/src/Prebuilt/components/Streaming/RTMPStreaming.jsx +336 -0
- package/src/Prebuilt/components/Streaming/ResolutionInput.jsx +88 -0
- package/src/Prebuilt/components/Streaming/StreamingLanding.jsx +76 -0
- package/src/Prebuilt/components/TileMenu.jsx +275 -0
- package/src/Prebuilt/components/Toast/Toast.jsx +17 -0
- package/src/Prebuilt/components/Toast/ToastBatcher.js +57 -0
- package/src/Prebuilt/components/Toast/ToastConfig.jsx +134 -0
- package/src/Prebuilt/components/Toast/ToastContainer.jsx +30 -0
- package/src/Prebuilt/components/Toast/ToastManager.js +44 -0
- package/src/Prebuilt/components/VideoList.jsx +101 -0
- package/src/Prebuilt/components/VideoTile.jsx +177 -0
- package/src/Prebuilt/components/conference.jsx +164 -0
- package/src/Prebuilt/components/gridView.jsx +85 -0
- package/src/Prebuilt/components/hooks/useDropdownList.jsx +23 -0
- package/src/Prebuilt/components/hooks/useDropdownSelection.jsx +6 -0
- package/src/Prebuilt/components/hooks/useFeatures.js +22 -0
- package/src/Prebuilt/components/hooks/useFullscreen.js +43 -0
- package/src/Prebuilt/components/hooks/useMetadata.jsx +52 -0
- package/src/Prebuilt/components/hooks/useNavigation.js +19 -0
- package/src/Prebuilt/components/hooks/usePlaylist.js +25 -0
- package/src/Prebuilt/components/hooks/usePlaylistMusic.js +35 -0
- package/src/Prebuilt/components/hooks/useScreenshareAudio.js +28 -0
- package/src/Prebuilt/components/hooks/useSetPinnedMessage.js +38 -0
- package/src/Prebuilt/components/hooks/useSkipPreview.jsx +20 -0
- package/src/Prebuilt/components/hooks/useUserPreferences.jsx +25 -0
- package/src/Prebuilt/components/init/Init.jsx +58 -0
- package/src/Prebuilt/components/init/initUtils.js +90 -0
- package/src/Prebuilt/components/pdfAnnotator/pdfErrorView.jsx +29 -0
- package/src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx +108 -0
- package/src/Prebuilt/components/pdfAnnotator/pdfHeader.jsx +31 -0
- package/src/Prebuilt/components/pdfAnnotator/pdfInfo.jsx +32 -0
- package/src/Prebuilt/components/pdfAnnotator/shareScreenOptions.jsx +233 -0
- package/src/Prebuilt/components/pdfAnnotator/submitPdf.jsx +89 -0
- package/src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx +85 -0
- package/src/Prebuilt/components/peerTileUtils.jsx +27 -0
- package/src/Prebuilt/hms.js +7 -0
- package/src/Prebuilt/images/first_person.png +0 -0
- package/src/Prebuilt/index.d.ts +15 -0
- package/src/Prebuilt/index.js +2 -0
- package/src/Prebuilt/layouts/ActiveSpeakerView.jsx +34 -0
- package/src/Prebuilt/layouts/EmbedView.jsx +141 -0
- package/src/Prebuilt/layouts/HLSView.jsx +290 -0
- package/src/Prebuilt/layouts/InsetView.jsx +222 -0
- package/src/Prebuilt/layouts/NonPublisherView.jsx +51 -0
- package/src/Prebuilt/layouts/PDFView.jsx +122 -0
- package/src/Prebuilt/layouts/PinnedTrackView.jsx +59 -0
- package/src/Prebuilt/layouts/SidePane.jsx +51 -0
- package/src/Prebuilt/layouts/WaitingView.jsx +51 -0
- package/src/Prebuilt/layouts/WhiteboardView.jsx +66 -0
- package/src/Prebuilt/layouts/mainGridView.jsx +98 -0
- package/src/Prebuilt/layouts/mainView.jsx +113 -0
- package/src/Prebuilt/layouts/screenShareView.jsx +185 -0
- package/src/Prebuilt/plugins/FlyingEmoji.jsx +132 -0
- package/src/Prebuilt/plugins/RemoteStopScreenshare.jsx +18 -0
- package/src/Prebuilt/plugins/VirtualBackground/VirtualBackground.jsx +90 -0
- package/src/Prebuilt/plugins/VirtualBackground/vbutils.js +66 -0
- package/src/Prebuilt/plugins/confetti.jsx +60 -0
- package/src/Prebuilt/plugins/transcription/Transcriber.js +216 -0
- package/src/Prebuilt/plugins/transcription/TranscriptionButton.jsx +138 -0
- package/src/Prebuilt/plugins/transcription/index.jsx +1 -0
- package/src/Prebuilt/plugins/whiteboard/PusherCommunicationProvider.js +110 -0
- package/src/Prebuilt/plugins/whiteboard/README.md +29 -0
- package/src/Prebuilt/plugins/whiteboard/ToggleWhiteboard.jsx +43 -0
- package/src/Prebuilt/plugins/whiteboard/Whiteboard.css +12 -0
- package/src/Prebuilt/plugins/whiteboard/Whiteboard.jsx +11 -0
- package/src/Prebuilt/plugins/whiteboard/WhiteboardEvents.js +8 -0
- package/src/Prebuilt/plugins/whiteboard/index.js +3 -0
- package/src/Prebuilt/plugins/whiteboard/useMultiplayerState.js +212 -0
- package/src/Prebuilt/plugins/whiteboard/useWhiteboardMetadata.js +47 -0
- package/src/Prebuilt/primitives/DialogContent.jsx +280 -0
- package/src/Prebuilt/primitives/DropdownTrigger.jsx +46 -0
- package/src/Prebuilt/services/FeatureFlags.jsx +47 -0
- package/src/Prebuilt/services/tokenService.js +49 -0
- package/src/Progress/index.tsx +17 -0
- package/src/QRCode/QRCode.mdx +9 -0
- package/src/QRCode/QRCode.stories.tsx +29 -0
- package/src/QRCode/QRCode.tsx +6 -0
- package/src/QRCode/index.tsx +1 -0
- package/src/RadioGroup/RadioGroup.stories.tsx +32 -0
- package/src/RadioGroup/RadioGroup.tsx +33 -0
- package/src/RadioGroup/index.tsx +1 -0
- package/src/ReactSelect/ReactSelect.stories.tsx +83 -0
- package/src/ReactSelect/ReactSelect.tsx +97 -0
- package/src/ReactSelect/index.ts +1 -0
- package/src/Select/Select.stories.tsx +33 -0
- package/src/Select/Select.tsx +63 -0
- package/src/Select/index.ts +1 -0
- package/src/Slider/Slider.stories.tsx +21 -0
- package/src/Slider/Slider.tsx +70 -0
- package/src/Slider/index.ts +1 -0
- package/src/Stats/Stats.tsx +211 -0
- package/src/Stats/StyledStats.tsx +57 -0
- package/src/Stats/formatBytes.ts +19 -0
- package/src/Stats/index.tsx +1 -0
- package/src/Switch/Switch.mdx +11 -0
- package/src/Switch/Switch.stories.tsx +46 -0
- package/src/Switch/Switch.tsx +52 -0
- package/src/Switch/index.ts +1 -0
- package/src/Tabs/Tabs.stories.tsx +77 -0
- package/src/Tabs/Tabs.tsx +41 -0
- package/src/Tabs/index.tsx +1 -0
- package/src/Text/Text.stories.tsx +21 -0
- package/src/Text/Text.tsx +149 -0
- package/src/Text/index.tsx +1 -0
- package/src/Theme/Theme.stories.mdx +8 -0
- package/src/Theme/ThemeProvider.tsx +104 -0
- package/src/Theme/ThemeStory.jsx +58 -0
- package/src/Theme/base.config.ts +264 -0
- package/src/Theme/index.tsx +3 -0
- package/src/Theme/stitches.config.ts +100 -0
- package/src/Theme/themes.ts +70 -0
- package/src/Theme/useSSR.tsx +24 -0
- package/src/TileMenu/StyledMenuTile.tsx +101 -0
- package/src/TileMenu/TileMenu.tsx +96 -0
- package/src/TileMenu/index.tsx +1 -0
- package/src/Toast/AppToast.stories.tsx +56 -0
- package/src/Toast/Toast.mdx +19 -0
- package/src/Toast/Toast.stories.tsx +57 -0
- package/src/Toast/Toast.tsx +168 -0
- package/src/Toast/index.tsx +1 -0
- package/src/Tooltip/Tooltip.stories.tsx +62 -0
- package/src/Tooltip/Tooltip.tsx +79 -0
- package/src/Tooltip/index.ts +1 -0
- package/src/Video/UseVideo.mdx +22 -0
- package/src/Video/UseVideo.stories.tsx +26 -0
- package/src/Video/Video.mdx +24 -0
- package/src/Video/Video.stories.tsx +27 -0
- package/src/Video/Video.tsx +61 -0
- package/src/Video/index.tsx +1 -0
- package/src/VideoList/StyledVideoList.tsx +39 -0
- package/src/VideoList/VideoList.stories.tsx +92 -0
- package/src/VideoList/index.tsx +2 -0
- package/src/VideoList/videoListUtils.tsx +20 -0
- package/src/VideoTile/StyledVideoTile.tsx +148 -0
- package/src/VideoTile/VideoTile.mdx +28 -0
- package/src/VideoTile/VideoTile.stories.tsx +32 -0
- package/src/VideoTile/index.tsx +1 -0
- package/src/fixtures/chats.ts +25 -0
- package/src/fixtures/peers.ts +24 -0
- package/src/fixtures/tracks.ts +11 -0
- package/src/index.ts +38 -0
- package/src/store/SetupFakeStore.ts +33 -0
- package/src/store/StorybookSDK.ts +229 -0
- package/src/utils/animations.ts +90 -0
- package/src/utils/index.ts +2 -0
- 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
|
+
};
|