@stream-io/video-react-sdk 0.0.1-alpha.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +101 -0
- package/LICENSE +219 -0
- package/README.md +5 -0
- package/dist/css/styles.css +2244 -0
- package/dist/css/styles.css.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/src/components/Avatar/Avatar.d.ts +14 -0
- package/dist/src/components/Avatar/Avatar.js +11 -0
- package/dist/src/components/Avatar/Avatar.js.map +1 -0
- package/dist/src/components/Avatar/index.d.ts +1 -0
- package/dist/src/components/Avatar/index.js +2 -0
- package/dist/src/components/Avatar/index.js.map +1 -0
- package/dist/src/components/Button/CompositeButton.d.ts +16 -0
- package/dist/src/components/Button/CompositeButton.js +13 -0
- package/dist/src/components/Button/CompositeButton.js.map +1 -0
- package/dist/src/components/Button/CopyToClipboardButton.d.ts +27 -0
- package/dist/src/components/Button/CopyToClipboardButton.js +54 -0
- package/dist/src/components/Button/CopyToClipboardButton.js.map +1 -0
- package/dist/src/components/Button/IconButton.d.ts +7 -0
- package/dist/src/components/Button/IconButton.js +26 -0
- package/dist/src/components/Button/IconButton.js.map +1 -0
- package/dist/src/components/Button/TextButton.d.ts +2 -0
- package/dist/src/components/Button/TextButton.js +17 -0
- package/dist/src/components/Button/TextButton.js.map +1 -0
- package/dist/src/components/Button/index.d.ts +4 -0
- package/dist/src/components/Button/index.js +5 -0
- package/dist/src/components/Button/index.js.map +1 -0
- package/dist/src/components/CallControls/AcceptCallButton.d.ts +7 -0
- package/dist/src/components/CallControls/AcceptCallButton.js +27 -0
- package/dist/src/components/CallControls/AcceptCallButton.js.map +1 -0
- package/dist/src/components/CallControls/CallControls.d.ts +5 -0
- package/dist/src/components/CallControls/CallControls.js +5 -0
- package/dist/src/components/CallControls/CallControls.js.map +1 -0
- package/dist/src/components/CallControls/CallStatsButton.d.ts +2 -0
- package/dist/src/components/CallControls/CallStatsButton.js +8 -0
- package/dist/src/components/CallControls/CallStatsButton.js.map +1 -0
- package/dist/src/components/CallControls/CancelCallButton.d.ts +7 -0
- package/dist/src/components/CallControls/CancelCallButton.js +27 -0
- package/dist/src/components/CallControls/CancelCallButton.js.map +1 -0
- package/dist/src/components/CallControls/ReactionsButton.d.ts +11 -0
- package/dist/src/components/CallControls/ReactionsButton.js +32 -0
- package/dist/src/components/CallControls/ReactionsButton.js.map +1 -0
- package/dist/src/components/CallControls/RecordCallButton.d.ts +5 -0
- package/dist/src/components/CallControls/RecordCallButton.js +55 -0
- package/dist/src/components/CallControls/RecordCallButton.js.map +1 -0
- package/dist/src/components/CallControls/ScreenShareButton.d.ts +5 -0
- package/dist/src/components/CallControls/ScreenShareButton.js +54 -0
- package/dist/src/components/CallControls/ScreenShareButton.js.map +1 -0
- package/dist/src/components/CallControls/ToggleAudioButton.d.ts +9 -0
- package/dist/src/components/CallControls/ToggleAudioButton.js +73 -0
- package/dist/src/components/CallControls/ToggleAudioButton.js.map +1 -0
- package/dist/src/components/CallControls/ToggleAudioOutputButton.d.ts +5 -0
- package/dist/src/components/CallControls/ToggleAudioOutputButton.js +9 -0
- package/dist/src/components/CallControls/ToggleAudioOutputButton.js.map +1 -0
- package/dist/src/components/CallControls/ToggleVideoButton.d.ts +10 -0
- package/dist/src/components/CallControls/ToggleVideoButton.js +70 -0
- package/dist/src/components/CallControls/ToggleVideoButton.js.map +1 -0
- package/dist/src/components/CallControls/index.d.ts +10 -0
- package/dist/src/components/CallControls/index.js +11 -0
- package/dist/src/components/CallControls/index.js.map +1 -0
- package/dist/src/components/CallParticipantsList/BlockedUserListing.d.ts +4 -0
- package/dist/src/components/CallParticipantsList/BlockedUserListing.js +18 -0
- package/dist/src/components/CallParticipantsList/BlockedUserListing.js.map +1 -0
- package/dist/src/components/CallParticipantsList/CallParticipantListHeader.d.ts +6 -0
- package/dist/src/components/CallParticipantsList/CallParticipantListHeader.js +7 -0
- package/dist/src/components/CallParticipantsList/CallParticipantListHeader.js.map +1 -0
- package/dist/src/components/CallParticipantsList/CallParticipantListing.d.ts +8 -0
- package/dist/src/components/CallParticipantsList/CallParticipantListing.js +4 -0
- package/dist/src/components/CallParticipantsList/CallParticipantListing.js.map +1 -0
- package/dist/src/components/CallParticipantsList/CallParticipantListingItem.d.ts +16 -0
- package/dist/src/components/CallParticipantsList/CallParticipantListingItem.js +85 -0
- package/dist/src/components/CallParticipantsList/CallParticipantListingItem.js.map +1 -0
- package/dist/src/components/CallParticipantsList/CallParticipantsList.d.ts +15 -0
- package/dist/src/components/CallParticipantsList/CallParticipantsList.js +81 -0
- package/dist/src/components/CallParticipantsList/CallParticipantsList.js.map +1 -0
- package/dist/src/components/CallParticipantsList/EmptyParticipantSearchList.d.ts +2 -0
- package/dist/src/components/CallParticipantsList/EmptyParticipantSearchList.js +5 -0
- package/dist/src/components/CallParticipantsList/EmptyParticipantSearchList.js.map +1 -0
- package/dist/src/components/CallParticipantsList/index.d.ts +3 -0
- package/dist/src/components/CallParticipantsList/index.js +4 -0
- package/dist/src/components/CallParticipantsList/index.js.map +1 -0
- package/dist/src/components/CallRecordingList/CallRecordingList.d.ts +20 -0
- package/dist/src/components/CallRecordingList/CallRecordingList.js +9 -0
- package/dist/src/components/CallRecordingList/CallRecordingList.js.map +1 -0
- package/dist/src/components/CallRecordingList/CallRecordingListHeader.d.ts +7 -0
- package/dist/src/components/CallRecordingList/CallRecordingListHeader.js +8 -0
- package/dist/src/components/CallRecordingList/CallRecordingListHeader.js.map +1 -0
- package/dist/src/components/CallRecordingList/CallRecordingListItem.d.ts +7 -0
- package/dist/src/components/CallRecordingList/CallRecordingListItem.js +11 -0
- package/dist/src/components/CallRecordingList/CallRecordingListItem.js.map +1 -0
- package/dist/src/components/CallRecordingList/EmptyCallRecordingListing.d.ts +2 -0
- package/dist/src/components/CallRecordingList/EmptyCallRecordingListing.js +5 -0
- package/dist/src/components/CallRecordingList/EmptyCallRecordingListing.js.map +1 -0
- package/dist/src/components/CallRecordingList/LoadingCallRecordingListing.d.ts +7 -0
- package/dist/src/components/CallRecordingList/LoadingCallRecordingListing.js +7 -0
- package/dist/src/components/CallRecordingList/LoadingCallRecordingListing.js.map +1 -0
- package/dist/src/components/CallRecordingList/index.d.ts +5 -0
- package/dist/src/components/CallRecordingList/index.js +6 -0
- package/dist/src/components/CallRecordingList/index.js.map +1 -0
- package/dist/src/components/CallStats/CallStats.d.ts +6 -0
- package/dist/src/components/CallStats/CallStats.js +69 -0
- package/dist/src/components/CallStats/CallStats.js.map +1 -0
- package/dist/src/components/CallStats/CallStatsLatencyChart.d.ts +7 -0
- package/dist/src/components/CallStats/CallStatsLatencyChart.js +39 -0
- package/dist/src/components/CallStats/CallStatsLatencyChart.js.map +1 -0
- package/dist/src/components/CallStats/index.d.ts +2 -0
- package/dist/src/components/CallStats/index.js +3 -0
- package/dist/src/components/CallStats/index.js.map +1 -0
- package/dist/src/components/Debug/DebugParticipantPublishQuality.d.ts +6 -0
- package/dist/src/components/Debug/DebugParticipantPublishQuality.js +46 -0
- package/dist/src/components/Debug/DebugParticipantPublishQuality.js.map +1 -0
- package/dist/src/components/Debug/DebugStatsView.d.ts +7 -0
- package/dist/src/components/Debug/DebugStatsView.js +51 -0
- package/dist/src/components/Debug/DebugStatsView.js.map +1 -0
- package/dist/src/components/Debug/useIsDebugMode.d.ts +5 -0
- package/dist/src/components/Debug/useIsDebugMode.js +18 -0
- package/dist/src/components/Debug/useIsDebugMode.js.map +1 -0
- package/dist/src/components/DeviceSettings/DeviceSelector.d.ts +7 -0
- package/dist/src/components/DeviceSettings/DeviceSelector.js +26 -0
- package/dist/src/components/DeviceSettings/DeviceSelector.js.map +1 -0
- package/dist/src/components/DeviceSettings/DeviceSelectorAudio.d.ts +9 -0
- package/dist/src/components/DeviceSettings/DeviceSelectorAudio.js +20 -0
- package/dist/src/components/DeviceSettings/DeviceSelectorAudio.js.map +1 -0
- package/dist/src/components/DeviceSettings/DeviceSelectorVideo.d.ts +5 -0
- package/dist/src/components/DeviceSettings/DeviceSelectorVideo.js +11 -0
- package/dist/src/components/DeviceSettings/DeviceSelectorVideo.js.map +1 -0
- package/dist/src/components/DeviceSettings/DeviceSettings.d.ts +2 -0
- package/dist/src/components/DeviceSettings/DeviceSettings.js +15 -0
- package/dist/src/components/DeviceSettings/DeviceSettings.js.map +1 -0
- package/dist/src/components/DeviceSettings/index.d.ts +4 -0
- package/dist/src/components/DeviceSettings/index.js +5 -0
- package/dist/src/components/DeviceSettings/index.js.map +1 -0
- package/dist/src/components/Icon/Icon.d.ts +5 -0
- package/dist/src/components/Icon/Icon.js +4 -0
- package/dist/src/components/Icon/Icon.js.map +1 -0
- package/dist/src/components/Icon/index.d.ts +1 -0
- package/dist/src/components/Icon/index.js +2 -0
- package/dist/src/components/Icon/index.js.map +1 -0
- package/dist/src/components/LoadingIndicator/LoadingIndicator.d.ts +11 -0
- package/dist/src/components/LoadingIndicator/LoadingIndicator.js +6 -0
- package/dist/src/components/LoadingIndicator/LoadingIndicator.js.map +1 -0
- package/dist/src/components/LoadingIndicator/index.d.ts +1 -0
- package/dist/src/components/LoadingIndicator/index.js +2 -0
- package/dist/src/components/LoadingIndicator/index.js.map +1 -0
- package/dist/src/components/Menu/GenericMenu.d.ts +3 -0
- package/dist/src/components/Menu/GenericMenu.js +20 -0
- package/dist/src/components/Menu/GenericMenu.js.map +1 -0
- package/dist/src/components/Menu/MenuToggle.d.ts +12 -0
- package/dist/src/components/Menu/MenuToggle.js +40 -0
- package/dist/src/components/Menu/MenuToggle.js.map +1 -0
- package/dist/src/components/Menu/index.d.ts +2 -0
- package/dist/src/components/Menu/index.js +3 -0
- package/dist/src/components/Menu/index.js.map +1 -0
- package/dist/src/components/Notification/Notification.d.ts +11 -0
- package/dist/src/components/Notification/Notification.js +25 -0
- package/dist/src/components/Notification/Notification.js.map +1 -0
- package/dist/src/components/Notification/PermissionNotification.d.ts +33 -0
- package/dist/src/components/Notification/PermissionNotification.js +26 -0
- package/dist/src/components/Notification/PermissionNotification.js.map +1 -0
- package/dist/src/components/Notification/SpeakingWhileMutedNotification.d.ts +3 -0
- package/dist/src/components/Notification/SpeakingWhileMutedNotification.js +47 -0
- package/dist/src/components/Notification/SpeakingWhileMutedNotification.js.map +1 -0
- package/dist/src/components/Notification/index.d.ts +3 -0
- package/dist/src/components/Notification/index.js +4 -0
- package/dist/src/components/Notification/index.js.map +1 -0
- package/dist/src/components/PendingCallPanel/PendingCallControls.d.ts +2 -0
- package/dist/src/components/PendingCallPanel/PendingCallControls.js +13 -0
- package/dist/src/components/PendingCallPanel/PendingCallControls.js.map +1 -0
- package/dist/src/components/PendingCallPanel/PendingCallPanel.d.ts +14 -0
- package/dist/src/components/PendingCallPanel/PendingCallPanel.js +43 -0
- package/dist/src/components/PendingCallPanel/PendingCallPanel.js.map +1 -0
- package/dist/src/components/PendingCallPanel/index.d.ts +2 -0
- package/dist/src/components/PendingCallPanel/index.js +3 -0
- package/dist/src/components/PendingCallPanel/index.js.map +1 -0
- package/dist/src/components/Permissions/PermissionRequests.d.ts +8 -0
- package/dist/src/components/Permissions/PermissionRequests.js +103 -0
- package/dist/src/components/Permissions/PermissionRequests.js.map +1 -0
- package/dist/src/components/Permissions/index.d.ts +1 -0
- package/dist/src/components/Permissions/index.js +2 -0
- package/dist/src/components/Permissions/index.js.map +1 -0
- package/dist/src/components/Reaction/Reaction.d.ts +10 -0
- package/dist/src/components/Reaction/Reaction.js +28 -0
- package/dist/src/components/Reaction/Reaction.js.map +1 -0
- package/dist/src/components/Reaction/index.d.ts +1 -0
- package/dist/src/components/Reaction/index.js +2 -0
- package/dist/src/components/Reaction/index.js.map +1 -0
- package/dist/src/components/Search/SearchInput.d.ts +14 -0
- package/dist/src/components/Search/SearchInput.js +34 -0
- package/dist/src/components/Search/SearchInput.js.map +1 -0
- package/dist/src/components/Search/SearchResults.d.ts +14 -0
- package/dist/src/components/Search/SearchResults.js +12 -0
- package/dist/src/components/Search/SearchResults.js.map +1 -0
- package/dist/src/components/Search/hooks/index.d.ts +1 -0
- package/dist/src/components/Search/hooks/index.js +2 -0
- package/dist/src/components/Search/hooks/index.js.map +1 -0
- package/dist/src/components/Search/hooks/useSearch.d.ts +15 -0
- package/dist/src/components/Search/hooks/useSearch.js +39 -0
- package/dist/src/components/Search/hooks/useSearch.js.map +1 -0
- package/dist/src/components/Search/index.d.ts +2 -0
- package/dist/src/components/Search/index.js +3 -0
- package/dist/src/components/Search/index.js.map +1 -0
- package/dist/src/components/StreamCall/CallParticipantsScreenView.d.ts +5 -0
- package/dist/src/components/StreamCall/CallParticipantsScreenView.js +34 -0
- package/dist/src/components/StreamCall/CallParticipantsScreenView.js.map +1 -0
- package/dist/src/components/StreamCall/CallParticipantsView.d.ts +5 -0
- package/dist/src/components/StreamCall/CallParticipantsView.js +10 -0
- package/dist/src/components/StreamCall/CallParticipantsView.js.map +1 -0
- package/dist/src/components/StreamCall/Stage.d.ts +8 -0
- package/dist/src/components/StreamCall/Stage.js +13 -0
- package/dist/src/components/StreamCall/Stage.js.map +1 -0
- package/dist/src/components/StreamCall/index.d.ts +3 -0
- package/dist/src/components/StreamCall/index.js +4 -0
- package/dist/src/components/StreamCall/index.js.map +1 -0
- package/dist/src/components/StreamTheme/StreamTheme.d.ts +5 -0
- package/dist/src/components/StreamTheme/StreamTheme.js +18 -0
- package/dist/src/components/StreamTheme/StreamTheme.js.map +1 -0
- package/dist/src/components/StreamTheme/index.d.ts +1 -0
- package/dist/src/components/StreamTheme/index.js +2 -0
- package/dist/src/components/StreamTheme/index.js.map +1 -0
- package/dist/src/components/Tooltip/Tooltip.d.ts +15 -0
- package/dist/src/components/Tooltip/Tooltip.js +22 -0
- package/dist/src/components/Tooltip/Tooltip.js.map +1 -0
- package/dist/src/components/Tooltip/WithTooltip.d.ts +5 -0
- package/dist/src/components/Tooltip/WithTooltip.js +23 -0
- package/dist/src/components/Tooltip/WithTooltip.js.map +1 -0
- package/dist/src/components/Tooltip/hooks/index.d.ts +1 -0
- package/dist/src/components/Tooltip/hooks/index.js +2 -0
- package/dist/src/components/Tooltip/hooks/index.js.map +1 -0
- package/dist/src/components/Tooltip/hooks/useEnterLeaveHandlers.d.ts +6 -0
- package/dist/src/components/Tooltip/hooks/useEnterLeaveHandlers.js +14 -0
- package/dist/src/components/Tooltip/hooks/useEnterLeaveHandlers.js.map +1 -0
- package/dist/src/components/Tooltip/index.d.ts +2 -0
- package/dist/src/components/Tooltip/index.js +3 -0
- package/dist/src/components/Tooltip/index.js.map +1 -0
- package/dist/src/components/Video/VideoPreview.d.ts +28 -0
- package/dist/src/components/Video/VideoPreview.js +75 -0
- package/dist/src/components/Video/VideoPreview.js.map +1 -0
- package/dist/src/components/Video/index.d.ts +4 -0
- package/dist/src/components/Video/index.js +5 -0
- package/dist/src/components/Video/index.js.map +1 -0
- package/dist/src/components/index.d.ts +16 -0
- package/dist/src/components/index.js +17 -0
- package/dist/src/components/index.js.map +1 -0
- package/dist/src/core/components/Audio/Audio.d.ts +6 -0
- package/dist/src/core/components/Audio/Audio.js +39 -0
- package/dist/src/core/components/Audio/Audio.js.map +1 -0
- package/dist/src/core/components/Audio/index.d.ts +1 -0
- package/dist/src/core/components/Audio/index.js +2 -0
- package/dist/src/core/components/Audio/index.js.map +1 -0
- package/dist/src/core/components/CallLayout/PaginatedGridLayout.d.ts +17 -0
- package/dist/src/core/components/CallLayout/PaginatedGridLayout.js +38 -0
- package/dist/src/core/components/CallLayout/PaginatedGridLayout.js.map +1 -0
- package/dist/src/core/components/CallLayout/SpeakerLayout.d.ts +8 -0
- package/dist/src/core/components/CallLayout/SpeakerLayout.js +74 -0
- package/dist/src/core/components/CallLayout/SpeakerLayout.js.map +1 -0
- package/dist/src/core/components/CallLayout/index.d.ts +2 -0
- package/dist/src/core/components/CallLayout/index.js +3 -0
- package/dist/src/core/components/CallLayout/index.js.map +1 -0
- package/dist/src/core/components/ParticipantView/DefaultParticipantViewUI.d.ts +18 -0
- package/dist/src/core/components/ParticipantView/DefaultParticipantViewUI.js +36 -0
- package/dist/src/core/components/ParticipantView/DefaultParticipantViewUI.js.map +1 -0
- package/dist/src/core/components/ParticipantView/ParticipantView.d.ts +79 -0
- package/dist/src/core/components/ParticipantView/ParticipantView.js +33 -0
- package/dist/src/core/components/ParticipantView/ParticipantView.js.map +1 -0
- package/dist/src/core/components/ParticipantView/index.d.ts +2 -0
- package/dist/src/core/components/ParticipantView/index.js +3 -0
- package/dist/src/core/components/ParticipantView/index.js.map +1 -0
- package/dist/src/core/components/StreamCall/StreamCall.d.ts +73 -0
- package/dist/src/core/components/StreamCall/StreamCall.js +60 -0
- package/dist/src/core/components/StreamCall/StreamCall.js.map +1 -0
- package/dist/src/core/components/StreamCall/index.d.ts +1 -0
- package/dist/src/core/components/StreamCall/index.js +2 -0
- package/dist/src/core/components/StreamCall/index.js.map +1 -0
- package/dist/src/core/components/Video/BaseVideo.d.ts +9 -0
- package/dist/src/core/components/Video/BaseVideo.js +48 -0
- package/dist/src/core/components/Video/BaseVideo.js.map +1 -0
- package/dist/src/core/components/Video/DefaultVideoPlaceholder.d.ts +6 -0
- package/dist/src/core/components/Video/DefaultVideoPlaceholder.js +9 -0
- package/dist/src/core/components/Video/DefaultVideoPlaceholder.js.map +1 -0
- package/dist/src/core/components/Video/Video.d.ts +13 -0
- package/dist/src/core/components/Video/Video.js +154 -0
- package/dist/src/core/components/Video/Video.js.map +1 -0
- package/dist/src/core/components/Video/index.d.ts +2 -0
- package/dist/src/core/components/Video/index.js +3 -0
- package/dist/src/core/components/Video/index.js.map +1 -0
- package/dist/src/core/components/index.d.ts +6 -0
- package/dist/src/core/components/index.js +6 -0
- package/dist/src/core/components/index.js.map +1 -0
- package/dist/src/core/contexts/MediaDevicesContext.d.ts +180 -0
- package/dist/src/core/contexts/MediaDevicesContext.js +177 -0
- package/dist/src/core/contexts/MediaDevicesContext.js.map +1 -0
- package/dist/src/core/contexts/index.d.ts +1 -0
- package/dist/src/core/contexts/index.js +2 -0
- package/dist/src/core/contexts/index.js.map +1 -0
- package/dist/src/core/hooks/index.d.ts +4 -0
- package/dist/src/core/hooks/index.js +5 -0
- package/dist/src/core/hooks/index.js.map +1 -0
- package/dist/src/core/hooks/useAudioPublisher.d.ts +12 -0
- package/dist/src/core/hooks/useAudioPublisher.js +95 -0
- package/dist/src/core/hooks/useAudioPublisher.js.map +1 -0
- package/dist/src/core/hooks/useDevices.d.ts +80 -0
- package/dist/src/core/hooks/useDevices.js +113 -0
- package/dist/src/core/hooks/useDevices.js.map +1 -0
- package/dist/src/core/hooks/useTrackElementVisibility.d.ts +6 -0
- package/dist/src/core/hooks/useTrackElementVisibility.js +27 -0
- package/dist/src/core/hooks/useTrackElementVisibility.js.map +1 -0
- package/dist/src/core/hooks/useVideoPublisher.d.ts +12 -0
- package/dist/src/core/hooks/useVideoPublisher.js +120 -0
- package/dist/src/core/hooks/useVideoPublisher.js.map +1 -0
- package/dist/src/core/index.d.ts +3 -0
- package/dist/src/core/index.js +4 -0
- package/dist/src/core/index.js.map +1 -0
- package/dist/src/hooks/index.d.ts +2 -0
- package/dist/src/hooks/index.js +3 -0
- package/dist/src/hooks/index.js.map +1 -0
- package/dist/src/hooks/useFloatingUIPreset.d.ts +9 -0
- package/dist/src/hooks/useFloatingUIPreset.js +30 -0
- package/dist/src/hooks/useFloatingUIPreset.js.map +1 -0
- package/dist/src/hooks/useScrollPosition.d.ts +6 -0
- package/dist/src/hooks/useScrollPosition.js +63 -0
- package/dist/src/hooks/useScrollPosition.js.map +1 -0
- package/dist/src/types/components.d.ts +7 -0
- package/dist/src/types/components.js +2 -0
- package/dist/src/types/components.js.map +1 -0
- package/dist/src/types/index.d.ts +1 -0
- package/dist/src/types/index.js +2 -0
- package/dist/src/types/index.js.map +1 -0
- package/dist/src/utilities/applyElementToRef.d.ts +2 -0
- package/dist/src/utilities/applyElementToRef.js +8 -0
- package/dist/src/utilities/applyElementToRef.js.map +1 -0
- package/dist/src/utilities/chunk.d.ts +1 -0
- package/dist/src/utilities/chunk.js +5 -0
- package/dist/src/utilities/chunk.js.map +1 -0
- package/dist/src/utilities/index.d.ts +3 -0
- package/dist/src/utilities/index.js +4 -0
- package/dist/src/utilities/index.js.map +1 -0
- package/dist/src/utilities/isComponentType.d.ts +2 -0
- package/dist/src/utilities/isComponentType.js +7 -0
- package/dist/src/utilities/isComponentType.js.map +1 -0
- package/index.ts +18 -0
- package/package.json +51 -0
- package/src/components/Avatar/Avatar.tsx +45 -0
- package/src/components/Avatar/index.ts +1 -0
- package/src/components/Button/CompositeButton.tsx +50 -0
- package/src/components/Button/CopyToClipboardButton.tsx +129 -0
- package/src/components/Button/IconButton.tsx +32 -0
- package/src/components/Button/TextButton.tsx +12 -0
- package/src/components/Button/index.ts +4 -0
- package/src/components/CallControls/AcceptCallButton.tsx +36 -0
- package/src/components/CallControls/CallControls.tsx +26 -0
- package/src/components/CallControls/CallStatsButton.tsx +20 -0
- package/src/components/CallControls/CancelCallButton.tsx +36 -0
- package/src/components/CallControls/ReactionsButton.tsx +74 -0
- package/src/components/CallControls/RecordCallButton.tsx +73 -0
- package/src/components/CallControls/ScreenShareButton.tsx +84 -0
- package/src/components/CallControls/ToggleAudioButton.tsx +123 -0
- package/src/components/CallControls/ToggleAudioOutputButton.tsx +21 -0
- package/src/components/CallControls/ToggleVideoButton.tsx +116 -0
- package/src/components/CallControls/index.ts +10 -0
- package/src/components/CallParticipantsList/BlockedUserListing.tsx +37 -0
- package/src/components/CallParticipantsList/CallParticipantListHeader.tsx +29 -0
- package/src/components/CallParticipantsList/CallParticipantListing.tsx +22 -0
- package/src/components/CallParticipantsList/CallParticipantListingItem.tsx +273 -0
- package/src/components/CallParticipantsList/CallParticipantsList.tsx +255 -0
- package/src/components/CallParticipantsList/EmptyParticipantSearchList.tsx +7 -0
- package/src/components/CallParticipantsList/index.ts +3 -0
- package/src/components/CallRecordingList/CallRecordingList.tsx +60 -0
- package/src/components/CallRecordingList/CallRecordingListHeader.tsx +29 -0
- package/src/components/CallRecordingList/CallRecordingListItem.tsx +67 -0
- package/src/components/CallRecordingList/EmptyCallRecordingListing.tsx +11 -0
- package/src/components/CallRecordingList/LoadingCallRecordingListing.tsx +21 -0
- package/src/components/CallRecordingList/index.ts +5 -0
- package/src/components/CallStats/CallStats.tsx +162 -0
- package/src/components/CallStats/CallStatsLatencyChart.tsx +58 -0
- package/src/components/CallStats/index.ts +2 -0
- package/src/components/Debug/DebugParticipantPublishQuality.tsx +62 -0
- package/src/components/Debug/DebugStatsView.tsx +108 -0
- package/src/components/Debug/useIsDebugMode.ts +24 -0
- package/src/components/DeviceSettings/DeviceSelector.tsx +106 -0
- package/src/components/DeviceSettings/DeviceSelectorAudio.tsx +57 -0
- package/src/components/DeviceSettings/DeviceSelectorVideo.tsx +22 -0
- package/src/components/DeviceSettings/DeviceSettings.tsx +39 -0
- package/src/components/DeviceSettings/index.ts +4 -0
- package/src/components/Icon/Icon.tsx +11 -0
- package/src/components/Icon/index.ts +1 -0
- package/src/components/LoadingIndicator/LoadingIndicator.tsx +28 -0
- package/src/components/LoadingIndicator/index.ts +1 -0
- package/src/components/Menu/GenericMenu.tsx +16 -0
- package/src/components/Menu/MenuToggle.tsx +81 -0
- package/src/components/Menu/index.ts +2 -0
- package/src/components/Notification/Notification.tsx +61 -0
- package/src/components/Notification/PermissionNotification.tsx +97 -0
- package/src/components/Notification/SpeakingWhileMutedNotification.tsx +61 -0
- package/src/components/Notification/index.ts +3 -0
- package/src/components/PendingCallPanel/PendingCallControls.tsx +27 -0
- package/src/components/PendingCallPanel/PendingCallPanel.tsx +93 -0
- package/src/components/PendingCallPanel/index.ts +2 -0
- package/src/components/Permissions/PermissionRequests.tsx +176 -0
- package/src/components/Permissions/index.ts +1 -0
- package/src/components/Reaction/Reaction.tsx +48 -0
- package/src/components/Reaction/index.ts +1 -0
- package/src/components/Search/SearchInput.tsx +56 -0
- package/src/components/Search/SearchResults.tsx +40 -0
- package/src/components/Search/hooks/index.ts +1 -0
- package/src/components/Search/hooks/useSearch.ts +52 -0
- package/src/components/Search/index.ts +2 -0
- package/src/components/StreamCall/CallParticipantsScreenView.tsx +125 -0
- package/src/components/StreamCall/CallParticipantsView.tsx +24 -0
- package/src/components/StreamCall/Stage.tsx +22 -0
- package/src/components/StreamCall/index.ts +4 -0
- package/src/components/StreamTheme/StreamTheme.tsx +19 -0
- package/src/components/StreamTheme/index.ts +1 -0
- package/src/components/Tooltip/Tooltip.tsx +51 -0
- package/src/components/Tooltip/WithTooltip.tsx +39 -0
- package/src/components/Tooltip/hooks/index.ts +1 -0
- package/src/components/Tooltip/hooks/useEnterLeaveHandlers.ts +28 -0
- package/src/components/Tooltip/index.ts +2 -0
- package/src/components/Video/VideoPreview.tsx +152 -0
- package/src/components/Video/index.ts +4 -0
- package/src/components/index.ts +16 -0
- package/src/core/components/Audio/Audio.tsx +42 -0
- package/src/core/components/Audio/index.ts +1 -0
- package/src/core/components/CallLayout/PaginatedGridLayout.tsx +159 -0
- package/src/core/components/CallLayout/SpeakerLayout.tsx +231 -0
- package/src/core/components/CallLayout/index.ts +2 -0
- package/src/core/components/ParticipantView/DefaultParticipantViewUI.tsx +160 -0
- package/src/core/components/ParticipantView/ParticipantView.tsx +156 -0
- package/src/core/components/ParticipantView/index.ts +2 -0
- package/src/core/components/StreamCall/StreamCall.tsx +157 -0
- package/src/core/components/StreamCall/index.ts +1 -0
- package/src/core/components/Video/BaseVideo.tsx +53 -0
- package/src/core/components/Video/DefaultVideoPlaceholder.tsx +36 -0
- package/src/core/components/Video/Video.tsx +252 -0
- package/src/core/components/Video/index.ts +2 -0
- package/src/core/components/index.ts +8 -0
- package/src/core/contexts/MediaDevicesContext.tsx +416 -0
- package/src/core/contexts/index.ts +1 -0
- package/src/core/hooks/index.ts +4 -0
- package/src/core/hooks/useAudioPublisher.ts +124 -0
- package/src/core/hooks/useDevices.ts +161 -0
- package/src/core/hooks/useTrackElementVisibility.ts +44 -0
- package/src/core/hooks/useVideoPublisher.ts +152 -0
- package/src/core/index.ts +3 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useFloatingUIPreset.ts +50 -0
- package/src/hooks/useScrollPosition.ts +95 -0
- package/src/types/components.ts +7 -0
- package/src/types/index.ts +1 -0
- package/src/utilities/applyElementToRef.ts +12 -0
- package/src/utilities/chunk.ts +8 -0
- package/src/utilities/index.ts +3 -0
- package/src/utilities/isComponentType.ts +9 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { Call, StreamVideoParticipant } from '@stream-io/video-client';
|
|
3
|
+
|
|
4
|
+
export const DebugParticipantPublishQuality = (props: {
|
|
5
|
+
participant: StreamVideoParticipant;
|
|
6
|
+
call: Call;
|
|
7
|
+
}) => {
|
|
8
|
+
const { call, participant } = props;
|
|
9
|
+
const [quality, setQuality] = useState<string>();
|
|
10
|
+
const [publishStats, setPublishStats] = useState(() => ({
|
|
11
|
+
f: true,
|
|
12
|
+
h: true,
|
|
13
|
+
q: true,
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
return call.on('changePublishQuality', (event) => {
|
|
18
|
+
if (event.eventPayload.oneofKind !== 'changePublishQuality') return;
|
|
19
|
+
const { videoSenders } = event.eventPayload.changePublishQuality;
|
|
20
|
+
// FIXME OL: support additional layers (like screenshare)
|
|
21
|
+
const [videoLayer] = videoSenders.map(({ layers }) => {
|
|
22
|
+
return layers.map((l) => ({ [l.name]: l.active }));
|
|
23
|
+
});
|
|
24
|
+
setPublishStats((s) => ({
|
|
25
|
+
...s,
|
|
26
|
+
...videoLayer,
|
|
27
|
+
}));
|
|
28
|
+
});
|
|
29
|
+
}, [call]);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<select
|
|
33
|
+
title={`Published tracks: ${JSON.stringify(publishStats)}`}
|
|
34
|
+
value={quality}
|
|
35
|
+
onChange={(e) => {
|
|
36
|
+
const value = e.target.value;
|
|
37
|
+
setQuality(value);
|
|
38
|
+
let w = 960;
|
|
39
|
+
let h = 540;
|
|
40
|
+
if (value === 'h') {
|
|
41
|
+
w = w / 2; // 480
|
|
42
|
+
h = h / 2; // 270
|
|
43
|
+
} else if (value === 'q') {
|
|
44
|
+
w = w / 4; // 240
|
|
45
|
+
h = h / 4; // 135
|
|
46
|
+
}
|
|
47
|
+
call.updateSubscriptionsPartial('video', {
|
|
48
|
+
[participant.sessionId]: {
|
|
49
|
+
dimension: {
|
|
50
|
+
width: w,
|
|
51
|
+
height: h,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
}}
|
|
56
|
+
>
|
|
57
|
+
<option value="f">High (f)</option>
|
|
58
|
+
<option value="h">Medium (h)</option>
|
|
59
|
+
<option value="q">Low (q)</option>
|
|
60
|
+
</select>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { Call } from '@stream-io/video-client';
|
|
3
|
+
import { useFloatingUIPreset } from '../../hooks';
|
|
4
|
+
import { StatCard } from '../CallStats';
|
|
5
|
+
import { useCallStatsReport } from '@stream-io/video-react-bindings';
|
|
6
|
+
|
|
7
|
+
export const DebugStatsView = (props: {
|
|
8
|
+
call: Call;
|
|
9
|
+
mediaStream?: MediaStream;
|
|
10
|
+
sessionId: string;
|
|
11
|
+
}) => {
|
|
12
|
+
const { call, mediaStream, sessionId } = props;
|
|
13
|
+
const callStatsReport = useCallStatsReport();
|
|
14
|
+
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
call.startReportingStatsFor(sessionId);
|
|
17
|
+
return () => {
|
|
18
|
+
call.stopReportingStatsFor(sessionId);
|
|
19
|
+
};
|
|
20
|
+
}, [call, sessionId]);
|
|
21
|
+
|
|
22
|
+
const reportForTracks = callStatsReport?.participants[sessionId];
|
|
23
|
+
const trackStats = reportForTracks?.flatMap((report) => report.streams);
|
|
24
|
+
|
|
25
|
+
const { refs, strategy, y, x } = useFloatingUIPreset({
|
|
26
|
+
placement: 'top',
|
|
27
|
+
strategy: 'absolute',
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const [isPopperOpen, setIsPopperOpen] = useState(false);
|
|
31
|
+
|
|
32
|
+
const [videoTrack] = mediaStream?.getVideoTracks() ?? [];
|
|
33
|
+
const settings = videoTrack?.getSettings();
|
|
34
|
+
return (
|
|
35
|
+
<>
|
|
36
|
+
<span
|
|
37
|
+
className="str-video__debug__track-stats-icon"
|
|
38
|
+
tabIndex={0}
|
|
39
|
+
ref={refs.setReference}
|
|
40
|
+
title={
|
|
41
|
+
settings &&
|
|
42
|
+
`${settings.width}x${settings.height}@${Math.round(
|
|
43
|
+
settings.frameRate || 0,
|
|
44
|
+
)}`
|
|
45
|
+
}
|
|
46
|
+
onClick={() => {
|
|
47
|
+
setIsPopperOpen((v) => !v);
|
|
48
|
+
}}
|
|
49
|
+
/>
|
|
50
|
+
{isPopperOpen && (
|
|
51
|
+
<div
|
|
52
|
+
className="str-video__debug__track-stats str-video__call-stats"
|
|
53
|
+
ref={refs.setFloating}
|
|
54
|
+
style={{
|
|
55
|
+
position: strategy,
|
|
56
|
+
top: y ?? 0,
|
|
57
|
+
left: x ?? 0,
|
|
58
|
+
overflowY: 'auto',
|
|
59
|
+
}}
|
|
60
|
+
>
|
|
61
|
+
<h3>Participant stats</h3>
|
|
62
|
+
<div className="str-video__call-stats__card-container">
|
|
63
|
+
{trackStats
|
|
64
|
+
?.map((track) => {
|
|
65
|
+
if (track.kind === 'video') {
|
|
66
|
+
return (
|
|
67
|
+
<StatCard
|
|
68
|
+
key={`${track.rid}/${track.ssrc}/${track.codec}/${track.kind}`}
|
|
69
|
+
label={
|
|
70
|
+
`${track.kind}: ${track.codec} ` +
|
|
71
|
+
(track.rid ? ` (${track.rid})` : '')
|
|
72
|
+
}
|
|
73
|
+
value={`${track.frameWidth || 0}x${
|
|
74
|
+
track.frameHeight || 0
|
|
75
|
+
}@${track.framesPerSecond || 0}fps`}
|
|
76
|
+
/>
|
|
77
|
+
);
|
|
78
|
+
} else if (track.kind === 'audio') {
|
|
79
|
+
return (
|
|
80
|
+
<StatCard
|
|
81
|
+
key={`${track.ssrc}/${track.codec}/${track.kind}`}
|
|
82
|
+
label={track.codec || 'N/A'}
|
|
83
|
+
value={`Jitter: ${track.jitter || 0}ms`}
|
|
84
|
+
/>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
return null;
|
|
88
|
+
})
|
|
89
|
+
.filter(Boolean)}
|
|
90
|
+
</div>
|
|
91
|
+
{reportForTracks?.map((report, index) => (
|
|
92
|
+
<pre key={index}>
|
|
93
|
+
{JSON.stringify(unwrapStats(report.rawStats), null, 2)}
|
|
94
|
+
</pre>
|
|
95
|
+
))}
|
|
96
|
+
</div>
|
|
97
|
+
)}
|
|
98
|
+
</>
|
|
99
|
+
);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const unwrapStats = (rawStats?: RTCStatsReport) => {
|
|
103
|
+
const decodedStats: Record<string, string> = {};
|
|
104
|
+
rawStats?.forEach((s) => {
|
|
105
|
+
decodedStats[s.id] = s;
|
|
106
|
+
});
|
|
107
|
+
return decodedStats;
|
|
108
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
|
|
3
|
+
const useQueryParams = () => {
|
|
4
|
+
return useMemo(
|
|
5
|
+
() =>
|
|
6
|
+
typeof window === 'undefined'
|
|
7
|
+
? null
|
|
8
|
+
: new URLSearchParams(window.location.search),
|
|
9
|
+
[],
|
|
10
|
+
);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Internal purpose hook. Enables certain development mode tools.
|
|
15
|
+
*/
|
|
16
|
+
export const useIsDebugMode = () => {
|
|
17
|
+
const params = useQueryParams();
|
|
18
|
+
return !!params?.get('debug');
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const useDebugPreferredVideoCodec = () => {
|
|
22
|
+
const params = useQueryParams();
|
|
23
|
+
return params?.get('video_codec');
|
|
24
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { ChangeEventHandler } from 'react';
|
|
3
|
+
|
|
4
|
+
type DeviceSelectorOptionProps = {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
name: string;
|
|
8
|
+
selected?: boolean;
|
|
9
|
+
value: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
defaultChecked?: boolean;
|
|
12
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const DeviceSelectorOption = ({
|
|
16
|
+
disabled,
|
|
17
|
+
id,
|
|
18
|
+
label,
|
|
19
|
+
onChange,
|
|
20
|
+
name,
|
|
21
|
+
selected,
|
|
22
|
+
defaultChecked,
|
|
23
|
+
value,
|
|
24
|
+
}: DeviceSelectorOptionProps) => {
|
|
25
|
+
return (
|
|
26
|
+
<label
|
|
27
|
+
className={clsx('str-video__device-settings__option', {
|
|
28
|
+
'str-video__device-settings__option--selected': selected,
|
|
29
|
+
'str-video__device-settings__option--disabled': disabled,
|
|
30
|
+
})}
|
|
31
|
+
htmlFor={id}
|
|
32
|
+
>
|
|
33
|
+
<input
|
|
34
|
+
type="radio"
|
|
35
|
+
name={name}
|
|
36
|
+
onChange={onChange}
|
|
37
|
+
value={value}
|
|
38
|
+
id={id}
|
|
39
|
+
checked={selected}
|
|
40
|
+
defaultChecked={defaultChecked}
|
|
41
|
+
disabled={disabled}
|
|
42
|
+
/>
|
|
43
|
+
{label}
|
|
44
|
+
</label>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
export const DeviceSelector = (props: {
|
|
48
|
+
devices: MediaDeviceInfo[];
|
|
49
|
+
selectedDeviceId?: string;
|
|
50
|
+
title: string;
|
|
51
|
+
onChange?: (deviceId: string) => void;
|
|
52
|
+
}) => {
|
|
53
|
+
const {
|
|
54
|
+
devices = [],
|
|
55
|
+
selectedDeviceId: selectedDeviceFromProps,
|
|
56
|
+
title,
|
|
57
|
+
onChange,
|
|
58
|
+
} = props;
|
|
59
|
+
const inputGroupName = title.replace(' ', '-').toLowerCase();
|
|
60
|
+
|
|
61
|
+
// sometimes the browser (Chrome) will report the system-default device
|
|
62
|
+
// with an id of 'default'. In case when it doesn't, we'll select the first
|
|
63
|
+
// available device.
|
|
64
|
+
let selectedDeviceId = selectedDeviceFromProps;
|
|
65
|
+
if (
|
|
66
|
+
devices.length > 0 &&
|
|
67
|
+
!devices.find((d) => d.deviceId === selectedDeviceId)
|
|
68
|
+
) {
|
|
69
|
+
selectedDeviceId = devices[0].deviceId;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<div className="str-video__device-settings__device-kind">
|
|
74
|
+
<div className="str-video__device-settings__device-selector-title">
|
|
75
|
+
{title}
|
|
76
|
+
</div>
|
|
77
|
+
{!devices.length ? (
|
|
78
|
+
<DeviceSelectorOption
|
|
79
|
+
id={`${inputGroupName}--default`}
|
|
80
|
+
label="Default"
|
|
81
|
+
name={inputGroupName}
|
|
82
|
+
defaultChecked
|
|
83
|
+
value="default"
|
|
84
|
+
/>
|
|
85
|
+
) : (
|
|
86
|
+
devices.map((device) => {
|
|
87
|
+
return (
|
|
88
|
+
<DeviceSelectorOption
|
|
89
|
+
id={`${inputGroupName}--${device.deviceId}`}
|
|
90
|
+
value={device.deviceId}
|
|
91
|
+
label={device.label}
|
|
92
|
+
key={device.deviceId}
|
|
93
|
+
onChange={(e) => {
|
|
94
|
+
onChange?.(e.target.value);
|
|
95
|
+
}}
|
|
96
|
+
name={inputGroupName}
|
|
97
|
+
selected={
|
|
98
|
+
device.deviceId === selectedDeviceId || devices.length === 1
|
|
99
|
+
}
|
|
100
|
+
/>
|
|
101
|
+
);
|
|
102
|
+
})
|
|
103
|
+
)}
|
|
104
|
+
</div>
|
|
105
|
+
);
|
|
106
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { DeviceSelector } from './DeviceSelector';
|
|
2
|
+
import {
|
|
3
|
+
useMediaDevices,
|
|
4
|
+
useAudioInputDevices,
|
|
5
|
+
useAudioOutputDevices,
|
|
6
|
+
} from '../../core';
|
|
7
|
+
|
|
8
|
+
export type DeviceSelectorAudioInputProps = {
|
|
9
|
+
title?: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const DeviceSelectorAudioInput = ({
|
|
13
|
+
title = 'Select a Mic',
|
|
14
|
+
}: DeviceSelectorAudioInputProps) => {
|
|
15
|
+
const { selectedAudioInputDeviceId, switchDevice } = useMediaDevices();
|
|
16
|
+
const audioInputDevices = useAudioInputDevices();
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<DeviceSelector
|
|
20
|
+
devices={audioInputDevices}
|
|
21
|
+
selectedDeviceId={selectedAudioInputDeviceId}
|
|
22
|
+
onChange={(deviceId) => {
|
|
23
|
+
switchDevice('audioinput', deviceId);
|
|
24
|
+
}}
|
|
25
|
+
title={title}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type DeviceSelectorAudioOutputProps = {
|
|
31
|
+
title?: string;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const DeviceSelectorAudioOutput = ({
|
|
35
|
+
title = 'Select speakers',
|
|
36
|
+
}: DeviceSelectorAudioOutputProps) => {
|
|
37
|
+
const {
|
|
38
|
+
isAudioOutputChangeSupported,
|
|
39
|
+
selectedAudioOutputDeviceId,
|
|
40
|
+
switchDevice,
|
|
41
|
+
} = useMediaDevices();
|
|
42
|
+
|
|
43
|
+
const audioOutputDevices = useAudioOutputDevices();
|
|
44
|
+
|
|
45
|
+
if (!isAudioOutputChangeSupported) return null;
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<DeviceSelector
|
|
49
|
+
devices={audioOutputDevices}
|
|
50
|
+
selectedDeviceId={selectedAudioOutputDeviceId}
|
|
51
|
+
onChange={(deviceId) => {
|
|
52
|
+
switchDevice('audiooutput', deviceId);
|
|
53
|
+
}}
|
|
54
|
+
title={title}
|
|
55
|
+
/>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DeviceSelector } from './DeviceSelector';
|
|
2
|
+
import { useMediaDevices, useVideoDevices } from '../../core';
|
|
3
|
+
|
|
4
|
+
export type DeviceSelectorVideoProps = {
|
|
5
|
+
title?: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const DeviceSelectorVideo = ({ title }: DeviceSelectorVideoProps) => {
|
|
9
|
+
const { selectedVideoDeviceId, switchDevice } = useMediaDevices();
|
|
10
|
+
const videoDevices = useVideoDevices();
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<DeviceSelector
|
|
14
|
+
devices={videoDevices}
|
|
15
|
+
selectedDeviceId={selectedVideoDeviceId}
|
|
16
|
+
onChange={(deviceId) => {
|
|
17
|
+
switchDevice('videoinput', deviceId);
|
|
18
|
+
}}
|
|
19
|
+
title={title || 'Select a Camera'}
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import { MenuToggle, ToggleMenuButtonProps } from '../Menu';
|
|
3
|
+
import {
|
|
4
|
+
DeviceSelectorAudioInput,
|
|
5
|
+
DeviceSelectorAudioOutput,
|
|
6
|
+
} from './DeviceSelectorAudio';
|
|
7
|
+
import { DeviceSelectorVideo } from './DeviceSelectorVideo';
|
|
8
|
+
import { IconButton } from '../Button';
|
|
9
|
+
import clsx from 'clsx';
|
|
10
|
+
|
|
11
|
+
export const DeviceSettings = () => {
|
|
12
|
+
return (
|
|
13
|
+
<MenuToggle placement="bottom-end" ToggleButton={ToggleMenuButton}>
|
|
14
|
+
<Menu />
|
|
15
|
+
</MenuToggle>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const Menu = () => (
|
|
20
|
+
<div className="str-video__device-settings">
|
|
21
|
+
<DeviceSelectorVideo />
|
|
22
|
+
<DeviceSelectorAudioInput />
|
|
23
|
+
<DeviceSelectorAudioOutput />
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
const ToggleMenuButton = forwardRef<HTMLButtonElement, ToggleMenuButtonProps>(
|
|
28
|
+
({ menuShown }, ref) => (
|
|
29
|
+
<IconButton
|
|
30
|
+
className={clsx('str-video__device-settings__button', {
|
|
31
|
+
'str-video__device-settings__button--active': menuShown,
|
|
32
|
+
})}
|
|
33
|
+
title="Toggle device menu"
|
|
34
|
+
icon="device-settings"
|
|
35
|
+
ref={ref}
|
|
36
|
+
// tabindex={0}
|
|
37
|
+
/>
|
|
38
|
+
),
|
|
39
|
+
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Icon';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
|
|
3
|
+
export type LoadingIndicatorProps = {
|
|
4
|
+
className?: string;
|
|
5
|
+
/** String will be injected into class and later used to apply as a CSS mask-image to an element as data URL */
|
|
6
|
+
type?: string;
|
|
7
|
+
/** Text to be displayed under the loading indicator icon */
|
|
8
|
+
text?: string;
|
|
9
|
+
/** Tooltip to be displayed on hover */
|
|
10
|
+
tooltip?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const LoadingIndicator = ({
|
|
14
|
+
className,
|
|
15
|
+
type = 'spinner',
|
|
16
|
+
text,
|
|
17
|
+
tooltip,
|
|
18
|
+
}: LoadingIndicatorProps) => {
|
|
19
|
+
return (
|
|
20
|
+
<div
|
|
21
|
+
className={clsx('str-video__loading-indicator', className)}
|
|
22
|
+
title={tooltip}
|
|
23
|
+
>
|
|
24
|
+
<div className={clsx('str-video__loading-indicator__icon', type)}></div>
|
|
25
|
+
{text && <p className="str-video__loading-indicator-text">{text}</p>}
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './LoadingIndicator';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ComponentProps, PropsWithChildren } from 'react';
|
|
2
|
+
|
|
3
|
+
export const GenericMenu = ({ children }: PropsWithChildren) => {
|
|
4
|
+
return <ul className="str-video__generic-menu">{children}</ul>;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export const GenericMenuButtonItem = ({
|
|
8
|
+
children,
|
|
9
|
+
...rest
|
|
10
|
+
}: Omit<ComponentProps<'button'>, 'ref'>) => {
|
|
11
|
+
return (
|
|
12
|
+
<li className="str-video__generic-menu--item">
|
|
13
|
+
<button {...rest}>{children}</button>
|
|
14
|
+
</li>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ComponentType,
|
|
3
|
+
PropsWithChildren,
|
|
4
|
+
useEffect,
|
|
5
|
+
useState,
|
|
6
|
+
ForwardedRef,
|
|
7
|
+
} from 'react';
|
|
8
|
+
import { Placement, Strategy } from '@floating-ui/react';
|
|
9
|
+
|
|
10
|
+
import { useFloatingUIPreset } from '../../hooks';
|
|
11
|
+
|
|
12
|
+
export type ToggleMenuButtonProps<E extends HTMLElement = HTMLButtonElement> = {
|
|
13
|
+
menuShown: boolean;
|
|
14
|
+
ref: ForwardedRef<E>;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type MenuToggleProps<E extends HTMLElement> = PropsWithChildren<{
|
|
18
|
+
ToggleButton: ComponentType<ToggleMenuButtonProps<E>>;
|
|
19
|
+
placement?: Placement;
|
|
20
|
+
strategy?: Strategy;
|
|
21
|
+
}>;
|
|
22
|
+
|
|
23
|
+
export const MenuToggle = <E extends HTMLElement>({
|
|
24
|
+
ToggleButton,
|
|
25
|
+
placement = 'top-start',
|
|
26
|
+
strategy = 'absolute',
|
|
27
|
+
children,
|
|
28
|
+
}: MenuToggleProps<E>) => {
|
|
29
|
+
const [menuShown, setMenuShown] = useState(false);
|
|
30
|
+
|
|
31
|
+
const { floating, domReference, refs, x, y } = useFloatingUIPreset({
|
|
32
|
+
placement,
|
|
33
|
+
strategy,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
const handleClick = (event: MouseEvent) => {
|
|
38
|
+
if (!floating && domReference?.contains(event.target as Node)) {
|
|
39
|
+
setMenuShown(true);
|
|
40
|
+
} else if (floating && !floating?.contains(event.target as Node)) {
|
|
41
|
+
setMenuShown(false);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const handleKeyDown = (event: KeyboardEvent) => {
|
|
46
|
+
if (
|
|
47
|
+
event.key.toLowerCase() === 'escape' &&
|
|
48
|
+
!event.altKey &&
|
|
49
|
+
!event.ctrlKey
|
|
50
|
+
) {
|
|
51
|
+
setMenuShown(false);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
document?.addEventListener('click', handleClick, { capture: true });
|
|
55
|
+
document?.addEventListener('keydown', handleKeyDown);
|
|
56
|
+
return () => {
|
|
57
|
+
document?.removeEventListener('click', handleClick, { capture: true });
|
|
58
|
+
document?.removeEventListener('keydown', handleKeyDown);
|
|
59
|
+
};
|
|
60
|
+
}, [floating, domReference]);
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<>
|
|
64
|
+
{menuShown && (
|
|
65
|
+
<div
|
|
66
|
+
className="str-video__menu-container"
|
|
67
|
+
ref={refs.setFloating}
|
|
68
|
+
style={{
|
|
69
|
+
position: strategy,
|
|
70
|
+
top: y ?? 0,
|
|
71
|
+
left: x ?? 0,
|
|
72
|
+
overflowY: 'auto',
|
|
73
|
+
}}
|
|
74
|
+
>
|
|
75
|
+
{children}
|
|
76
|
+
</div>
|
|
77
|
+
)}
|
|
78
|
+
<ToggleButton menuShown={menuShown} ref={refs.setReference} />
|
|
79
|
+
</>
|
|
80
|
+
);
|
|
81
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { PropsWithChildren, ReactNode, useEffect } from 'react';
|
|
2
|
+
import { Placement } from '@floating-ui/react';
|
|
3
|
+
|
|
4
|
+
import { useFloatingUIPreset } from '../../hooks';
|
|
5
|
+
|
|
6
|
+
export type NotificationProps = {
|
|
7
|
+
message?: ReactNode;
|
|
8
|
+
isVisible?: boolean;
|
|
9
|
+
visibilityTimeout?: number;
|
|
10
|
+
resetIsVisible?: () => void;
|
|
11
|
+
placement?: Placement;
|
|
12
|
+
iconClassName?: string | null;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const Notification = (props: PropsWithChildren<NotificationProps>) => {
|
|
16
|
+
const {
|
|
17
|
+
isVisible,
|
|
18
|
+
message,
|
|
19
|
+
children,
|
|
20
|
+
visibilityTimeout,
|
|
21
|
+
resetIsVisible,
|
|
22
|
+
placement = 'top',
|
|
23
|
+
iconClassName = 'str-video__notification__icon',
|
|
24
|
+
} = props;
|
|
25
|
+
|
|
26
|
+
const { refs, x, y, strategy } = useFloatingUIPreset({
|
|
27
|
+
placement,
|
|
28
|
+
strategy: 'absolute',
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (!isVisible || !visibilityTimeout || !resetIsVisible) return;
|
|
33
|
+
|
|
34
|
+
const timeout = setTimeout(() => {
|
|
35
|
+
resetIsVisible();
|
|
36
|
+
}, visibilityTimeout);
|
|
37
|
+
|
|
38
|
+
return () => clearTimeout(timeout);
|
|
39
|
+
}, [isVisible, resetIsVisible, visibilityTimeout]);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<div ref={refs.setReference}>
|
|
43
|
+
{isVisible && (
|
|
44
|
+
<div
|
|
45
|
+
className="str-video__notification"
|
|
46
|
+
ref={refs.setFloating}
|
|
47
|
+
style={{
|
|
48
|
+
position: strategy,
|
|
49
|
+
top: y ?? 0,
|
|
50
|
+
left: x ?? 0,
|
|
51
|
+
overflowY: 'auto',
|
|
52
|
+
}}
|
|
53
|
+
>
|
|
54
|
+
{iconClassName && <i className={iconClassName} />}
|
|
55
|
+
<span className="str-video__notification__message">{message}</span>
|
|
56
|
+
</div>
|
|
57
|
+
)}
|
|
58
|
+
{children}
|
|
59
|
+
</div>
|
|
60
|
+
);
|
|
61
|
+
};
|