@stream-io/video-react-sdk 0.0.1-alpha.9
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 +183 -0
- package/LICENSE +219 -0
- package/README.md +5 -0
- package/dist/css/styles.css +2351 -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 +15 -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/CallControls.d.ts +7 -0
- package/dist/src/components/CallControls/CallControls.js +8 -0
- package/dist/src/components/CallControls/CallControls.js.map +1 -0
- package/dist/src/components/CallControls/CallStatsButton.d.ts +6 -0
- package/dist/src/components/CallControls/CallStatsButton.js +10 -0
- package/dist/src/components/CallControls/CallStatsButton.js.map +1 -0
- package/dist/src/components/CallControls/CancelCallButton.d.ts +8 -0
- package/dist/src/components/CallControls/CancelCallButton.js +25 -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 +33 -0
- package/dist/src/components/CallControls/ReactionsButton.js.map +1 -0
- package/dist/src/components/CallControls/RecordCallButton.d.ts +7 -0
- package/dist/src/components/CallControls/RecordCallButton.js +51 -0
- package/dist/src/components/CallControls/RecordCallButton.js.map +1 -0
- package/dist/src/components/CallControls/ScreenShareButton.d.ts +7 -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 +66 -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/ToggleCameraButton.d.ts +10 -0
- package/dist/src/components/CallControls/ToggleCameraButton.js +64 -0
- package/dist/src/components/CallControls/ToggleCameraButton.js.map +1 -0
- package/dist/src/components/CallControls/ToggleParticipantListButton.d.ts +6 -0
- package/dist/src/components/CallControls/ToggleParticipantListButton.js +7 -0
- package/dist/src/components/CallControls/ToggleParticipantListButton.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 +19 -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 +15 -0
- package/dist/src/components/CallParticipantsList/CallParticipantListingItem.js +77 -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 +82 -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/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 +26 -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 +18 -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 +10 -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/Moderation/Restricted.d.ts +19 -0
- package/dist/src/components/Moderation/Restricted.js +13 -0
- package/dist/src/components/Moderation/Restricted.js.map +1 -0
- package/dist/src/components/Moderation/index.d.ts +1 -0
- package/dist/src/components/Moderation/index.js +2 -0
- package/dist/src/components/Moderation/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 +45 -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/Permissions/PermissionRequests.d.ts +8 -0
- package/dist/src/components/Permissions/PermissionRequests.js +109 -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 +11 -0
- package/dist/src/components/StreamCall/CallParticipantsView.js.map +1 -0
- package/dist/src/components/StreamCall/CallStats.d.ts +2 -0
- package/dist/src/components/StreamCall/CallStats.js +69 -0
- package/dist/src/components/StreamCall/CallStats.js.map +1 -0
- package/dist/src/components/StreamCall/CallStatsLatencyChart.d.ts +7 -0
- package/dist/src/components/StreamCall/CallStatsLatencyChart.js +39 -0
- package/dist/src/components/StreamCall/CallStatsLatencyChart.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/hooks/index.d.ts +1 -0
- package/dist/src/components/StreamCall/hooks/index.js +2 -0
- package/dist/src/components/StreamCall/hooks/index.js.map +1 -0
- package/dist/src/components/StreamCall/hooks/useScrollPosition.d.ts +6 -0
- package/dist/src/components/StreamCall/hooks/useScrollPosition.js +63 -0
- package/dist/src/components/StreamCall/hooks/useScrollPosition.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/StreamMeeting/StreamMeeting.d.ts +34 -0
- package/dist/src/components/StreamMeeting/StreamMeeting.js +26 -0
- package/dist/src/components/StreamMeeting/StreamMeeting.js.map +1 -0
- package/dist/src/components/StreamMeeting/index.d.ts +1 -0
- package/dist/src/components/StreamMeeting/index.js +2 -0
- package/dist/src/components/StreamMeeting/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 +13 -0
- package/dist/src/components/Video/VideoPreview.js +70 -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 +21 -0
- package/dist/src/core/components/CallLayout/PaginatedGridLayout.js +39 -0
- package/dist/src/core/components/CallLayout/PaginatedGridLayout.js.map +1 -0
- package/dist/src/core/components/CallLayout/SpeakerLayout.d.ts +2 -0
- package/dist/src/core/components/CallLayout/SpeakerLayout.js +52 -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/ParticipantBox/ParticipantBox.d.ts +48 -0
- package/dist/src/core/components/ParticipantBox/ParticipantBox.js +58 -0
- package/dist/src/core/components/ParticipantBox/ParticipantBox.js.map +1 -0
- package/dist/src/core/components/ParticipantBox/index.d.ts +1 -0
- package/dist/src/core/components/ParticipantBox/index.js +2 -0
- package/dist/src/core/components/ParticipantBox/index.js.map +1 -0
- package/dist/src/core/components/Video/BaseVideo.d.ts +9 -0
- package/dist/src/core/components/Video/BaseVideo.js +54 -0
- package/dist/src/core/components/Video/BaseVideo.js.map +1 -0
- package/dist/src/core/components/Video/Video.d.ts +8 -0
- package/dist/src/core/components/Video/Video.js +151 -0
- package/dist/src/core/components/Video/Video.js.map +1 -0
- package/dist/src/core/components/Video/VideoPlaceholder.d.ts +6 -0
- package/dist/src/core/components/Video/VideoPlaceholder.js +12 -0
- package/dist/src/core/components/Video/VideoPlaceholder.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 +5 -0
- package/dist/src/core/components/index.js +5 -0
- package/dist/src/core/components/index.js.map +1 -0
- package/dist/src/core/contexts/MediaDevicesContext.d.ts +82 -0
- package/dist/src/core/contexts/MediaDevicesContext.js +215 -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 +2 -0
- package/dist/src/core/hooks/index.js +3 -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 +89 -0
- package/dist/src/core/hooks/useAudioPublisher.js.map +1 -0
- package/dist/src/core/hooks/useVideoPublisher.d.ts +12 -0
- package/dist/src/core/hooks/useVideoPublisher.js +91 -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 +29 -0
- package/dist/src/hooks/useFloatingUIPreset.js.map +1 -0
- package/dist/src/hooks/useRtcStats.d.ts +11 -0
- package/dist/src/hooks/useRtcStats.js +39 -0
- package/dist/src/hooks/useRtcStats.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/index.ts +18 -0
- package/package.json +49 -0
- package/src/components/Avatar/Avatar.tsx +45 -0
- package/src/components/Avatar/index.ts +1 -0
- package/src/components/Button/CompositeButton.tsx +59 -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/CallControls.tsx +32 -0
- package/src/components/CallControls/CallStatsButton.tsx +28 -0
- package/src/components/CallControls/CancelCallButton.tsx +28 -0
- package/src/components/CallControls/ReactionsButton.tsx +75 -0
- package/src/components/CallControls/RecordCallButton.tsx +68 -0
- package/src/components/CallControls/ScreenShareButton.tsx +85 -0
- package/src/components/CallControls/ToggleAudioButton.tsx +112 -0
- package/src/components/CallControls/ToggleAudioOutputButton.tsx +21 -0
- package/src/components/CallControls/ToggleCameraButton.tsx +109 -0
- package/src/components/CallControls/ToggleParticipantListButton.tsx +17 -0
- package/src/components/CallControls/index.ts +10 -0
- package/src/components/CallParticipantsList/BlockedUserListing.tsx +38 -0
- package/src/components/CallParticipantsList/CallParticipantListHeader.tsx +29 -0
- package/src/components/CallParticipantsList/CallParticipantListing.tsx +22 -0
- package/src/components/CallParticipantsList/CallParticipantListingItem.tsx +249 -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/Debug/DebugParticipantPublishQuality.tsx +62 -0
- package/src/components/Debug/DebugStatsView.tsx +55 -0
- package/src/components/Debug/useIsDebugMode.ts +24 -0
- package/src/components/DeviceSettings/DeviceSelector.tsx +106 -0
- package/src/components/DeviceSettings/DeviceSelectorAudio.tsx +52 -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/Moderation/Restricted.tsx +38 -0
- package/src/components/Moderation/index.ts +1 -0
- package/src/components/Notification/Notification.tsx +61 -0
- package/src/components/Notification/PermissionNotification.tsx +97 -0
- package/src/components/Notification/SpeakingWhileMutedNotification.tsx +60 -0
- package/src/components/Notification/index.ts +3 -0
- package/src/components/Permissions/PermissionRequests.tsx +182 -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 +126 -0
- package/src/components/StreamCall/CallParticipantsView.tsx +25 -0
- package/src/components/StreamCall/CallStats.tsx +162 -0
- package/src/components/StreamCall/CallStatsLatencyChart.tsx +58 -0
- package/src/components/StreamCall/Stage.tsx +22 -0
- package/src/components/StreamCall/hooks/index.ts +1 -0
- package/src/components/StreamCall/hooks/useScrollPosition.ts +95 -0
- package/src/components/StreamCall/index.ts +4 -0
- package/src/components/StreamMeeting/StreamMeeting.tsx +80 -0
- package/src/components/StreamMeeting/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 +127 -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 +163 -0
- package/src/core/components/CallLayout/SpeakerLayout.tsx +145 -0
- package/src/core/components/CallLayout/index.ts +2 -0
- package/src/core/components/ParticipantBox/ParticipantBox.tsx +248 -0
- package/src/core/components/ParticipantBox/index.ts +1 -0
- package/src/core/components/Video/BaseVideo.tsx +68 -0
- package/src/core/components/Video/Video.tsx +238 -0
- package/src/core/components/Video/VideoPlaceholder.tsx +40 -0
- package/src/core/components/Video/index.ts +2 -0
- package/src/core/components/index.ts +7 -0
- package/src/core/contexts/MediaDevicesContext.tsx +373 -0
- package/src/core/contexts/index.ts +1 -0
- package/src/core/hooks/index.ts +2 -0
- package/src/core/hooks/useAudioPublisher.ts +118 -0
- package/src/core/hooks/useVideoPublisher.ts +120 -0
- package/src/core/index.ts +3 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useFloatingUIPreset.ts +48 -0
- package/src/hooks/useRtcStats.ts +36 -0
- package/src/types/components.ts +7 -0
- package/src/types/index.ts +1 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
useCall,
|
|
4
|
+
useHasPermissions,
|
|
5
|
+
useLocalParticipant,
|
|
6
|
+
} from '@stream-io/video-react-bindings';
|
|
7
|
+
|
|
8
|
+
import { OwnCapability, SfuModels } from '@stream-io/video-client';
|
|
9
|
+
import { CompositeButton, IconButton } from '../Button/';
|
|
10
|
+
import { useMediaDevices } from '../../core/contexts';
|
|
11
|
+
import { DeviceSelectorVideo } from '../DeviceSettings';
|
|
12
|
+
import { PermissionNotification } from '../Notification';
|
|
13
|
+
import { Restricted } from '../Moderation';
|
|
14
|
+
|
|
15
|
+
export type ToggleCameraPreviewButtonProps = { caption?: string };
|
|
16
|
+
|
|
17
|
+
export const ToggleCameraPreviewButton = ({
|
|
18
|
+
caption = 'Video',
|
|
19
|
+
}: ToggleCameraPreviewButtonProps) => {
|
|
20
|
+
const { toggleVideoMuteState, initialVideoState } = useMediaDevices();
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<CompositeButton
|
|
24
|
+
Menu={DeviceSelectorVideo}
|
|
25
|
+
active={!initialVideoState.enabled}
|
|
26
|
+
caption={caption}
|
|
27
|
+
>
|
|
28
|
+
<IconButton
|
|
29
|
+
icon={initialVideoState.enabled ? 'camera' : 'camera-off'}
|
|
30
|
+
onClick={toggleVideoMuteState}
|
|
31
|
+
/>
|
|
32
|
+
</CompositeButton>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
type ToggleCameraPublishingButtonProps = {
|
|
37
|
+
caption?: string;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const ToggleCameraPublishingButton = ({
|
|
41
|
+
caption = 'Video',
|
|
42
|
+
}: ToggleCameraPublishingButtonProps) => {
|
|
43
|
+
const { publishVideoStream, stopPublishingVideo } = useMediaDevices();
|
|
44
|
+
const localParticipant = useLocalParticipant();
|
|
45
|
+
const isVideoMute = !localParticipant?.publishedTracks.includes(
|
|
46
|
+
SfuModels.TrackType.VIDEO,
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
const call = useCall();
|
|
50
|
+
const hasPermission = useHasPermissions(OwnCapability.SEND_VIDEO);
|
|
51
|
+
const [isAwaitingApproval, setIsAwaitingApproval] = useState(false);
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (hasPermission) {
|
|
54
|
+
setIsAwaitingApproval(false);
|
|
55
|
+
}
|
|
56
|
+
}, [hasPermission]);
|
|
57
|
+
|
|
58
|
+
const handleClick = useCallback(async () => {
|
|
59
|
+
if (
|
|
60
|
+
!hasPermission &&
|
|
61
|
+
call &&
|
|
62
|
+
call.permissionsContext.canRequest(OwnCapability.SEND_VIDEO)
|
|
63
|
+
) {
|
|
64
|
+
setIsAwaitingApproval(true);
|
|
65
|
+
await call
|
|
66
|
+
.requestPermissions({
|
|
67
|
+
permissions: [OwnCapability.SEND_VIDEO],
|
|
68
|
+
})
|
|
69
|
+
.catch((reason) => {
|
|
70
|
+
console.log('RequestPermissions failed', reason);
|
|
71
|
+
});
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (isVideoMute && hasPermission) {
|
|
75
|
+
await publishVideoStream();
|
|
76
|
+
} else {
|
|
77
|
+
stopPublishingVideo();
|
|
78
|
+
}
|
|
79
|
+
}, [
|
|
80
|
+
call,
|
|
81
|
+
hasPermission,
|
|
82
|
+
isVideoMute,
|
|
83
|
+
publishVideoStream,
|
|
84
|
+
stopPublishingVideo,
|
|
85
|
+
]);
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<Restricted requiredGrants={[OwnCapability.SEND_VIDEO]}>
|
|
89
|
+
<PermissionNotification
|
|
90
|
+
permission={OwnCapability.SEND_VIDEO}
|
|
91
|
+
isAwaitingApproval={isAwaitingApproval}
|
|
92
|
+
messageApproved="You can now share your video."
|
|
93
|
+
messageAwaitingApproval="Awaiting for an approval to share your video."
|
|
94
|
+
messageRevoked="You can no longer share your video."
|
|
95
|
+
>
|
|
96
|
+
<CompositeButton
|
|
97
|
+
Menu={DeviceSelectorVideo}
|
|
98
|
+
active={isVideoMute}
|
|
99
|
+
caption={caption}
|
|
100
|
+
>
|
|
101
|
+
<IconButton
|
|
102
|
+
icon={isVideoMute ? 'camera-off' : 'camera'}
|
|
103
|
+
onClick={handleClick}
|
|
104
|
+
/>
|
|
105
|
+
</CompositeButton>
|
|
106
|
+
</PermissionNotification>
|
|
107
|
+
</Restricted>
|
|
108
|
+
);
|
|
109
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ButtonWithIconProps, CompositeButton, IconButton } from '../Button/';
|
|
2
|
+
|
|
3
|
+
export type ToggleParticipantListButtonProps = { caption?: string } & Omit<
|
|
4
|
+
ButtonWithIconProps,
|
|
5
|
+
'icon' | 'ref'
|
|
6
|
+
>;
|
|
7
|
+
|
|
8
|
+
export const ToggleParticipantListButton = (
|
|
9
|
+
props: ToggleParticipantListButtonProps,
|
|
10
|
+
) => {
|
|
11
|
+
const { enabled, caption = 'Participants' } = props;
|
|
12
|
+
return (
|
|
13
|
+
<CompositeButton active={enabled} caption={caption}>
|
|
14
|
+
<IconButton icon="participants" {...props} />
|
|
15
|
+
</CompositeButton>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './CallControls';
|
|
2
|
+
export * from './CallStatsButton';
|
|
3
|
+
export * from './CancelCallButton';
|
|
4
|
+
export * from './ReactionsButton';
|
|
5
|
+
export * from './RecordCallButton';
|
|
6
|
+
export * from './ScreenShareButton';
|
|
7
|
+
export * from './ToggleAudioButton';
|
|
8
|
+
export * from './ToggleCameraButton';
|
|
9
|
+
export * from './ToggleAudioOutputButton';
|
|
10
|
+
export * from './ToggleParticipantListButton';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useCall } from '@stream-io/video-react-bindings';
|
|
2
|
+
import { OwnCapability } from '@stream-io/video-client';
|
|
3
|
+
|
|
4
|
+
import { Restricted } from '../Moderation';
|
|
5
|
+
import { TextButton } from '../Button';
|
|
6
|
+
|
|
7
|
+
export const BlockedUserListing = ({ data }: { data: string[] }) => {
|
|
8
|
+
if (!data.length) return null;
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<>
|
|
12
|
+
<div className="str-video__participant-listing">
|
|
13
|
+
{data.map((userId) => (
|
|
14
|
+
<BlockedUserListingItem key={userId} userId={userId} />
|
|
15
|
+
))}
|
|
16
|
+
</div>
|
|
17
|
+
</>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const BlockedUserListingItem = ({ userId }: { userId: string }) => {
|
|
22
|
+
const call = useCall();
|
|
23
|
+
|
|
24
|
+
const unblockUserClickHandler = () => {
|
|
25
|
+
if (userId) call?.unblockUser(userId);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<div className="str-video__participant-listing-item">
|
|
30
|
+
<div className="str-video__participant-listing-item__display-name">
|
|
31
|
+
{userId}
|
|
32
|
+
</div>
|
|
33
|
+
<Restricted requiredGrants={[OwnCapability.BLOCK_USERS]}>
|
|
34
|
+
<TextButton onClick={unblockUserClickHandler}>Unblock</TextButton>
|
|
35
|
+
</Restricted>
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useParticipants } from '@stream-io/video-react-bindings';
|
|
2
|
+
|
|
3
|
+
export type CallParticipantListHeaderProps = {
|
|
4
|
+
/** Click event listener function to be invoked in order to dismiss / hide the CallParticipantsList from the UI */
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const CallParticipantListHeader = ({
|
|
9
|
+
onClose,
|
|
10
|
+
}: CallParticipantListHeaderProps) => {
|
|
11
|
+
const participants = useParticipants();
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div className="str-video__participant-list-header">
|
|
15
|
+
<div className="str-video__participant-list-header__title">
|
|
16
|
+
Participants{' '}
|
|
17
|
+
<span className="str-video__participant-list-header__title-count">
|
|
18
|
+
({participants.length})
|
|
19
|
+
</span>
|
|
20
|
+
</div>
|
|
21
|
+
<button
|
|
22
|
+
onClick={onClose}
|
|
23
|
+
className="str-video__participant-list-header__close-button"
|
|
24
|
+
>
|
|
25
|
+
<span className="str-video__participant-list-header__close-button--icon" />
|
|
26
|
+
</button>
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { StreamVideoParticipant } from '@stream-io/video-client';
|
|
3
|
+
import { CallParticipantListingItem } from './CallParticipantListingItem';
|
|
4
|
+
|
|
5
|
+
export type CallParticipantListingProps = {
|
|
6
|
+
/** Array of participant objects to be rendered */
|
|
7
|
+
data: StreamVideoParticipant[];
|
|
8
|
+
Header?: ComponentType;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const CallParticipantListing = ({
|
|
12
|
+
data,
|
|
13
|
+
}: CallParticipantListingProps) => (
|
|
14
|
+
<div className="str-video__participant-listing">
|
|
15
|
+
{data.map((participant) => (
|
|
16
|
+
<CallParticipantListingItem
|
|
17
|
+
key={participant.sessionId}
|
|
18
|
+
participant={participant}
|
|
19
|
+
/>
|
|
20
|
+
))}
|
|
21
|
+
</div>
|
|
22
|
+
);
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { ComponentProps, ComponentType, forwardRef } from 'react';
|
|
3
|
+
import { useCall, useConnectedUser } from '@stream-io/video-react-bindings';
|
|
4
|
+
import {
|
|
5
|
+
OwnCapability,
|
|
6
|
+
SfuModels,
|
|
7
|
+
StreamVideoParticipant,
|
|
8
|
+
} from '@stream-io/video-client';
|
|
9
|
+
import { IconButton } from '../Button';
|
|
10
|
+
import {
|
|
11
|
+
GenericMenu,
|
|
12
|
+
GenericMenuButtonItem,
|
|
13
|
+
MenuToggle,
|
|
14
|
+
ToggleMenuButtonProps,
|
|
15
|
+
} from '../Menu';
|
|
16
|
+
import { Restricted } from '../Moderation';
|
|
17
|
+
import { WithTooltip } from '../Tooltip';
|
|
18
|
+
import { Icon } from '../Icon';
|
|
19
|
+
|
|
20
|
+
type CallParticipantListingItemProps = {
|
|
21
|
+
/** Participant object be rendered */
|
|
22
|
+
participant: StreamVideoParticipant;
|
|
23
|
+
/** Custom component used to display participant's name */
|
|
24
|
+
DisplayName?: ComponentType<{ participant: StreamVideoParticipant }>;
|
|
25
|
+
};
|
|
26
|
+
export const CallParticipantListingItem = ({
|
|
27
|
+
participant,
|
|
28
|
+
DisplayName = DefaultDisplayName,
|
|
29
|
+
}: CallParticipantListingItemProps) => {
|
|
30
|
+
const isAudioOn = participant.publishedTracks.includes(
|
|
31
|
+
SfuModels.TrackType.AUDIO,
|
|
32
|
+
);
|
|
33
|
+
const isVideoOn = participant.publishedTracks.includes(
|
|
34
|
+
SfuModels.TrackType.VIDEO,
|
|
35
|
+
);
|
|
36
|
+
const isPinned = !!participant.pinnedAt;
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div className="str-video__participant-listing-item">
|
|
40
|
+
<DisplayName participant={participant} />
|
|
41
|
+
<div className="str-video__participant-listing-item__media-indicator-group">
|
|
42
|
+
<MediaIndicator
|
|
43
|
+
title={isAudioOn ? 'Microphone on' : 'Microphone off'}
|
|
44
|
+
className={clsx(
|
|
45
|
+
'str-video__participant-listing-item__icon',
|
|
46
|
+
`str-video__participant-listing-item__icon-${
|
|
47
|
+
isAudioOn ? 'mic' : 'mic-off'
|
|
48
|
+
}`,
|
|
49
|
+
)}
|
|
50
|
+
/>
|
|
51
|
+
<MediaIndicator
|
|
52
|
+
title={isVideoOn ? 'Camera on' : 'Camera off'}
|
|
53
|
+
className={clsx(
|
|
54
|
+
'str-video__participant-listing-item__icon',
|
|
55
|
+
`str-video__participant-listing-item__icon-${
|
|
56
|
+
isVideoOn ? 'camera' : 'camera-off'
|
|
57
|
+
}`,
|
|
58
|
+
)}
|
|
59
|
+
/>
|
|
60
|
+
{isPinned && (
|
|
61
|
+
<MediaIndicator
|
|
62
|
+
title={'Pinned'}
|
|
63
|
+
className={clsx(
|
|
64
|
+
'str-video__participant-listing-item__icon',
|
|
65
|
+
'str-video__participant-listing-item__icon-pinned',
|
|
66
|
+
)}
|
|
67
|
+
/>
|
|
68
|
+
)}
|
|
69
|
+
|
|
70
|
+
<MenuToggle placement="bottom-end" ToggleButton={ToggleButton}>
|
|
71
|
+
<ParticipantActionsContextMenu participant={participant} />
|
|
72
|
+
</MenuToggle>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const MediaIndicator = (props: ComponentProps<'div'>) => (
|
|
79
|
+
<WithTooltip {...props} />
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
type DisplayNameProps = {
|
|
83
|
+
/** Participant object that provides the data from which display name can be generated */
|
|
84
|
+
participant: StreamVideoParticipant;
|
|
85
|
+
};
|
|
86
|
+
// todo: implement display device flag
|
|
87
|
+
const DefaultDisplayName = ({ participant }: DisplayNameProps) => {
|
|
88
|
+
const connectedUser = useConnectedUser();
|
|
89
|
+
|
|
90
|
+
const meFlag = participant.userId === connectedUser?.id ? 'Me' : '';
|
|
91
|
+
const nameOrId = participant.name || participant.userId || 'Unknown';
|
|
92
|
+
let displayName;
|
|
93
|
+
if (!participant.name) {
|
|
94
|
+
displayName = meFlag || nameOrId || 'Unknown';
|
|
95
|
+
} else if (meFlag) {
|
|
96
|
+
displayName = `${nameOrId} (${meFlag})`;
|
|
97
|
+
} else {
|
|
98
|
+
displayName = nameOrId;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return (
|
|
102
|
+
<WithTooltip
|
|
103
|
+
className="str-video__participant-listing-item__display-name"
|
|
104
|
+
title={displayName}
|
|
105
|
+
>
|
|
106
|
+
{displayName}
|
|
107
|
+
</WithTooltip>
|
|
108
|
+
);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const ToggleButton = forwardRef<HTMLButtonElement, ToggleMenuButtonProps>(
|
|
112
|
+
(props, ref) => {
|
|
113
|
+
return <IconButton enabled={props.menuShown} icon="ellipsis" ref={ref} />;
|
|
114
|
+
},
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
export const ParticipantActionsContextMenu = ({
|
|
118
|
+
participant,
|
|
119
|
+
}: {
|
|
120
|
+
participant: StreamVideoParticipant;
|
|
121
|
+
}) => {
|
|
122
|
+
const activeCall = useCall();
|
|
123
|
+
|
|
124
|
+
const blockUser = () => {
|
|
125
|
+
activeCall?.blockUser(participant.userId);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
// FIXME: soft kicking does not work this way
|
|
129
|
+
// also needs to be session-based
|
|
130
|
+
// const kickUserClickHandler = () => {
|
|
131
|
+
// getCall()?.updateCallMembers({
|
|
132
|
+
// remove_members: [participant.userId],
|
|
133
|
+
// disconnectRemovedMembers: true,
|
|
134
|
+
// });
|
|
135
|
+
// };
|
|
136
|
+
|
|
137
|
+
const muteAudio = () => {
|
|
138
|
+
activeCall?.muteUser(participant.userId, 'audio');
|
|
139
|
+
};
|
|
140
|
+
const muteVideo = () => {
|
|
141
|
+
activeCall?.muteUser(participant.userId, 'video');
|
|
142
|
+
};
|
|
143
|
+
const muteScreenShare = () => {
|
|
144
|
+
activeCall?.muteUser(participant.userId, 'screenshare');
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const grantPermission = (permission: string) => () => {
|
|
148
|
+
activeCall?.updateUserPermissions({
|
|
149
|
+
user_id: participant.userId,
|
|
150
|
+
grant_permissions: [permission],
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
const revokePermission = (permission: string) => () => {
|
|
155
|
+
activeCall?.updateUserPermissions({
|
|
156
|
+
user_id: participant.userId,
|
|
157
|
+
revoke_permissions: [permission],
|
|
158
|
+
});
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
const toggleParticipantPinnedAt = () => {
|
|
162
|
+
activeCall?.setParticipantPinnedAt(
|
|
163
|
+
participant.sessionId,
|
|
164
|
+
participant.pinnedAt ? undefined : Date.now(),
|
|
165
|
+
);
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
return (
|
|
169
|
+
<GenericMenu>
|
|
170
|
+
<GenericMenuButtonItem onClick={toggleParticipantPinnedAt}>
|
|
171
|
+
<Icon icon="pin" />
|
|
172
|
+
{participant.pinnedAt ? 'Unpin' : 'Pin'}
|
|
173
|
+
</GenericMenuButtonItem>
|
|
174
|
+
<Restricted requiredGrants={[OwnCapability.BLOCK_USERS]}>
|
|
175
|
+
<GenericMenuButtonItem onClick={blockUser}>
|
|
176
|
+
<Icon icon="not-allowed" />
|
|
177
|
+
Block
|
|
178
|
+
</GenericMenuButtonItem>
|
|
179
|
+
</Restricted>
|
|
180
|
+
{/* <GenericMenuButtonItem disabled onClick={kickUserClickHandler}>
|
|
181
|
+
Kick
|
|
182
|
+
</GenericMenuButtonItem> */}
|
|
183
|
+
<Restricted requiredGrants={[OwnCapability.MUTE_USERS]}>
|
|
184
|
+
<GenericMenuButtonItem
|
|
185
|
+
disabled={
|
|
186
|
+
!participant.publishedTracks.includes(SfuModels.TrackType.VIDEO)
|
|
187
|
+
}
|
|
188
|
+
onClick={muteVideo}
|
|
189
|
+
>
|
|
190
|
+
<Icon icon="camera-off-outline" />
|
|
191
|
+
Turn off video
|
|
192
|
+
</GenericMenuButtonItem>
|
|
193
|
+
<GenericMenuButtonItem
|
|
194
|
+
disabled={
|
|
195
|
+
!participant.publishedTracks.includes(
|
|
196
|
+
SfuModels.TrackType.SCREEN_SHARE,
|
|
197
|
+
)
|
|
198
|
+
}
|
|
199
|
+
onClick={muteScreenShare}
|
|
200
|
+
>
|
|
201
|
+
<Icon icon="screen-share-off" />
|
|
202
|
+
Turn off screen share
|
|
203
|
+
</GenericMenuButtonItem>
|
|
204
|
+
<GenericMenuButtonItem
|
|
205
|
+
disabled={
|
|
206
|
+
!participant.publishedTracks.includes(SfuModels.TrackType.AUDIO)
|
|
207
|
+
}
|
|
208
|
+
onClick={muteAudio}
|
|
209
|
+
>
|
|
210
|
+
<Icon icon="no-audio" />
|
|
211
|
+
Mute audio
|
|
212
|
+
</GenericMenuButtonItem>
|
|
213
|
+
</Restricted>
|
|
214
|
+
<Restricted requiredGrants={[OwnCapability.UPDATE_CALL_PERMISSIONS]}>
|
|
215
|
+
<GenericMenuButtonItem
|
|
216
|
+
onClick={grantPermission(OwnCapability.SEND_AUDIO)}
|
|
217
|
+
>
|
|
218
|
+
Allow audio
|
|
219
|
+
</GenericMenuButtonItem>
|
|
220
|
+
<GenericMenuButtonItem
|
|
221
|
+
onClick={grantPermission(OwnCapability.SEND_VIDEO)}
|
|
222
|
+
>
|
|
223
|
+
Allow video
|
|
224
|
+
</GenericMenuButtonItem>
|
|
225
|
+
<GenericMenuButtonItem
|
|
226
|
+
onClick={grantPermission(OwnCapability.SCREENSHARE)}
|
|
227
|
+
>
|
|
228
|
+
Allow screen sharing
|
|
229
|
+
</GenericMenuButtonItem>
|
|
230
|
+
|
|
231
|
+
<GenericMenuButtonItem
|
|
232
|
+
onClick={revokePermission(OwnCapability.SEND_AUDIO)}
|
|
233
|
+
>
|
|
234
|
+
Disable audio
|
|
235
|
+
</GenericMenuButtonItem>
|
|
236
|
+
<GenericMenuButtonItem
|
|
237
|
+
onClick={revokePermission(OwnCapability.SEND_VIDEO)}
|
|
238
|
+
>
|
|
239
|
+
Disable video
|
|
240
|
+
</GenericMenuButtonItem>
|
|
241
|
+
<GenericMenuButtonItem
|
|
242
|
+
onClick={revokePermission(OwnCapability.SCREENSHARE)}
|
|
243
|
+
>
|
|
244
|
+
Disable screen sharing
|
|
245
|
+
</GenericMenuButtonItem>
|
|
246
|
+
</Restricted>
|
|
247
|
+
</GenericMenu>
|
|
248
|
+
);
|
|
249
|
+
};
|