@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,129 @@
|
|
1
|
+
import React, { Fragment, useState } from 'react';
|
2
|
+
import { HMSPlaylistType, selectIsAllowedToPublish, useHMSStore } from '@100mslive/react-sdk';
|
3
|
+
import { AudioPlayerIcon, CrossIcon, VideoPlayerIcon } from '@100mslive/react-icons';
|
4
|
+
import { Box, Dropdown, Flex, Text, Tooltip } from '../../../';
|
5
|
+
import IconButton from '../../IconButton';
|
6
|
+
import { AudioPlaylistControls } from './PlaylistControls';
|
7
|
+
import { PlaylistItem } from './PlaylistItem';
|
8
|
+
import { useIsFeatureEnabled } from '../hooks/useFeatures';
|
9
|
+
import { usePlaylist } from '../hooks/usePlaylist';
|
10
|
+
import { FEATURE_LIST } from '../../common/constants';
|
11
|
+
|
12
|
+
const BrowseAndPlayFromLocal = ({ type, actions }) => {
|
13
|
+
return (
|
14
|
+
<Fragment>
|
15
|
+
<Text as="label" htmlFor={`${type}PlaylistBrowse`} variant="sm" css={{ cursor: 'pointer', mr: '$2' }}>
|
16
|
+
Browse
|
17
|
+
</Text>
|
18
|
+
<input
|
19
|
+
type="file"
|
20
|
+
id={`${type}PlaylistBrowse`}
|
21
|
+
accept={type === HMSPlaylistType.audio ? 'audio/*' : 'video/*'}
|
22
|
+
onChange={e => {
|
23
|
+
const file = e.target.files[0];
|
24
|
+
const id = file.lastModified;
|
25
|
+
actions.setList([
|
26
|
+
{
|
27
|
+
type,
|
28
|
+
id,
|
29
|
+
name: file.name,
|
30
|
+
url: URL.createObjectURL(file),
|
31
|
+
},
|
32
|
+
]);
|
33
|
+
actions.play(id);
|
34
|
+
}}
|
35
|
+
style={{ display: 'none' }}
|
36
|
+
/>
|
37
|
+
</Fragment>
|
38
|
+
);
|
39
|
+
};
|
40
|
+
|
41
|
+
export const Playlist = ({ type }) => {
|
42
|
+
const isAudioPlaylist = type === HMSPlaylistType.audio;
|
43
|
+
const { active, list: playlist, actions } = usePlaylist(type);
|
44
|
+
const [open, setOpen] = useState(false);
|
45
|
+
const [collapse, setCollapse] = useState(false);
|
46
|
+
const isAllowedToPublish = useHMSStore(selectIsAllowedToPublish);
|
47
|
+
const isFeatureEnabled = useIsFeatureEnabled(
|
48
|
+
isAudioPlaylist ? FEATURE_LIST.AUDIO_PLAYLIST : FEATURE_LIST.VIDEO_PLAYLIST,
|
49
|
+
);
|
50
|
+
if (!isAllowedToPublish.screen || playlist.length === 0 || !isFeatureEnabled) {
|
51
|
+
return null;
|
52
|
+
}
|
53
|
+
|
54
|
+
return (
|
55
|
+
<Fragment>
|
56
|
+
<Dropdown.Root open={open} onOpenChange={setOpen}>
|
57
|
+
<Dropdown.Trigger asChild data-testid={type === HMSPlaylistType.audio ? 'audio_playlist' : 'video_playlist'}>
|
58
|
+
<IconButton active={!active}>
|
59
|
+
<Tooltip title={isAudioPlaylist ? 'Audio Playlist' : 'Video Playlist'}>
|
60
|
+
<Box>{isAudioPlaylist ? <AudioPlayerIcon /> : <VideoPlayerIcon />}</Box>
|
61
|
+
</Tooltip>
|
62
|
+
</IconButton>
|
63
|
+
</Dropdown.Trigger>
|
64
|
+
<Dropdown.Content
|
65
|
+
sideOffset={5}
|
66
|
+
align="center"
|
67
|
+
css={{
|
68
|
+
maxHeight: 'unset',
|
69
|
+
width: '$60',
|
70
|
+
p: '$0',
|
71
|
+
bg: '$bgSecondary',
|
72
|
+
border: '1px solid $menuBg',
|
73
|
+
}}
|
74
|
+
>
|
75
|
+
<Flex
|
76
|
+
align="center"
|
77
|
+
css={{
|
78
|
+
p: '$4 $8',
|
79
|
+
borderBottom: '1px solid $borderLight',
|
80
|
+
bg: '$menuBg',
|
81
|
+
}}
|
82
|
+
>
|
83
|
+
<Text variant="md" css={{ flex: '1 1 0' }}>
|
84
|
+
{isAudioPlaylist ? 'Audio Player' : 'Video Playlist'}
|
85
|
+
</Text>
|
86
|
+
<BrowseAndPlayFromLocal type={type} actions={actions} />
|
87
|
+
<IconButton
|
88
|
+
css={{ mr: '-$4' }}
|
89
|
+
onClick={async () => {
|
90
|
+
if (active) {
|
91
|
+
await actions.stop();
|
92
|
+
}
|
93
|
+
setOpen(false);
|
94
|
+
setCollapse(false);
|
95
|
+
}}
|
96
|
+
>
|
97
|
+
<CrossIcon width={24} height={24} />
|
98
|
+
</IconButton>
|
99
|
+
</Flex>
|
100
|
+
{!collapse && (
|
101
|
+
<Box css={{ maxHeight: '$96', overflowY: 'auto' }}>
|
102
|
+
{playlist.map(playlistItem => {
|
103
|
+
return (
|
104
|
+
<PlaylistItem
|
105
|
+
key={playlistItem.id}
|
106
|
+
{...playlistItem}
|
107
|
+
onClick={async e => {
|
108
|
+
e.preventDefault();
|
109
|
+
try {
|
110
|
+
await actions.play(playlistItem.id);
|
111
|
+
} catch (e) {
|
112
|
+
// error in playlist, stop or play next
|
113
|
+
}
|
114
|
+
// Close the dropdown list for videoplaylist
|
115
|
+
if (!isAudioPlaylist) {
|
116
|
+
setOpen(false);
|
117
|
+
}
|
118
|
+
}}
|
119
|
+
/>
|
120
|
+
);
|
121
|
+
})}
|
122
|
+
</Box>
|
123
|
+
)}
|
124
|
+
{isAudioPlaylist && <AudioPlaylistControls onToggle={() => setCollapse(value => !value)} />}
|
125
|
+
</Dropdown.Content>
|
126
|
+
</Dropdown.Root>
|
127
|
+
</Fragment>
|
128
|
+
);
|
129
|
+
};
|
@@ -0,0 +1,172 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import {
|
3
|
+
HMSPlaylistType,
|
4
|
+
selectAudioPlaylist,
|
5
|
+
selectAudioTrackVolume,
|
6
|
+
selectPeerSharingVideoPlaylist,
|
7
|
+
selectVideoPlaylist,
|
8
|
+
selectVideoPlaylistAudioTrackByPeerID,
|
9
|
+
useHMSActions,
|
10
|
+
useHMSStore,
|
11
|
+
} from '@100mslive/react-sdk';
|
12
|
+
import { NextIcon, PauseIcon, PlayIcon, PlaylistIcon, PrevIcon, SpeakerIcon } from '@100mslive/react-icons';
|
13
|
+
import { Box, Flex, IconButton, Slider, Text } from '../../../';
|
14
|
+
import { usePlaylist } from '../hooks/usePlaylist';
|
15
|
+
|
16
|
+
const Progress = ({ type, duration }) => {
|
17
|
+
const selectPlaylist = type === HMSPlaylistType.audio ? selectAudioPlaylist : selectVideoPlaylist;
|
18
|
+
const progress = useHMSStore(selectPlaylist.progress);
|
19
|
+
const hmsActions = useHMSActions();
|
20
|
+
const playlistAction = type === HMSPlaylistType.audio ? hmsActions.audioPlaylist : hmsActions.videoPlaylist;
|
21
|
+
|
22
|
+
if (!duration) {
|
23
|
+
return null;
|
24
|
+
}
|
25
|
+
|
26
|
+
return (
|
27
|
+
<Slider
|
28
|
+
step={1}
|
29
|
+
value={[progress]}
|
30
|
+
onValueChange={e => {
|
31
|
+
playlistAction.seekTo(e[0] * 0.01 * duration);
|
32
|
+
}}
|
33
|
+
/>
|
34
|
+
);
|
35
|
+
};
|
36
|
+
|
37
|
+
export const PlaylistActive = ({ type, onToggle }) => {
|
38
|
+
const isAudioPlaylist = type === HMSPlaylistType.audio;
|
39
|
+
const selector = isAudioPlaylist ? selectAudioPlaylist : selectVideoPlaylist;
|
40
|
+
const active = useHMSStore(selector.selectedItem);
|
41
|
+
if (!active) {
|
42
|
+
return null;
|
43
|
+
}
|
44
|
+
return (
|
45
|
+
<Box css={{ mt: '$8' }}>
|
46
|
+
<Flex justify="between" css={{ w: '100%' }}>
|
47
|
+
<Box>
|
48
|
+
<Text variant="md">{active.name}</Text>
|
49
|
+
{active.metadata?.description && <Text variant="xs">{active.metadata?.description}</Text>}
|
50
|
+
</Box>
|
51
|
+
<IconButton onClick={onToggle} css={{ alignSelf: 'center' }} data-testid="playlist_collapse_btn">
|
52
|
+
<PlaylistIcon />
|
53
|
+
</IconButton>
|
54
|
+
</Flex>
|
55
|
+
</Box>
|
56
|
+
);
|
57
|
+
};
|
58
|
+
|
59
|
+
const Controls = ({ type, css = {} }) => {
|
60
|
+
const { active, hasNext, hasPrevious, actions } = usePlaylist(type);
|
61
|
+
if (!active) {
|
62
|
+
return null;
|
63
|
+
}
|
64
|
+
return (
|
65
|
+
<Flex justify="center" css={css}>
|
66
|
+
<IconButton
|
67
|
+
disabled={!hasPrevious}
|
68
|
+
onClick={() => {
|
69
|
+
actions.playPrevious();
|
70
|
+
}}
|
71
|
+
data-testid="playlist_prev_btn"
|
72
|
+
>
|
73
|
+
<PrevIcon />
|
74
|
+
</IconButton>
|
75
|
+
<IconButton
|
76
|
+
onClick={() => {
|
77
|
+
active.playing ? actions.pause() : actions.play(active.id);
|
78
|
+
}}
|
79
|
+
data-testid="playlist_play_pause_btn"
|
80
|
+
>
|
81
|
+
{active.playing ? <PauseIcon width={32} height={32} /> : <PlayIcon width={32} height={32} />}
|
82
|
+
</IconButton>
|
83
|
+
<IconButton
|
84
|
+
disabled={!hasNext}
|
85
|
+
onClick={() => {
|
86
|
+
actions.playNext();
|
87
|
+
}}
|
88
|
+
data-testid="playlist_next_btn"
|
89
|
+
>
|
90
|
+
<NextIcon />
|
91
|
+
</IconButton>
|
92
|
+
</Flex>
|
93
|
+
);
|
94
|
+
};
|
95
|
+
|
96
|
+
const VolumeControl = () => {
|
97
|
+
const hmsActions = useHMSActions();
|
98
|
+
const volume = useHMSStore(selectVideoPlaylist.volume);
|
99
|
+
const active = useHMSStore(selectVideoPlaylist.selectedItem);
|
100
|
+
const peerSharingPlaylist = useHMSStore(selectPeerSharingVideoPlaylist);
|
101
|
+
const audioTrack = useHMSStore(selectVideoPlaylistAudioTrackByPeerID(peerSharingPlaylist?.id));
|
102
|
+
const audioTrackVolume = useHMSStore(selectAudioTrackVolume(audioTrack?.id));
|
103
|
+
const sliderVolume = active ? volume : audioTrackVolume;
|
104
|
+
|
105
|
+
return (
|
106
|
+
<Flex align="center" css={{ color: '$white' }}>
|
107
|
+
<SpeakerIcon />
|
108
|
+
<Slider
|
109
|
+
css={{ mx: '$4', w: '$20' }}
|
110
|
+
min={0}
|
111
|
+
max={100}
|
112
|
+
step={1}
|
113
|
+
value={[Math.floor(sliderVolume ?? 100)]}
|
114
|
+
onValueChange={e => {
|
115
|
+
const value = e[0];
|
116
|
+
if (active) {
|
117
|
+
hmsActions.videoPlaylist.setVolume(value);
|
118
|
+
} else if (audioTrack) {
|
119
|
+
hmsActions.setVolume(value, audioTrack.id);
|
120
|
+
}
|
121
|
+
}}
|
122
|
+
thumbStyles={{ w: '$6', h: '$6' }}
|
123
|
+
/>
|
124
|
+
</Flex>
|
125
|
+
);
|
126
|
+
};
|
127
|
+
|
128
|
+
export const AudioPlaylistControls = ({ onToggle }) => {
|
129
|
+
const { active } = usePlaylist(HMSPlaylistType.audio);
|
130
|
+
if (!active) {
|
131
|
+
return null;
|
132
|
+
}
|
133
|
+
return (
|
134
|
+
<Box
|
135
|
+
css={{
|
136
|
+
p: '$8',
|
137
|
+
borderTop: '1px solid $borderLight',
|
138
|
+
bg: '$menuBg',
|
139
|
+
}}
|
140
|
+
>
|
141
|
+
<Controls type={HMSPlaylistType.audio} />
|
142
|
+
<Progress type={HMSPlaylistType.audio} duration={active.duration} />
|
143
|
+
<PlaylistActive type={HMSPlaylistType.audio} onToggle={onToggle} />
|
144
|
+
</Box>
|
145
|
+
);
|
146
|
+
};
|
147
|
+
|
148
|
+
export const VideoPlaylistControls = ({ children }) => {
|
149
|
+
const { active } = usePlaylist(HMSPlaylistType.video);
|
150
|
+
|
151
|
+
return (
|
152
|
+
<Box
|
153
|
+
css={{
|
154
|
+
p: '$8',
|
155
|
+
mt: '-$24',
|
156
|
+
w: '100%',
|
157
|
+
zIndex: 1,
|
158
|
+
'@lg': {
|
159
|
+
mt: 0,
|
160
|
+
p: '$6',
|
161
|
+
},
|
162
|
+
}}
|
163
|
+
>
|
164
|
+
{active && <Progress type={HMSPlaylistType.video} duration={active.duration} />}
|
165
|
+
<Flex align="center" justify="between">
|
166
|
+
<VolumeControl />
|
167
|
+
{active && <Controls css={{ flex: '1 1 0' }} />}
|
168
|
+
{children}
|
169
|
+
</Flex>
|
170
|
+
</Box>
|
171
|
+
);
|
172
|
+
};
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Dropdown, Flex, Text } from '../../../';
|
3
|
+
|
4
|
+
function formatDuration(duration) {
|
5
|
+
if (!duration) {
|
6
|
+
return '';
|
7
|
+
}
|
8
|
+
let mins = Math.floor(duration / 60);
|
9
|
+
if (mins < 10) {
|
10
|
+
mins = `0${String(mins)}`;
|
11
|
+
}
|
12
|
+
let secs = Math.floor(duration % 60);
|
13
|
+
if (secs < 10) {
|
14
|
+
secs = `0${String(secs)}`;
|
15
|
+
}
|
16
|
+
|
17
|
+
return `${mins}:${secs}`;
|
18
|
+
}
|
19
|
+
|
20
|
+
export const PlaylistItem = React.memo(({ name, metadata, duration, selected, onClick }) => {
|
21
|
+
return (
|
22
|
+
<Dropdown.Item
|
23
|
+
css={{
|
24
|
+
flexDirection: 'column',
|
25
|
+
alignItems: 'flex-start',
|
26
|
+
h: '$18',
|
27
|
+
p: '$8',
|
28
|
+
'&:hover': {
|
29
|
+
cursor: 'pointer',
|
30
|
+
bg: '$menuBg',
|
31
|
+
},
|
32
|
+
'&:focus-visible': {
|
33
|
+
bg: '$menuBg',
|
34
|
+
},
|
35
|
+
}}
|
36
|
+
onClick={onClick}
|
37
|
+
>
|
38
|
+
<Flex align="center" justify="between" css={{ width: '100%', minHeight: 0 }}>
|
39
|
+
<Text variant="md" css={{ color: selected ? '$brandDefault' : '$textPrimary' }}>
|
40
|
+
{name}
|
41
|
+
</Text>
|
42
|
+
<Text variant="xs">{formatDuration(duration)}</Text>
|
43
|
+
</Flex>
|
44
|
+
{metadata?.description && (
|
45
|
+
<Text variant="xs" css={{ mt: '$4' }}>
|
46
|
+
{metadata?.description}
|
47
|
+
</Text>
|
48
|
+
)}
|
49
|
+
</Dropdown.Item>
|
50
|
+
);
|
51
|
+
});
|
@@ -0,0 +1,95 @@
|
|
1
|
+
import React, { useRef } from 'react';
|
2
|
+
import { useFullscreen, useToggle } from 'react-use';
|
3
|
+
import screenfull from 'screenfull';
|
4
|
+
import {
|
5
|
+
selectVideoPlaylist,
|
6
|
+
selectVideoPlaylistAudioTrackByPeerID,
|
7
|
+
selectVideoPlaylistVideoTrackByPeerID,
|
8
|
+
useHMSActions,
|
9
|
+
useHMSStore,
|
10
|
+
} from '@100mslive/react-sdk';
|
11
|
+
import { CrossIcon, ExpandIcon, ShrinkIcon } from '@100mslive/react-icons';
|
12
|
+
import { Box, Flex, IconButton, Text, Video, VideoTileStats } from '../../../';
|
13
|
+
import { VideoPlaylistControls } from './PlaylistControls';
|
14
|
+
import { useUISettings } from '../AppData/useUISettings';
|
15
|
+
import { UI_SETTINGS } from '../../common/constants';
|
16
|
+
|
17
|
+
export const VideoPlayer = React.memo(({ peerId }) => {
|
18
|
+
const videoTrack = useHMSStore(selectVideoPlaylistVideoTrackByPeerID(peerId));
|
19
|
+
const audioTrack = useHMSStore(selectVideoPlaylistAudioTrackByPeerID(peerId));
|
20
|
+
const active = useHMSStore(selectVideoPlaylist.selectedItem);
|
21
|
+
const isAudioOnly = useUISettings(UI_SETTINGS.isAudioOnly);
|
22
|
+
const hmsActions = useHMSActions();
|
23
|
+
const ref = useRef(null);
|
24
|
+
const [show, toggle] = useToggle(false);
|
25
|
+
const isFullscreen = useFullscreen(ref, show, {
|
26
|
+
onClose: () => toggle(false),
|
27
|
+
});
|
28
|
+
const showStatsOnTiles = useUISettings(UI_SETTINGS.showStatsOnTiles);
|
29
|
+
|
30
|
+
return (
|
31
|
+
<Flex direction="column" justify="center" css={{ w: '100%', h: '100%' }} ref={ref}>
|
32
|
+
{active && (
|
33
|
+
<Flex
|
34
|
+
justify="between"
|
35
|
+
align="center"
|
36
|
+
css={{
|
37
|
+
bg: '$menuBg',
|
38
|
+
p: '$2 $2 $2 $6',
|
39
|
+
borderTopLeftRadius: '$1',
|
40
|
+
borderTopRightRadius: '$1',
|
41
|
+
}}
|
42
|
+
>
|
43
|
+
<Text css={{ color: '$textPrimary' }}>{active.name}</Text>
|
44
|
+
<IconButton
|
45
|
+
css={{
|
46
|
+
color: '$white',
|
47
|
+
}}
|
48
|
+
onClick={() => {
|
49
|
+
hmsActions.videoPlaylist.stop();
|
50
|
+
}}
|
51
|
+
data-testid="videoplaylist_cross_btn"
|
52
|
+
>
|
53
|
+
<CrossIcon />
|
54
|
+
</IconButton>
|
55
|
+
</Flex>
|
56
|
+
)}
|
57
|
+
{showStatsOnTiles ? (
|
58
|
+
<Box css={{ '& > div': { top: '$14', left: '$8' } }}>
|
59
|
+
<VideoTileStats
|
60
|
+
audioTrackID={audioTrack?.id}
|
61
|
+
videoTrackID={videoTrack?.id}
|
62
|
+
peerID={peerId}
|
63
|
+
isLocal={active}
|
64
|
+
/>
|
65
|
+
</Box>
|
66
|
+
) : null}
|
67
|
+
<Video
|
68
|
+
trackId={videoTrack?.id}
|
69
|
+
attach={!isAudioOnly}
|
70
|
+
css={{
|
71
|
+
objectFit: 'contain',
|
72
|
+
h: 'auto',
|
73
|
+
r: '$1',
|
74
|
+
borderTopLeftRadius: 0,
|
75
|
+
borderTopRightRadius: 0,
|
76
|
+
}}
|
77
|
+
/>
|
78
|
+
<VideoPlaylistControls>
|
79
|
+
{screenfull.enabled && (
|
80
|
+
<IconButton
|
81
|
+
onClick={() => toggle()}
|
82
|
+
css={{
|
83
|
+
color: '$white',
|
84
|
+
height: 'max-content',
|
85
|
+
alignSelf: 'center',
|
86
|
+
cursor: 'pointer',
|
87
|
+
}}
|
88
|
+
>
|
89
|
+
{isFullscreen ? <ShrinkIcon /> : <ExpandIcon />}
|
90
|
+
</IconButton>
|
91
|
+
)}
|
92
|
+
</VideoPlaylistControls>
|
93
|
+
</Flex>
|
94
|
+
);
|
95
|
+
});
|
@@ -0,0 +1,76 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { useParams } from 'react-router-dom';
|
3
|
+
import { ExitIcon } from '@100mslive/react-icons';
|
4
|
+
import { ToastManager } from './Toast/ToastManager';
|
5
|
+
import { Button } from '../../Button';
|
6
|
+
import { Box, Flex } from '../../Layout';
|
7
|
+
import { Text } from '../../Text';
|
8
|
+
import { useHMSPrebuiltContext } from '../AppContext';
|
9
|
+
import { Header } from './Header';
|
10
|
+
import { useNavigation } from './hooks/useNavigation';
|
11
|
+
import { defaultPreviewPreference, UserPreferencesKeys, useUserPreferences } from './hooks/useUserPreferences';
|
12
|
+
import { getRoutePrefix } from '../common/utils';
|
13
|
+
import { textEllipsis } from '../../utils';
|
14
|
+
|
15
|
+
const PostLeave = () => {
|
16
|
+
const navigate = useNavigation();
|
17
|
+
const { showPreview, roomCode } = useHMSPrebuiltContext();
|
18
|
+
const { roomId, role } = useParams();
|
19
|
+
const [previewPreference] = useUserPreferences(UserPreferencesKeys.PREVIEW, defaultPreviewPreference);
|
20
|
+
return (
|
21
|
+
<Flex direction="column" css={{ size: '100%' }}>
|
22
|
+
<Box css={{ h: '$18', '@md': { h: '$17' } }} data-testid="header">
|
23
|
+
<Header />
|
24
|
+
</Box>
|
25
|
+
<Flex
|
26
|
+
justify="center"
|
27
|
+
direction="column"
|
28
|
+
align="center"
|
29
|
+
css={{ bg: '$mainBg', flex: '1 1 0', position: 'relative' }}
|
30
|
+
>
|
31
|
+
<Text variant="h2" css={{ fontWeight: '$semiBold' }}>
|
32
|
+
👋
|
33
|
+
</Text>
|
34
|
+
<Text variant="h4" css={{ color: '$textHighEmp', fontWeight: '$semiBold', mt: '$12' }}>
|
35
|
+
You left the {getRoutePrefix() ? 'stream' : 'room'}
|
36
|
+
</Text>
|
37
|
+
<Text
|
38
|
+
variant="body1"
|
39
|
+
css={{
|
40
|
+
color: '$textMedEmp',
|
41
|
+
mt: '$8',
|
42
|
+
fontWeight: '$regular',
|
43
|
+
textAlign: 'center',
|
44
|
+
}}
|
45
|
+
>
|
46
|
+
Have a nice day
|
47
|
+
{previewPreference.name && (
|
48
|
+
<Box as="span" css={{ ...textEllipsis(100) }}>
|
49
|
+
, {previewPreference.name}
|
50
|
+
</Box>
|
51
|
+
)}
|
52
|
+
!
|
53
|
+
</Text>
|
54
|
+
<Flex css={{ mt: '$14', gap: '$10', alignItems: 'center' }}>
|
55
|
+
<Text variant="body1" css={{ color: '$textMedEmp', fontWeight: '$regular' }}>
|
56
|
+
Left by mistake?
|
57
|
+
</Text>
|
58
|
+
<Button
|
59
|
+
onClick={() => {
|
60
|
+
let redirectUrl = `${showPreview ? '/preview/' : '/meeting/'}${roomCode || roomId}`;
|
61
|
+
if (role && roomId) redirectUrl += '/' + role;
|
62
|
+
navigate(redirectUrl);
|
63
|
+
ToastManager.clearAllToast();
|
64
|
+
}}
|
65
|
+
data-testid="join_again_btn"
|
66
|
+
>
|
67
|
+
<ExitIcon />
|
68
|
+
<Text css={{ ml: '$3', fontWeight: '$semiBold', color: 'inherit' }}>Rejoin</Text>
|
69
|
+
</Button>
|
70
|
+
</Flex>
|
71
|
+
</Flex>
|
72
|
+
</Flex>
|
73
|
+
);
|
74
|
+
};
|
75
|
+
|
76
|
+
export default PostLeave;
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { useParams } from 'react-router-dom';
|
3
|
+
import { useSearchParam } from 'react-use';
|
4
|
+
import { Box, Flex, Loading } from '../../../';
|
5
|
+
import SidePane from '../../layouts/SidePane';
|
6
|
+
import { Header } from '../Header';
|
7
|
+
import PreviewJoin from './PreviewJoin';
|
8
|
+
import { useAuthToken } from '../AppData/useUISettings';
|
9
|
+
import { useNavigation } from '../hooks/useNavigation';
|
10
|
+
import { useSkipPreview } from '../hooks/useSkipPreview';
|
11
|
+
import { QUERY_PARAM_NAME, QUERY_PARAM_PREVIEW_AS_ROLE } from '../../common/constants';
|
12
|
+
|
13
|
+
const PreviewContainer = () => {
|
14
|
+
const navigate = useNavigation();
|
15
|
+
const skipPreview = useSkipPreview();
|
16
|
+
const previewAsRole = useSearchParam(QUERY_PARAM_PREVIEW_AS_ROLE);
|
17
|
+
const initialName = useSearchParam(QUERY_PARAM_NAME) || (skipPreview ? 'Beam' : '');
|
18
|
+
const { roomId: urlRoomId, role: userRole } = useParams(); // from the url
|
19
|
+
const authToken = useAuthToken();
|
20
|
+
|
21
|
+
const onJoin = () => {
|
22
|
+
let meetingURL = `/meeting/${urlRoomId}`;
|
23
|
+
if (userRole) {
|
24
|
+
meetingURL += `/${userRole}`;
|
25
|
+
}
|
26
|
+
navigate(meetingURL);
|
27
|
+
};
|
28
|
+
return (
|
29
|
+
<Flex direction="column" css={{ size: '100%' }}>
|
30
|
+
<Box css={{ h: '$18', '@md': { h: '$17', flexShrink: 0 } }} data-testid="header">
|
31
|
+
<Header />
|
32
|
+
</Box>
|
33
|
+
<Flex css={{ flex: '1 1 0', position: 'relative', overflowY: 'auto' }} justify="center" align="center">
|
34
|
+
{authToken ? (
|
35
|
+
<PreviewJoin initialName={initialName} skipPreview={skipPreview} asRole={previewAsRole} onJoin={onJoin} />
|
36
|
+
) : (
|
37
|
+
<Loading size={100} />
|
38
|
+
)}
|
39
|
+
<SidePane
|
40
|
+
css={{
|
41
|
+
position: 'unset',
|
42
|
+
mr: '$10',
|
43
|
+
'@lg': { position: 'fixed', mr: '$0' },
|
44
|
+
}}
|
45
|
+
/>
|
46
|
+
</Flex>
|
47
|
+
</Flex>
|
48
|
+
);
|
49
|
+
};
|
50
|
+
|
51
|
+
export default PreviewContainer;
|