@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,129 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ComponentProps,
|
|
3
|
+
ComponentPropsWithRef,
|
|
4
|
+
ComponentType,
|
|
5
|
+
ForwardedRef,
|
|
6
|
+
forwardRef,
|
|
7
|
+
MouseEventHandler,
|
|
8
|
+
useCallback,
|
|
9
|
+
useState,
|
|
10
|
+
} from 'react';
|
|
11
|
+
import clsx from 'clsx';
|
|
12
|
+
import { Placement } from '@floating-ui/react';
|
|
13
|
+
|
|
14
|
+
import { Tooltip } from '../Tooltip';
|
|
15
|
+
|
|
16
|
+
type CopyToClipboardButtonProps = ComponentProps<'button'> & {
|
|
17
|
+
/** Custom button component implementation. Will be rendered instead of native button element */
|
|
18
|
+
Button?: ComponentType<
|
|
19
|
+
ComponentPropsWithRef<'button'> & { ref: ForwardedRef<HTMLButtonElement> }
|
|
20
|
+
>;
|
|
21
|
+
/** Custom function to override the logic of generating the call invitation link */
|
|
22
|
+
copyValue: (() => string) | string;
|
|
23
|
+
/** Callback invoked if the copy-to-clipboard action fails */
|
|
24
|
+
onError?: (button: HTMLButtonElement, e: Error) => void;
|
|
25
|
+
/** Callback invoked if the copy-to-clipboard action succeeds */
|
|
26
|
+
onSuccess?: (button: HTMLButtonElement) => void;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const CopyToClipboardButton = forwardRef<
|
|
30
|
+
HTMLButtonElement,
|
|
31
|
+
CopyToClipboardButtonProps
|
|
32
|
+
>(
|
|
33
|
+
(
|
|
34
|
+
{ Button, className, copyValue, onClick, onError, onSuccess, ...restProps },
|
|
35
|
+
ref,
|
|
36
|
+
) => {
|
|
37
|
+
const handleClick: MouseEventHandler<HTMLButtonElement> = useCallback(
|
|
38
|
+
async (event) => {
|
|
39
|
+
if (onClick) onClick(event);
|
|
40
|
+
const value = typeof copyValue === 'function' ? copyValue() : copyValue;
|
|
41
|
+
try {
|
|
42
|
+
await navigator?.clipboard.writeText(value);
|
|
43
|
+
onSuccess?.(event.target as HTMLButtonElement);
|
|
44
|
+
} catch (error) {
|
|
45
|
+
onError?.(event.target as HTMLButtonElement, error as Error);
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
[copyValue, onClick, onError, onSuccess],
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const props = {
|
|
52
|
+
...restProps,
|
|
53
|
+
ref: ref,
|
|
54
|
+
className: clsx('str-video__copy-to-clipboard-button', className),
|
|
55
|
+
onClick: handleClick,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
return Button ? <Button {...props} /> : <button {...props} />;
|
|
59
|
+
},
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
type CopyToClipboardButtonWithPopupProps = Exclude<
|
|
63
|
+
CopyToClipboardButtonProps,
|
|
64
|
+
'onError' | 'onSuccess'
|
|
65
|
+
> & {
|
|
66
|
+
dismissAfterMs?: number;
|
|
67
|
+
/** String displayed when copy-to-clipboard action fails */
|
|
68
|
+
onErrorMessage?: string;
|
|
69
|
+
/** String displayed when copy-to-clipboard succeeds fails */
|
|
70
|
+
onSuccessMessage?: string;
|
|
71
|
+
/** Class applied to the popup container element */
|
|
72
|
+
popupClassName?: string;
|
|
73
|
+
// todo: We should replace Placement for internal type
|
|
74
|
+
popupPlacement?: Placement;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const CopyToClipboardButtonWithPopup = ({
|
|
78
|
+
dismissAfterMs = 1500,
|
|
79
|
+
onErrorMessage = 'Failed to copy',
|
|
80
|
+
onSuccessMessage = 'Copied to clipboard',
|
|
81
|
+
popupClassName,
|
|
82
|
+
popupPlacement,
|
|
83
|
+
...restProps
|
|
84
|
+
}: CopyToClipboardButtonWithPopupProps) => {
|
|
85
|
+
const [tooltipText, setTooltipText] = useState('');
|
|
86
|
+
const [tooltipAnchor, setTooltipAnchor] = useState<HTMLButtonElement | null>(
|
|
87
|
+
null,
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
const setTemporaryPopup = useCallback(
|
|
91
|
+
(popupText: string) => {
|
|
92
|
+
setTooltipText(popupText);
|
|
93
|
+
setTimeout(() => setTooltipText(''), dismissAfterMs);
|
|
94
|
+
},
|
|
95
|
+
[dismissAfterMs],
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
const onSuccess = useCallback(
|
|
99
|
+
() => setTemporaryPopup(onSuccessMessage),
|
|
100
|
+
[onSuccessMessage, setTemporaryPopup],
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
const onError = useCallback(
|
|
104
|
+
() => setTemporaryPopup(onErrorMessage),
|
|
105
|
+
[onErrorMessage, setTemporaryPopup],
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<>
|
|
110
|
+
<Tooltip
|
|
111
|
+
tooltipClassName={clsx(
|
|
112
|
+
'str-video__copy-to-clipboard-button__popup',
|
|
113
|
+
popupClassName,
|
|
114
|
+
)}
|
|
115
|
+
tooltipPlacement={popupPlacement}
|
|
116
|
+
referenceElement={tooltipAnchor}
|
|
117
|
+
visible={!!tooltipText}
|
|
118
|
+
>
|
|
119
|
+
{tooltipText}
|
|
120
|
+
</Tooltip>
|
|
121
|
+
<CopyToClipboardButton
|
|
122
|
+
{...restProps}
|
|
123
|
+
onError={onError}
|
|
124
|
+
onSuccess={onSuccess}
|
|
125
|
+
ref={setTooltipAnchor}
|
|
126
|
+
/>
|
|
127
|
+
</>
|
|
128
|
+
);
|
|
129
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ComponentProps, ForwardedRef, forwardRef } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
|
|
4
|
+
import { Icon, IconProps } from '../Icon';
|
|
5
|
+
|
|
6
|
+
export type ButtonWithIconProps = {
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
variant?: string;
|
|
9
|
+
} & ComponentProps<'button'> &
|
|
10
|
+
IconProps;
|
|
11
|
+
|
|
12
|
+
export const IconButton = forwardRef(
|
|
13
|
+
(props: ButtonWithIconProps, ref: ForwardedRef<HTMLButtonElement>) => {
|
|
14
|
+
const { icon, enabled, variant, onClick, className, ...rest } = props;
|
|
15
|
+
return (
|
|
16
|
+
<button
|
|
17
|
+
className={clsx('str-video__call-controls__button', className, {
|
|
18
|
+
[`str-video__call-controls__button--variant-${variant}`]: variant,
|
|
19
|
+
'str-video__call-controls__button--enabled': enabled,
|
|
20
|
+
})}
|
|
21
|
+
onClick={(e) => {
|
|
22
|
+
e.preventDefault();
|
|
23
|
+
onClick?.(e);
|
|
24
|
+
}}
|
|
25
|
+
ref={ref}
|
|
26
|
+
{...rest}
|
|
27
|
+
>
|
|
28
|
+
<Icon icon={icon} />
|
|
29
|
+
</button>
|
|
30
|
+
);
|
|
31
|
+
},
|
|
32
|
+
);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
|
|
3
|
+
export const TextButton = ({
|
|
4
|
+
children,
|
|
5
|
+
...rest
|
|
6
|
+
}: Omit<ComponentProps<'button'>, 'ref' | 'className'>) => {
|
|
7
|
+
return (
|
|
8
|
+
<button {...rest} className="str-video__text-button">
|
|
9
|
+
{children}
|
|
10
|
+
</button>
|
|
11
|
+
);
|
|
12
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Call } from '@stream-io/video-client';
|
|
2
|
+
import {
|
|
3
|
+
CallStatsButton,
|
|
4
|
+
CancelCallButton,
|
|
5
|
+
RecordCallButton,
|
|
6
|
+
ScreenShareButton,
|
|
7
|
+
ToggleAudioPublishingButton,
|
|
8
|
+
ToggleCameraPublishingButton,
|
|
9
|
+
} from './index';
|
|
10
|
+
import { SpeakingWhileMutedNotification } from '../Notification';
|
|
11
|
+
|
|
12
|
+
export type CallControlsProps = {
|
|
13
|
+
call: Call;
|
|
14
|
+
onLeave?: () => void;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const CallControls = (props: CallControlsProps) => {
|
|
18
|
+
const { call, onLeave } = props;
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<div className="str-video__call-controls">
|
|
22
|
+
<RecordCallButton call={call} />
|
|
23
|
+
<CallStatsButton />
|
|
24
|
+
<ScreenShareButton call={call} />
|
|
25
|
+
<SpeakingWhileMutedNotification>
|
|
26
|
+
<ToggleAudioPublishingButton />
|
|
27
|
+
</SpeakingWhileMutedNotification>
|
|
28
|
+
<ToggleCameraPublishingButton />
|
|
29
|
+
<CancelCallButton call={call} onLeave={onLeave} />
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
|
|
3
|
+
import { CallStats } from '../StreamCall/CallStats';
|
|
4
|
+
import { CompositeButton, IconButton } from '../Button/';
|
|
5
|
+
import { MenuToggle, ToggleMenuButtonProps } from '../Menu';
|
|
6
|
+
|
|
7
|
+
type CallStatsButtonProps = {
|
|
8
|
+
caption?: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const CallStatsButton = ({
|
|
12
|
+
caption = 'Stats',
|
|
13
|
+
}: CallStatsButtonProps) => {
|
|
14
|
+
return (
|
|
15
|
+
<MenuToggle placement="top-end" ToggleButton={ToggleMenuButton}>
|
|
16
|
+
<CallStats />
|
|
17
|
+
</MenuToggle>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const ToggleMenuButton = forwardRef<
|
|
22
|
+
HTMLDivElement,
|
|
23
|
+
ToggleMenuButtonProps<HTMLDivElement>
|
|
24
|
+
>(({ menuShown }, ref) => (
|
|
25
|
+
<CompositeButton ref={ref} active={menuShown} caption={'Stats'}>
|
|
26
|
+
<IconButton icon="stats" title="Statistics" />
|
|
27
|
+
</CompositeButton>
|
|
28
|
+
));
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { MouseEventHandler, useCallback } from 'react';
|
|
2
|
+
import { Call } from '@stream-io/video-client';
|
|
3
|
+
import { IconButton } from '../Button/';
|
|
4
|
+
|
|
5
|
+
export type CancelCallButtonProps = {
|
|
6
|
+
call: Call;
|
|
7
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
8
|
+
onLeave?: () => void;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const CancelCallButton = ({
|
|
12
|
+
call,
|
|
13
|
+
onClick,
|
|
14
|
+
onLeave,
|
|
15
|
+
}: CancelCallButtonProps) => {
|
|
16
|
+
const handleClick: MouseEventHandler<HTMLButtonElement> = useCallback(
|
|
17
|
+
async (e) => {
|
|
18
|
+
if (onClick) {
|
|
19
|
+
onClick(e);
|
|
20
|
+
} else if (call) {
|
|
21
|
+
await call.leave();
|
|
22
|
+
onLeave?.();
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
[onClick, onLeave, call],
|
|
26
|
+
);
|
|
27
|
+
return <IconButton icon="call-end" variant="danger" onClick={handleClick} />;
|
|
28
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { OwnCapability, StreamReaction } from '@stream-io/video-client';
|
|
2
|
+
import { useCall } from '@stream-io/video-react-bindings';
|
|
3
|
+
|
|
4
|
+
import { CompositeButton, IconButton } from '../Button';
|
|
5
|
+
import { defaultEmojiReactions } from '../Reaction';
|
|
6
|
+
import { Restricted } from '../Moderation';
|
|
7
|
+
|
|
8
|
+
export const defaultReactions: StreamReaction[] = [
|
|
9
|
+
{
|
|
10
|
+
type: 'reaction',
|
|
11
|
+
emoji_code: ':like:',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
// TODO OL: use `prompt` type?
|
|
15
|
+
type: 'raised-hand',
|
|
16
|
+
emoji_code: ':raise-hand:',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
type: 'reaction',
|
|
20
|
+
emoji_code: ':fireworks:',
|
|
21
|
+
},
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
export interface ReactionsButtonProps {
|
|
25
|
+
reactions?: StreamReaction[];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const ReactionsButton = ({
|
|
29
|
+
reactions = defaultReactions,
|
|
30
|
+
}: ReactionsButtonProps) => {
|
|
31
|
+
return (
|
|
32
|
+
<Restricted requiredGrants={[OwnCapability.CREATE_REACTION]}>
|
|
33
|
+
<CompositeButton
|
|
34
|
+
active={false}
|
|
35
|
+
caption="Reactions"
|
|
36
|
+
menuPlacement="top-start"
|
|
37
|
+
Menu={<DefaultReactionsMenu reactions={reactions} />}
|
|
38
|
+
>
|
|
39
|
+
<IconButton
|
|
40
|
+
icon="reactions"
|
|
41
|
+
title="Reactions"
|
|
42
|
+
onClick={() => {
|
|
43
|
+
console.log('Reactions');
|
|
44
|
+
}}
|
|
45
|
+
/>
|
|
46
|
+
</CompositeButton>
|
|
47
|
+
</Restricted>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export interface DefaultReactionsMenuProps {
|
|
52
|
+
reactions: StreamReaction[];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export const DefaultReactionsMenu = ({
|
|
56
|
+
reactions,
|
|
57
|
+
}: DefaultReactionsMenuProps) => {
|
|
58
|
+
const call = useCall();
|
|
59
|
+
return (
|
|
60
|
+
<div className="str-video__reactions-menu">
|
|
61
|
+
{reactions.map((reaction) => (
|
|
62
|
+
<button
|
|
63
|
+
key={reaction.emoji_code}
|
|
64
|
+
type="button"
|
|
65
|
+
className="str-video__reactions-menu__button"
|
|
66
|
+
onClick={() => {
|
|
67
|
+
call?.sendReaction(reaction);
|
|
68
|
+
}}
|
|
69
|
+
>
|
|
70
|
+
{reaction.emoji_code && defaultEmojiReactions[reaction.emoji_code]}
|
|
71
|
+
</button>
|
|
72
|
+
))}
|
|
73
|
+
</div>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import { Call, OwnCapability } from '@stream-io/video-client';
|
|
3
|
+
import { useIsCallRecordingInProgress } from '@stream-io/video-react-bindings';
|
|
4
|
+
import { CompositeButton, IconButton } from '../Button/';
|
|
5
|
+
import { LoadingIndicator } from '../LoadingIndicator';
|
|
6
|
+
import { Restricted } from '../Moderation';
|
|
7
|
+
|
|
8
|
+
export type RecordCallButtonProps = {
|
|
9
|
+
call: Call;
|
|
10
|
+
caption?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const RecordCallButton = ({
|
|
14
|
+
call,
|
|
15
|
+
caption = 'Record',
|
|
16
|
+
}: RecordCallButtonProps) => {
|
|
17
|
+
const isCallRecordingInProgress = useIsCallRecordingInProgress();
|
|
18
|
+
const [isAwaitingResponse, setIsAwaitingResponse] = useState(false);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
// we wait until call.recording_started/stopped event to flips the
|
|
21
|
+
// `isCallRecordingInProgress` state variable.
|
|
22
|
+
// Once the flip happens, we remove the loading indicator
|
|
23
|
+
setIsAwaitingResponse((isAwaiting) => {
|
|
24
|
+
if (isAwaiting) return false;
|
|
25
|
+
return isAwaiting;
|
|
26
|
+
});
|
|
27
|
+
}, [isCallRecordingInProgress]);
|
|
28
|
+
|
|
29
|
+
const toggleRecording = useCallback(async () => {
|
|
30
|
+
try {
|
|
31
|
+
setIsAwaitingResponse(true);
|
|
32
|
+
if (isCallRecordingInProgress) {
|
|
33
|
+
await call.stopRecording();
|
|
34
|
+
} else {
|
|
35
|
+
await call.startRecording();
|
|
36
|
+
}
|
|
37
|
+
} catch (e) {
|
|
38
|
+
console.error(`Failed start recording`, e);
|
|
39
|
+
}
|
|
40
|
+
}, [call, isCallRecordingInProgress]);
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<Restricted
|
|
44
|
+
requiredGrants={[
|
|
45
|
+
OwnCapability.START_RECORD_CALL,
|
|
46
|
+
OwnCapability.STOP_RECORD_CALL,
|
|
47
|
+
]}
|
|
48
|
+
>
|
|
49
|
+
<CompositeButton active={isCallRecordingInProgress} caption={caption}>
|
|
50
|
+
{isAwaitingResponse ? (
|
|
51
|
+
<LoadingIndicator
|
|
52
|
+
tooltip={
|
|
53
|
+
isCallRecordingInProgress
|
|
54
|
+
? 'Waiting for recording to stop... '
|
|
55
|
+
: 'Waiting for recording to start...'
|
|
56
|
+
}
|
|
57
|
+
/>
|
|
58
|
+
) : (
|
|
59
|
+
<IconButton
|
|
60
|
+
icon={isCallRecordingInProgress ? 'recording-on' : 'recording-off'}
|
|
61
|
+
title="Record call"
|
|
62
|
+
onClick={toggleRecording}
|
|
63
|
+
/>
|
|
64
|
+
)}
|
|
65
|
+
</CompositeButton>
|
|
66
|
+
</Restricted>
|
|
67
|
+
);
|
|
68
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Call,
|
|
4
|
+
getScreenShareStream,
|
|
5
|
+
OwnCapability,
|
|
6
|
+
SfuModels,
|
|
7
|
+
} from '@stream-io/video-client';
|
|
8
|
+
import {
|
|
9
|
+
useHasOngoingScreenShare,
|
|
10
|
+
useHasPermissions,
|
|
11
|
+
useLocalParticipant,
|
|
12
|
+
} from '@stream-io/video-react-bindings';
|
|
13
|
+
import { CompositeButton, IconButton } from '../Button/';
|
|
14
|
+
import { PermissionNotification } from '../Notification';
|
|
15
|
+
import { Restricted } from '../Moderation';
|
|
16
|
+
|
|
17
|
+
export type ScreenShareButtonProps = {
|
|
18
|
+
call: Call;
|
|
19
|
+
caption?: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const ScreenShareButton = ({
|
|
23
|
+
call,
|
|
24
|
+
caption = 'Screen Share',
|
|
25
|
+
}: ScreenShareButtonProps) => {
|
|
26
|
+
const localParticipant = useLocalParticipant();
|
|
27
|
+
const isSomeoneScreenSharing = useHasOngoingScreenShare();
|
|
28
|
+
const isScreenSharing = localParticipant?.publishedTracks.includes(
|
|
29
|
+
SfuModels.TrackType.SCREEN_SHARE,
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const [isAwaitingApproval, setIsAwaitingApproval] = useState(false);
|
|
33
|
+
const hasPermission = useHasPermissions(OwnCapability.SCREENSHARE);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (hasPermission) {
|
|
36
|
+
setIsAwaitingApproval(false);
|
|
37
|
+
}
|
|
38
|
+
}, [hasPermission]);
|
|
39
|
+
return (
|
|
40
|
+
<Restricted requiredGrants={[OwnCapability.SCREENSHARE]}>
|
|
41
|
+
<PermissionNotification
|
|
42
|
+
permission={OwnCapability.SCREENSHARE}
|
|
43
|
+
isAwaitingApproval={isAwaitingApproval}
|
|
44
|
+
messageApproved="You can now share your screen."
|
|
45
|
+
messageAwaitingApproval="Awaiting for an approval to share screen."
|
|
46
|
+
messageRevoked="You can no longer share your screen."
|
|
47
|
+
>
|
|
48
|
+
<CompositeButton active={isSomeoneScreenSharing} caption={caption}>
|
|
49
|
+
<IconButton
|
|
50
|
+
icon={isScreenSharing ? 'screen-share-on' : 'screen-share-off'}
|
|
51
|
+
title="Share screen"
|
|
52
|
+
disabled={!isScreenSharing && isSomeoneScreenSharing}
|
|
53
|
+
onClick={async () => {
|
|
54
|
+
if (
|
|
55
|
+
!hasPermission &&
|
|
56
|
+
call.permissionsContext.canRequest(OwnCapability.SCREENSHARE)
|
|
57
|
+
) {
|
|
58
|
+
setIsAwaitingApproval(true);
|
|
59
|
+
await call
|
|
60
|
+
.requestPermissions({
|
|
61
|
+
permissions: [OwnCapability.SCREENSHARE],
|
|
62
|
+
})
|
|
63
|
+
.catch((reason) => {
|
|
64
|
+
console.log('RequestPermissions failed', reason);
|
|
65
|
+
});
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (!isScreenSharing && hasPermission) {
|
|
70
|
+
const stream = await getScreenShareStream().catch((e) => {
|
|
71
|
+
console.log(`Can't share screen: ${e}`);
|
|
72
|
+
});
|
|
73
|
+
if (stream) {
|
|
74
|
+
await call.publishScreenShareStream(stream);
|
|
75
|
+
}
|
|
76
|
+
} else {
|
|
77
|
+
await call.stopPublish(SfuModels.TrackType.SCREEN_SHARE);
|
|
78
|
+
}
|
|
79
|
+
}}
|
|
80
|
+
/>
|
|
81
|
+
</CompositeButton>
|
|
82
|
+
</PermissionNotification>
|
|
83
|
+
</Restricted>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import { OwnCapability, SfuModels } from '@stream-io/video-client';
|
|
3
|
+
import {
|
|
4
|
+
useCall,
|
|
5
|
+
useHasPermissions,
|
|
6
|
+
useLocalParticipant,
|
|
7
|
+
useI18n,
|
|
8
|
+
} from '@stream-io/video-react-bindings';
|
|
9
|
+
|
|
10
|
+
import { useMediaDevices } from '../../core/contexts';
|
|
11
|
+
import { DeviceSelectorAudioInput } from '../DeviceSettings';
|
|
12
|
+
import { CompositeButton, IconButton } from '../Button';
|
|
13
|
+
import { PermissionNotification } from '../Notification';
|
|
14
|
+
import { Restricted } from '../Moderation';
|
|
15
|
+
|
|
16
|
+
export type ToggleAudioPreviewButtonProps = { caption?: string };
|
|
17
|
+
|
|
18
|
+
export const ToggleAudioPreviewButton = ({
|
|
19
|
+
caption,
|
|
20
|
+
}: ToggleAudioPreviewButtonProps) => {
|
|
21
|
+
const { initialAudioEnabled, toggleAudioMuteState } = useMediaDevices();
|
|
22
|
+
const { t } = useI18n();
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<CompositeButton
|
|
26
|
+
Menu={DeviceSelectorAudioInput}
|
|
27
|
+
active={!initialAudioEnabled}
|
|
28
|
+
caption={caption || t('Mic')}
|
|
29
|
+
>
|
|
30
|
+
<IconButton
|
|
31
|
+
icon={initialAudioEnabled ? 'mic' : 'mic-off'}
|
|
32
|
+
onClick={toggleAudioMuteState}
|
|
33
|
+
/>
|
|
34
|
+
</CompositeButton>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type ToggleAudioPublishingButtonProps = {
|
|
39
|
+
caption?: string;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const ToggleAudioPublishingButton = ({
|
|
43
|
+
caption,
|
|
44
|
+
}: ToggleAudioPublishingButtonProps) => {
|
|
45
|
+
const { publishAudioStream, stopPublishingAudio } = useMediaDevices();
|
|
46
|
+
const localParticipant = useLocalParticipant();
|
|
47
|
+
const { t } = useI18n();
|
|
48
|
+
const isAudioMute = !localParticipant?.publishedTracks.includes(
|
|
49
|
+
SfuModels.TrackType.AUDIO,
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
const call = useCall();
|
|
53
|
+
const hasPermission = useHasPermissions(OwnCapability.SEND_AUDIO);
|
|
54
|
+
const [isAwaitingApproval, setIsAwaitingApproval] = useState(false);
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (hasPermission) {
|
|
57
|
+
setIsAwaitingApproval(false);
|
|
58
|
+
}
|
|
59
|
+
}, [hasPermission]);
|
|
60
|
+
|
|
61
|
+
const handleClick = useCallback(async () => {
|
|
62
|
+
if (
|
|
63
|
+
!hasPermission &&
|
|
64
|
+
call &&
|
|
65
|
+
call.permissionsContext.canRequest(OwnCapability.SEND_AUDIO)
|
|
66
|
+
) {
|
|
67
|
+
setIsAwaitingApproval(true);
|
|
68
|
+
await call
|
|
69
|
+
.requestPermissions({
|
|
70
|
+
permissions: [OwnCapability.SEND_AUDIO],
|
|
71
|
+
})
|
|
72
|
+
.catch((reason) => {
|
|
73
|
+
console.log('RequestPermissions failed', reason);
|
|
74
|
+
});
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (isAudioMute && hasPermission) {
|
|
78
|
+
await publishAudioStream();
|
|
79
|
+
} else {
|
|
80
|
+
stopPublishingAudio();
|
|
81
|
+
}
|
|
82
|
+
}, [
|
|
83
|
+
call,
|
|
84
|
+
hasPermission,
|
|
85
|
+
isAudioMute,
|
|
86
|
+
publishAudioStream,
|
|
87
|
+
stopPublishingAudio,
|
|
88
|
+
]);
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<Restricted requiredGrants={[OwnCapability.SEND_AUDIO]}>
|
|
92
|
+
<PermissionNotification
|
|
93
|
+
permission={OwnCapability.SEND_AUDIO}
|
|
94
|
+
isAwaitingApproval={isAwaitingApproval}
|
|
95
|
+
messageApproved="You can now speak."
|
|
96
|
+
messageAwaitingApproval="Awaiting for an approval to speak."
|
|
97
|
+
messageRevoked="You can no longer speak."
|
|
98
|
+
>
|
|
99
|
+
<CompositeButton
|
|
100
|
+
Menu={DeviceSelectorAudioInput}
|
|
101
|
+
active={isAudioMute}
|
|
102
|
+
caption={caption || t('Mic')}
|
|
103
|
+
>
|
|
104
|
+
<IconButton
|
|
105
|
+
icon={isAudioMute ? 'mic-off' : 'mic'}
|
|
106
|
+
onClick={handleClick}
|
|
107
|
+
/>
|
|
108
|
+
</CompositeButton>
|
|
109
|
+
</PermissionNotification>
|
|
110
|
+
</Restricted>
|
|
111
|
+
);
|
|
112
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CompositeButton, IconButton } from '../Button';
|
|
2
|
+
import { DeviceSelectorAudioOutput } from '../DeviceSettings';
|
|
3
|
+
import { useI18n } from '@stream-io/video-react-bindings';
|
|
4
|
+
|
|
5
|
+
export type ToggleAudioOutputButtonProps = { caption?: string };
|
|
6
|
+
|
|
7
|
+
export const ToggleAudioOutputButton = ({
|
|
8
|
+
caption,
|
|
9
|
+
}: ToggleAudioOutputButtonProps) => {
|
|
10
|
+
const { t } = useI18n();
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<CompositeButton
|
|
14
|
+
Menu={DeviceSelectorAudioOutput}
|
|
15
|
+
active
|
|
16
|
+
caption={caption || t('Speakers')}
|
|
17
|
+
>
|
|
18
|
+
<IconButton icon="speaker" />
|
|
19
|
+
</CompositeButton>
|
|
20
|
+
);
|
|
21
|
+
};
|