@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,159 @@
|
|
|
1
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
useCall,
|
|
4
|
+
useLocalParticipant,
|
|
5
|
+
useParticipants,
|
|
6
|
+
useRemoteParticipants,
|
|
7
|
+
} from '@stream-io/video-react-bindings';
|
|
8
|
+
import {
|
|
9
|
+
StreamVideoLocalParticipant,
|
|
10
|
+
StreamVideoParticipant,
|
|
11
|
+
} from '@stream-io/video-client';
|
|
12
|
+
import clsx from 'clsx';
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
ParticipantView,
|
|
16
|
+
DefaultParticipantViewUI,
|
|
17
|
+
ParticipantViewProps,
|
|
18
|
+
} from '../ParticipantView';
|
|
19
|
+
import { Audio } from '../Audio';
|
|
20
|
+
import { IconButton } from '../../../components';
|
|
21
|
+
import { chunk } from '../../../utilities';
|
|
22
|
+
|
|
23
|
+
const GROUP_SIZE = 16;
|
|
24
|
+
|
|
25
|
+
type PaginatedGridLayoutGroupProps = {
|
|
26
|
+
/**
|
|
27
|
+
* The group of participants to render.
|
|
28
|
+
*/
|
|
29
|
+
group: Array<StreamVideoParticipant | StreamVideoLocalParticipant>;
|
|
30
|
+
} & Pick<ParticipantViewProps, 'VideoPlaceholder'> &
|
|
31
|
+
Required<Pick<ParticipantViewProps, 'ParticipantViewUI'>>;
|
|
32
|
+
|
|
33
|
+
const PaginatedGridLayoutGroup = ({
|
|
34
|
+
group,
|
|
35
|
+
VideoPlaceholder,
|
|
36
|
+
ParticipantViewUI,
|
|
37
|
+
}: PaginatedGridLayoutGroupProps) => {
|
|
38
|
+
return (
|
|
39
|
+
<div
|
|
40
|
+
className={clsx('str-video__paginated-grid-layout__group', {
|
|
41
|
+
'str-video__paginated-grid-layout--one': group.length === 1,
|
|
42
|
+
'str-video__paginated-grid-layout--two-four':
|
|
43
|
+
group.length >= 2 && group.length <= 4,
|
|
44
|
+
'str-video__paginated-grid-layout--five-nine':
|
|
45
|
+
group.length >= 5 && group.length <= 9,
|
|
46
|
+
})}
|
|
47
|
+
>
|
|
48
|
+
{group.map((participant) => (
|
|
49
|
+
<ParticipantView
|
|
50
|
+
key={participant.sessionId}
|
|
51
|
+
participant={participant}
|
|
52
|
+
muteAudio
|
|
53
|
+
VideoPlaceholder={VideoPlaceholder}
|
|
54
|
+
ParticipantViewUI={ParticipantViewUI}
|
|
55
|
+
/>
|
|
56
|
+
))}
|
|
57
|
+
</div>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export type PaginatedGridLayoutProps = {
|
|
62
|
+
/**
|
|
63
|
+
* The number of participants to display per page.
|
|
64
|
+
*/
|
|
65
|
+
groupSize?: number;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Whether to exclude the local participant from the grid.
|
|
69
|
+
*/
|
|
70
|
+
excludeLocalParticipant?: boolean;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Turns on/off the pagination arrows.
|
|
74
|
+
*/
|
|
75
|
+
pageArrowsVisible?: boolean;
|
|
76
|
+
} & Pick<ParticipantViewProps, 'ParticipantViewUI' | 'VideoPlaceholder'>;
|
|
77
|
+
|
|
78
|
+
export const PaginatedGridLayout = ({
|
|
79
|
+
groupSize = GROUP_SIZE,
|
|
80
|
+
excludeLocalParticipant = false,
|
|
81
|
+
pageArrowsVisible = true,
|
|
82
|
+
VideoPlaceholder,
|
|
83
|
+
ParticipantViewUI = DefaultParticipantViewUI,
|
|
84
|
+
}: PaginatedGridLayoutProps) => {
|
|
85
|
+
const [page, setPage] = useState(0);
|
|
86
|
+
|
|
87
|
+
const call = useCall();
|
|
88
|
+
const localParticipant = useLocalParticipant();
|
|
89
|
+
const participants = useParticipants();
|
|
90
|
+
// used to render audio elements
|
|
91
|
+
const remoteParticipants = useRemoteParticipants();
|
|
92
|
+
|
|
93
|
+
// only used to render video elements
|
|
94
|
+
const participantGroups = useMemo(
|
|
95
|
+
() =>
|
|
96
|
+
chunk(
|
|
97
|
+
excludeLocalParticipant ? remoteParticipants : participants,
|
|
98
|
+
groupSize,
|
|
99
|
+
),
|
|
100
|
+
[excludeLocalParticipant, remoteParticipants, participants, groupSize],
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
const pageCount = participantGroups.length;
|
|
104
|
+
|
|
105
|
+
// update page when page count is reduced and selected page no longer exists
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
if (page > pageCount - 1) {
|
|
108
|
+
setPage(Math.max(0, pageCount - 1));
|
|
109
|
+
}
|
|
110
|
+
}, [page, pageCount]);
|
|
111
|
+
|
|
112
|
+
const selectedGroup = participantGroups[page];
|
|
113
|
+
|
|
114
|
+
if (!call) return null;
|
|
115
|
+
|
|
116
|
+
return (
|
|
117
|
+
<>
|
|
118
|
+
{remoteParticipants.map((participant) => (
|
|
119
|
+
<Audio
|
|
120
|
+
muted={false}
|
|
121
|
+
key={participant.sessionId}
|
|
122
|
+
audioStream={participant.audioStream}
|
|
123
|
+
sinkId={localParticipant?.audioOutputDeviceId}
|
|
124
|
+
/>
|
|
125
|
+
))}
|
|
126
|
+
<div className="str-video__paginated-grid-layout__wrapper">
|
|
127
|
+
<div className="str-video__paginated-grid-layout">
|
|
128
|
+
{pageArrowsVisible && pageCount > 1 && (
|
|
129
|
+
<IconButton
|
|
130
|
+
icon="caret-left"
|
|
131
|
+
disabled={page === 0}
|
|
132
|
+
onClick={() =>
|
|
133
|
+
setPage((currentPage) => Math.max(0, currentPage - 1))
|
|
134
|
+
}
|
|
135
|
+
/>
|
|
136
|
+
)}
|
|
137
|
+
{selectedGroup && (
|
|
138
|
+
<PaginatedGridLayoutGroup
|
|
139
|
+
group={participantGroups[page]}
|
|
140
|
+
VideoPlaceholder={VideoPlaceholder}
|
|
141
|
+
ParticipantViewUI={ParticipantViewUI}
|
|
142
|
+
/>
|
|
143
|
+
)}
|
|
144
|
+
{pageArrowsVisible && pageCount > 1 && (
|
|
145
|
+
<IconButton
|
|
146
|
+
disabled={page === pageCount - 1}
|
|
147
|
+
icon="caret-right"
|
|
148
|
+
onClick={() =>
|
|
149
|
+
setPage((currentPage) =>
|
|
150
|
+
Math.min(pageCount - 1, currentPage + 1),
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
/>
|
|
154
|
+
)}
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
</>
|
|
158
|
+
);
|
|
159
|
+
};
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
CallTypes,
|
|
5
|
+
combineComparators,
|
|
6
|
+
Comparator,
|
|
7
|
+
defaultSortPreset,
|
|
8
|
+
screenSharing,
|
|
9
|
+
SfuModels,
|
|
10
|
+
speakerLayoutSortPreset,
|
|
11
|
+
StreamVideoParticipant,
|
|
12
|
+
} from '@stream-io/video-client';
|
|
13
|
+
import {
|
|
14
|
+
useCall,
|
|
15
|
+
useLocalParticipant,
|
|
16
|
+
useParticipants,
|
|
17
|
+
} from '@stream-io/video-react-bindings';
|
|
18
|
+
|
|
19
|
+
import {
|
|
20
|
+
DefaultParticipantViewUI,
|
|
21
|
+
ParticipantView,
|
|
22
|
+
ParticipantViewProps,
|
|
23
|
+
} from '../ParticipantView';
|
|
24
|
+
import { IconButton } from '../../../components';
|
|
25
|
+
import {
|
|
26
|
+
useHorizontalScrollPosition,
|
|
27
|
+
useVerticalScrollPosition,
|
|
28
|
+
} from '../../../hooks';
|
|
29
|
+
import clsx from 'clsx';
|
|
30
|
+
|
|
31
|
+
export type SpeakerLayoutProps = {
|
|
32
|
+
ParticipantViewUISpotlight?: ParticipantViewProps['ParticipantViewUI'];
|
|
33
|
+
ParticipantViewUIBar?: ParticipantViewProps['ParticipantViewUI'];
|
|
34
|
+
participantsBarPosition?: 'top' | 'bottom' | 'left' | 'right';
|
|
35
|
+
} & Pick<ParticipantViewProps, 'VideoPlaceholder'>;
|
|
36
|
+
|
|
37
|
+
const DefaultParticipantViewUIBar = () => (
|
|
38
|
+
<DefaultParticipantViewUI menuPlacement="top-end" />
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const DefaultParticipantViewUISpotlight = () => <DefaultParticipantViewUI />;
|
|
42
|
+
|
|
43
|
+
export const SpeakerLayout = ({
|
|
44
|
+
ParticipantViewUIBar = DefaultParticipantViewUIBar,
|
|
45
|
+
ParticipantViewUISpotlight = DefaultParticipantViewUISpotlight,
|
|
46
|
+
VideoPlaceholder,
|
|
47
|
+
participantsBarPosition = 'bottom',
|
|
48
|
+
}: SpeakerLayoutProps) => {
|
|
49
|
+
const call = useCall();
|
|
50
|
+
const [participantInSpotlight, ...otherParticipants] = useParticipants();
|
|
51
|
+
const [scrollWrapper, setScrollWrapper] = useState<HTMLDivElement | null>(
|
|
52
|
+
null,
|
|
53
|
+
);
|
|
54
|
+
const isOneOnOneCall = otherParticipants.length === 1;
|
|
55
|
+
const localParticipant = useLocalParticipant();
|
|
56
|
+
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
if (!scrollWrapper || !call) return;
|
|
59
|
+
|
|
60
|
+
const cleanup = call.viewportTracker.setViewport(scrollWrapper);
|
|
61
|
+
|
|
62
|
+
return () => cleanup();
|
|
63
|
+
}, [scrollWrapper, call]);
|
|
64
|
+
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
if (!call) return;
|
|
67
|
+
// always show the remote participant in the spotlight
|
|
68
|
+
if (isOneOnOneCall) {
|
|
69
|
+
call.setSortParticipantsBy(combineComparators(screenSharing, loggedIn));
|
|
70
|
+
} else {
|
|
71
|
+
call.setSortParticipantsBy(speakerLayoutSortPreset);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return () => {
|
|
75
|
+
// reset the sorting to the default for the call type
|
|
76
|
+
const callConfig = CallTypes.get(call.type);
|
|
77
|
+
call.setSortParticipantsBy(
|
|
78
|
+
callConfig.options.sortParticipantsBy || defaultSortPreset,
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
}, [call, isOneOnOneCall]);
|
|
82
|
+
|
|
83
|
+
if (!call) return null;
|
|
84
|
+
|
|
85
|
+
const isSpeakerScreenSharing = hasScreenShare(participantInSpotlight);
|
|
86
|
+
return (
|
|
87
|
+
<div className="str-video__speaker-layout__wrapper">
|
|
88
|
+
<div
|
|
89
|
+
className={clsx(
|
|
90
|
+
'str-video__speaker-layout',
|
|
91
|
+
`str-video__speaker-layout--variant-${participantsBarPosition}`,
|
|
92
|
+
)}
|
|
93
|
+
>
|
|
94
|
+
<div className="str-video__speaker-layout__spotlight">
|
|
95
|
+
{participantInSpotlight && (
|
|
96
|
+
<ParticipantView
|
|
97
|
+
participant={participantInSpotlight}
|
|
98
|
+
muteAudio={isSpeakerScreenSharing}
|
|
99
|
+
videoKind={isSpeakerScreenSharing ? 'screen' : 'video'}
|
|
100
|
+
sinkId={localParticipant?.audioOutputDeviceId}
|
|
101
|
+
ParticipantViewUI={ParticipantViewUISpotlight}
|
|
102
|
+
VideoPlaceholder={VideoPlaceholder}
|
|
103
|
+
/>
|
|
104
|
+
)}
|
|
105
|
+
</div>
|
|
106
|
+
{otherParticipants.length > 0 && (
|
|
107
|
+
<div className="str-video__speaker-layout__participants-bar-buttons-wrapper">
|
|
108
|
+
<div
|
|
109
|
+
className="str-video__speaker-layout__participants-bar-wrapper"
|
|
110
|
+
ref={setScrollWrapper}
|
|
111
|
+
>
|
|
112
|
+
<div className="str-video__speaker-layout__participants-bar">
|
|
113
|
+
{isSpeakerScreenSharing && (
|
|
114
|
+
<div
|
|
115
|
+
className="str-video__speaker-layout__participant-tile"
|
|
116
|
+
key={participantInSpotlight.sessionId}
|
|
117
|
+
>
|
|
118
|
+
<ParticipantView
|
|
119
|
+
participant={participantInSpotlight}
|
|
120
|
+
sinkId={localParticipant?.audioOutputDeviceId}
|
|
121
|
+
ParticipantViewUI={ParticipantViewUIBar}
|
|
122
|
+
VideoPlaceholder={VideoPlaceholder}
|
|
123
|
+
/>
|
|
124
|
+
</div>
|
|
125
|
+
)}
|
|
126
|
+
{otherParticipants.map((participant) => (
|
|
127
|
+
<div
|
|
128
|
+
className="str-video__speaker-layout__participant-tile"
|
|
129
|
+
key={participant.sessionId}
|
|
130
|
+
>
|
|
131
|
+
<ParticipantView
|
|
132
|
+
participant={participant}
|
|
133
|
+
sinkId={localParticipant?.audioOutputDeviceId}
|
|
134
|
+
ParticipantViewUI={ParticipantViewUIBar}
|
|
135
|
+
VideoPlaceholder={VideoPlaceholder}
|
|
136
|
+
/>
|
|
137
|
+
</div>
|
|
138
|
+
))}
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
{(participantsBarPosition === 'left' ||
|
|
142
|
+
participantsBarPosition === 'right') && (
|
|
143
|
+
<VerticalScrollButtons scrollWrapper={scrollWrapper} />
|
|
144
|
+
)}
|
|
145
|
+
{(participantsBarPosition === 'top' ||
|
|
146
|
+
participantsBarPosition === 'bottom') && (
|
|
147
|
+
<HorizontalScrollButtons scrollWrapper={scrollWrapper} />
|
|
148
|
+
)}
|
|
149
|
+
</div>
|
|
150
|
+
)}
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
);
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
type ScrollButtonsProps<T extends HTMLElement> = {
|
|
157
|
+
scrollWrapper: T | null;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const HorizontalScrollButtons = <T extends HTMLElement>({
|
|
161
|
+
scrollWrapper,
|
|
162
|
+
}: ScrollButtonsProps<T>) => {
|
|
163
|
+
const scrollPosition = useHorizontalScrollPosition(scrollWrapper);
|
|
164
|
+
|
|
165
|
+
const scrollStartClickHandler = () => {
|
|
166
|
+
scrollWrapper?.scrollBy({ left: -150, behavior: 'smooth' });
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
const scrollEndClickHandler = () => {
|
|
170
|
+
scrollWrapper?.scrollBy({ left: 150, behavior: 'smooth' });
|
|
171
|
+
};
|
|
172
|
+
return (
|
|
173
|
+
<>
|
|
174
|
+
{scrollPosition && scrollPosition !== 'start' && (
|
|
175
|
+
<IconButton
|
|
176
|
+
onClick={scrollStartClickHandler}
|
|
177
|
+
icon="caret-left"
|
|
178
|
+
className="str-video__speaker-layout__participants-bar--button-left"
|
|
179
|
+
/>
|
|
180
|
+
)}
|
|
181
|
+
{scrollPosition && scrollPosition !== 'end' && (
|
|
182
|
+
<IconButton
|
|
183
|
+
onClick={scrollEndClickHandler}
|
|
184
|
+
icon="caret-right"
|
|
185
|
+
className="str-video__speaker-layout__participants-bar--button-right"
|
|
186
|
+
/>
|
|
187
|
+
)}
|
|
188
|
+
</>
|
|
189
|
+
);
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
const VerticalScrollButtons = <T extends HTMLElement>({
|
|
193
|
+
scrollWrapper,
|
|
194
|
+
}: ScrollButtonsProps<T>) => {
|
|
195
|
+
const scrollPosition = useVerticalScrollPosition(scrollWrapper);
|
|
196
|
+
|
|
197
|
+
const scrollTopClickHandler = () => {
|
|
198
|
+
scrollWrapper?.scrollBy({ top: -150, behavior: 'smooth' });
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
const scrollBottomClickHandler = () => {
|
|
202
|
+
scrollWrapper?.scrollBy({ top: 150, behavior: 'smooth' });
|
|
203
|
+
};
|
|
204
|
+
return (
|
|
205
|
+
<>
|
|
206
|
+
{scrollPosition && scrollPosition !== 'top' && (
|
|
207
|
+
<IconButton
|
|
208
|
+
onClick={scrollTopClickHandler}
|
|
209
|
+
icon="caret-up"
|
|
210
|
+
className="str-video__speaker-layout__participants-bar--button-top"
|
|
211
|
+
/>
|
|
212
|
+
)}
|
|
213
|
+
{scrollPosition && scrollPosition !== 'bottom' && (
|
|
214
|
+
<IconButton
|
|
215
|
+
onClick={scrollBottomClickHandler}
|
|
216
|
+
icon="caret-down"
|
|
217
|
+
className="str-video__speaker-layout__participants-bar--button-bottom"
|
|
218
|
+
/>
|
|
219
|
+
)}
|
|
220
|
+
</>
|
|
221
|
+
);
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
const hasScreenShare = (p?: StreamVideoParticipant) =>
|
|
225
|
+
!!p?.publishedTracks.includes(SfuModels.TrackType.SCREEN_SHARE);
|
|
226
|
+
|
|
227
|
+
const loggedIn: Comparator<StreamVideoParticipant> = (a, b) => {
|
|
228
|
+
if (a.isLoggedInUser) return 1;
|
|
229
|
+
if (b.isLoggedInUser) return -1;
|
|
230
|
+
return 0;
|
|
231
|
+
};
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import { Placement } from '@floating-ui/react';
|
|
3
|
+
import { SfuModels } from '@stream-io/video-client';
|
|
4
|
+
import { useCall } from '@stream-io/video-react-bindings';
|
|
5
|
+
import { clsx } from 'clsx';
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
IconButton,
|
|
9
|
+
MenuToggle,
|
|
10
|
+
Notification,
|
|
11
|
+
ParticipantActionsContextMenu,
|
|
12
|
+
ToggleMenuButtonProps,
|
|
13
|
+
} from '../../../components';
|
|
14
|
+
import { Reaction } from '../../../components/Reaction';
|
|
15
|
+
|
|
16
|
+
import { DebugParticipantPublishQuality } from '../../../components/Debug/DebugParticipantPublishQuality';
|
|
17
|
+
import { DebugStatsView } from '../../../components/Debug/DebugStatsView';
|
|
18
|
+
import { useIsDebugMode } from '../../../components/Debug/useIsDebugMode';
|
|
19
|
+
import { useParticipantViewContext } from './ParticipantView';
|
|
20
|
+
|
|
21
|
+
export type DefaultParticipantViewUIProps = {
|
|
22
|
+
/**
|
|
23
|
+
* Turns on/off the status indicator icons (mute, connection quality, etc...).
|
|
24
|
+
*/
|
|
25
|
+
indicatorsVisible?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Placement of the context menu component when opened
|
|
28
|
+
*/
|
|
29
|
+
menuPlacement?: Placement;
|
|
30
|
+
/**
|
|
31
|
+
* Option to show/hide menu button component
|
|
32
|
+
*/
|
|
33
|
+
showMenuButton?: boolean;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const ToggleButton = forwardRef<HTMLButtonElement, ToggleMenuButtonProps>(
|
|
37
|
+
(props, ref) => {
|
|
38
|
+
return <IconButton enabled={props.menuShown} icon="ellipsis" ref={ref} />;
|
|
39
|
+
},
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
export const DefaultParticipantViewUI = ({
|
|
43
|
+
indicatorsVisible = true,
|
|
44
|
+
menuPlacement = 'bottom-end',
|
|
45
|
+
showMenuButton = true,
|
|
46
|
+
}: DefaultParticipantViewUIProps) => {
|
|
47
|
+
const call = useCall()!;
|
|
48
|
+
const { participant, participantViewElement } = useParticipantViewContext();
|
|
49
|
+
const { reaction, sessionId } = participant;
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<>
|
|
53
|
+
{showMenuButton && (
|
|
54
|
+
<MenuToggle
|
|
55
|
+
strategy="fixed"
|
|
56
|
+
placement={menuPlacement}
|
|
57
|
+
ToggleButton={ToggleButton}
|
|
58
|
+
>
|
|
59
|
+
<ParticipantActionsContextMenu
|
|
60
|
+
participantViewElement={participantViewElement}
|
|
61
|
+
participant={participant}
|
|
62
|
+
/>
|
|
63
|
+
</MenuToggle>
|
|
64
|
+
)}
|
|
65
|
+
{reaction && (
|
|
66
|
+
<Reaction reaction={reaction} sessionId={sessionId} call={call} />
|
|
67
|
+
)}
|
|
68
|
+
<ParticipantDetails indicatorsVisible={indicatorsVisible} />
|
|
69
|
+
</>
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const ParticipantDetails = ({
|
|
74
|
+
indicatorsVisible = true,
|
|
75
|
+
}: Pick<DefaultParticipantViewUIProps, 'indicatorsVisible'>) => {
|
|
76
|
+
const { participant } = useParticipantViewContext();
|
|
77
|
+
const {
|
|
78
|
+
isDominantSpeaker,
|
|
79
|
+
isLoggedInUser,
|
|
80
|
+
connectionQuality,
|
|
81
|
+
publishedTracks,
|
|
82
|
+
pinnedAt,
|
|
83
|
+
sessionId,
|
|
84
|
+
name,
|
|
85
|
+
userId,
|
|
86
|
+
videoStream,
|
|
87
|
+
} = participant;
|
|
88
|
+
const call = useCall()!;
|
|
89
|
+
|
|
90
|
+
const connectionQualityAsString =
|
|
91
|
+
!!connectionQuality &&
|
|
92
|
+
SfuModels.ConnectionQuality[connectionQuality].toLowerCase();
|
|
93
|
+
|
|
94
|
+
const hasAudio = publishedTracks.includes(SfuModels.TrackType.AUDIO);
|
|
95
|
+
const hasVideo = publishedTracks.includes(SfuModels.TrackType.VIDEO);
|
|
96
|
+
const isPinned = !!pinnedAt;
|
|
97
|
+
|
|
98
|
+
const isDebugMode = useIsDebugMode();
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<div className="str-video__participant-details">
|
|
102
|
+
<span className="str-video__participant-details__name">
|
|
103
|
+
{name || userId}
|
|
104
|
+
{indicatorsVisible && isDominantSpeaker && (
|
|
105
|
+
<span
|
|
106
|
+
className="str-video__participant-details__name--dominant_speaker"
|
|
107
|
+
title="Dominant speaker"
|
|
108
|
+
/>
|
|
109
|
+
)}
|
|
110
|
+
{indicatorsVisible && (
|
|
111
|
+
<Notification
|
|
112
|
+
isVisible={
|
|
113
|
+
isLoggedInUser &&
|
|
114
|
+
connectionQuality === SfuModels.ConnectionQuality.POOR
|
|
115
|
+
}
|
|
116
|
+
message="Poor connection quality. Please check your internet connection."
|
|
117
|
+
>
|
|
118
|
+
{connectionQualityAsString && (
|
|
119
|
+
<span
|
|
120
|
+
className={clsx(
|
|
121
|
+
'str-video__participant-details__connection-quality',
|
|
122
|
+
`str-video__participant-details__connection-quality--${connectionQualityAsString}`,
|
|
123
|
+
)}
|
|
124
|
+
title={connectionQualityAsString}
|
|
125
|
+
/>
|
|
126
|
+
)}
|
|
127
|
+
</Notification>
|
|
128
|
+
)}
|
|
129
|
+
{indicatorsVisible && !hasAudio && (
|
|
130
|
+
<span className="str-video__participant-details__name--audio-muted" />
|
|
131
|
+
)}
|
|
132
|
+
{indicatorsVisible && !hasVideo && (
|
|
133
|
+
<span className="str-video__participant-details__name--video-muted" />
|
|
134
|
+
)}
|
|
135
|
+
{indicatorsVisible && isPinned && (
|
|
136
|
+
// TODO: remove this monstrosity once we have a proper design
|
|
137
|
+
<span
|
|
138
|
+
title="Unpin"
|
|
139
|
+
onClick={() => call?.setParticipantPinnedAt(sessionId)}
|
|
140
|
+
style={{ cursor: 'pointer' }}
|
|
141
|
+
className="str-video__participant-details__name--pinned"
|
|
142
|
+
/>
|
|
143
|
+
)}
|
|
144
|
+
</span>
|
|
145
|
+
{isDebugMode && (
|
|
146
|
+
<>
|
|
147
|
+
<DebugParticipantPublishQuality
|
|
148
|
+
participant={participant}
|
|
149
|
+
call={call}
|
|
150
|
+
/>
|
|
151
|
+
<DebugStatsView
|
|
152
|
+
call={call}
|
|
153
|
+
sessionId={sessionId}
|
|
154
|
+
mediaStream={videoStream}
|
|
155
|
+
/>
|
|
156
|
+
</>
|
|
157
|
+
)}
|
|
158
|
+
</div>
|
|
159
|
+
);
|
|
160
|
+
};
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { useContext, useMemo } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
forwardRef,
|
|
4
|
+
ComponentType,
|
|
5
|
+
useState,
|
|
6
|
+
ReactElement,
|
|
7
|
+
createContext,
|
|
8
|
+
} from 'react';
|
|
9
|
+
import clsx from 'clsx';
|
|
10
|
+
import {
|
|
11
|
+
SfuModels,
|
|
12
|
+
StreamVideoLocalParticipant,
|
|
13
|
+
StreamVideoParticipant,
|
|
14
|
+
} from '@stream-io/video-client';
|
|
15
|
+
|
|
16
|
+
import { Audio } from '../Audio';
|
|
17
|
+
import { Video, VideoProps } from '../Video';
|
|
18
|
+
import { useTrackElementVisibility } from '../../hooks';
|
|
19
|
+
import { DefaultParticipantViewUI } from './DefaultParticipantViewUI';
|
|
20
|
+
import { isComponentType, applyElementToRef } from '../../../utilities';
|
|
21
|
+
|
|
22
|
+
export type ParticipantViewContextValue = Pick<
|
|
23
|
+
ParticipantViewProps,
|
|
24
|
+
'participant'
|
|
25
|
+
> & {
|
|
26
|
+
participantViewElement: HTMLDivElement | null;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const ParticipantViewContext = createContext<
|
|
30
|
+
ParticipantViewContextValue | undefined
|
|
31
|
+
>(undefined);
|
|
32
|
+
|
|
33
|
+
export const useParticipantViewContext = () =>
|
|
34
|
+
useContext(ParticipantViewContext) as ParticipantViewContextValue;
|
|
35
|
+
|
|
36
|
+
export type ParticipantViewProps = {
|
|
37
|
+
/**
|
|
38
|
+
* The participant bound to this component.
|
|
39
|
+
*/
|
|
40
|
+
participant: StreamVideoParticipant | StreamVideoLocalParticipant;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Component used to render user interface elements (details, network status...),
|
|
44
|
+
* pass `null` if you wish to not render anything
|
|
45
|
+
* @default DefaultParticipantViewUI
|
|
46
|
+
*/
|
|
47
|
+
ParticipantViewUI?: ComponentType | ReactElement | null;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* In supported browsers, this sets the default audio output.
|
|
51
|
+
* The value of this prop should be a valid Audio Output `deviceId`.
|
|
52
|
+
*/
|
|
53
|
+
sinkId?: string;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The kind of video stream to play for the given participant.
|
|
57
|
+
*/
|
|
58
|
+
videoKind?: 'video' | 'screen';
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Turns on/off the audio for the participant.
|
|
62
|
+
*/
|
|
63
|
+
muteAudio?: boolean;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* An object with set functions meant for exposing the "native" video
|
|
67
|
+
* and video placeholder elements to the integrators.
|
|
68
|
+
* - `refs.setVideoElement`
|
|
69
|
+
* - `refs.setVideoPlaceholderElement`
|
|
70
|
+
*/
|
|
71
|
+
refs?: VideoProps['refs'];
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Custom class applied to the root DOM element.
|
|
75
|
+
*/
|
|
76
|
+
className?: string;
|
|
77
|
+
} & Pick<VideoProps, 'VideoPlaceholder'>;
|
|
78
|
+
|
|
79
|
+
export const ParticipantView = forwardRef<HTMLDivElement, ParticipantViewProps>(
|
|
80
|
+
(
|
|
81
|
+
{
|
|
82
|
+
participant,
|
|
83
|
+
sinkId,
|
|
84
|
+
videoKind = 'video',
|
|
85
|
+
muteAudio,
|
|
86
|
+
refs,
|
|
87
|
+
className,
|
|
88
|
+
VideoPlaceholder,
|
|
89
|
+
ParticipantViewUI = DefaultParticipantViewUI as ComponentType,
|
|
90
|
+
},
|
|
91
|
+
ref,
|
|
92
|
+
) => {
|
|
93
|
+
const {
|
|
94
|
+
audioStream,
|
|
95
|
+
isLoggedInUser,
|
|
96
|
+
isSpeaking,
|
|
97
|
+
publishedTracks,
|
|
98
|
+
sessionId,
|
|
99
|
+
} = participant;
|
|
100
|
+
|
|
101
|
+
const hasAudio = publishedTracks.includes(SfuModels.TrackType.AUDIO);
|
|
102
|
+
const hasVideo = publishedTracks.includes(SfuModels.TrackType.VIDEO);
|
|
103
|
+
|
|
104
|
+
const [trackedElement, setTrackedElement] = useState<HTMLDivElement | null>(
|
|
105
|
+
null,
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
// TODO: allow to pass custom ViewportTracker instance from props
|
|
109
|
+
useTrackElementVisibility({
|
|
110
|
+
sessionId,
|
|
111
|
+
trackedElement,
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
const participantViewContextValue = useMemo(
|
|
115
|
+
() => ({ participant, participantViewElement: trackedElement }),
|
|
116
|
+
[participant, trackedElement],
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
return (
|
|
120
|
+
<div
|
|
121
|
+
ref={(element) => {
|
|
122
|
+
applyElementToRef(ref, element);
|
|
123
|
+
setTrackedElement(element);
|
|
124
|
+
}}
|
|
125
|
+
className={clsx(
|
|
126
|
+
'str-video__participant-view',
|
|
127
|
+
isSpeaking && 'str-video__participant-view--speaking',
|
|
128
|
+
!hasVideo && 'str-video__participant-view--no-video',
|
|
129
|
+
!hasAudio && 'str-video__participant-view--no-audio',
|
|
130
|
+
className,
|
|
131
|
+
)}
|
|
132
|
+
>
|
|
133
|
+
<ParticipantViewContext.Provider value={participantViewContextValue}>
|
|
134
|
+
<Audio
|
|
135
|
+
// mute the local participant, as we don't want to hear ourselves
|
|
136
|
+
muted={isLoggedInUser || muteAudio}
|
|
137
|
+
sinkId={sinkId}
|
|
138
|
+
audioStream={audioStream}
|
|
139
|
+
/>
|
|
140
|
+
<Video
|
|
141
|
+
VideoPlaceholder={VideoPlaceholder}
|
|
142
|
+
participant={participant}
|
|
143
|
+
kind={videoKind}
|
|
144
|
+
refs={refs}
|
|
145
|
+
autoPlay
|
|
146
|
+
/>
|
|
147
|
+
{isComponentType(ParticipantViewUI) ? (
|
|
148
|
+
<ParticipantViewUI />
|
|
149
|
+
) : (
|
|
150
|
+
ParticipantViewUI
|
|
151
|
+
)}
|
|
152
|
+
</ParticipantViewContext.Provider>
|
|
153
|
+
</div>
|
|
154
|
+
);
|
|
155
|
+
},
|
|
156
|
+
);
|