@stream-io/video-react-sdk 1.31.8 → 1.32.1
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 +22 -0
- package/dist/index.cjs.js +25 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +25 -7
- package/dist/index.es.js.map +1 -1
- package/dist/src/components/Notification/MicCaptureErrorNotification.d.ts +10 -0
- package/dist/src/components/Notification/index.d.ts +1 -0
- package/package.json +3 -3
- package/src/components/CallControls/CallControls.tsx +9 -4
- package/src/components/Notification/MicCaptureErrorNotification.tsx +43 -0
- package/src/components/Notification/Notification.tsx +1 -1
- package/src/components/Notification/index.ts +1 -0
- package/src/core/components/CallLayout/LivestreamLayout.tsx +9 -7
package/dist/index.es.js
CHANGED
|
@@ -1104,7 +1104,7 @@ const Notification = (props) => {
|
|
|
1104
1104
|
}, visibilityTimeout);
|
|
1105
1105
|
return () => clearTimeout(timeout);
|
|
1106
1106
|
}, [isVisible, resetIsVisible, visibilityTimeout]);
|
|
1107
|
-
return (jsxs("div", { ref: refs.setReference, children: [isVisible && (jsxs("div", { className: clsx('str-video__notification', className), ref: refs.setFloating, style: {
|
|
1107
|
+
return (jsxs("div", { className: "str-video__notification-wrapper", ref: refs.setReference, children: [isVisible && (jsxs("div", { className: clsx('str-video__notification', className), ref: refs.setFloating, style: {
|
|
1108
1108
|
position: strategy,
|
|
1109
1109
|
top: y ?? 0,
|
|
1110
1110
|
left: x ?? 0,
|
|
@@ -1161,6 +1161,22 @@ const RecordingInProgressNotification = ({ children, text, }) => {
|
|
|
1161
1161
|
return (jsx(Notification, { message: message, iconClassName: "str-video__icon str-video__icon--recording-on", isVisible: isVisible, placement: "top-start", close: () => setVisible(false), children: children }));
|
|
1162
1162
|
};
|
|
1163
1163
|
|
|
1164
|
+
const MicCaptureErrorNotification = ({ children, text, placement, }) => {
|
|
1165
|
+
const call = useCall();
|
|
1166
|
+
const { t } = useI18n();
|
|
1167
|
+
const [isVisible, setIsVisible] = useState(false);
|
|
1168
|
+
useEffect(() => {
|
|
1169
|
+
if (!call)
|
|
1170
|
+
return;
|
|
1171
|
+
return call.on('mic.capture_report', (event) => {
|
|
1172
|
+
setIsVisible(!event.capturesAudio);
|
|
1173
|
+
});
|
|
1174
|
+
}, [call]);
|
|
1175
|
+
const message = text ??
|
|
1176
|
+
t('Your microphone is not capturing audio. Please check your setup.');
|
|
1177
|
+
return (jsx(Notification, { message: message, isVisible: isVisible, placement: placement, close: () => setIsVisible(false), children: children }));
|
|
1178
|
+
};
|
|
1179
|
+
|
|
1164
1180
|
const LoadingIndicator = ({ className, type = 'spinner', text, tooltip, }) => {
|
|
1165
1181
|
return (jsxs("div", { className: clsx('str-video__loading-indicator', className), title: tooltip, children: [jsx("div", { className: clsx('str-video__loading-indicator__icon', type) }), text && jsx("p", { className: "str-video__loading-indicator-text", children: text })] }));
|
|
1166
1182
|
};
|
|
@@ -1510,7 +1526,7 @@ const SpeakerTest = (props) => {
|
|
|
1510
1526
|
const audioElementRef = useRef(null);
|
|
1511
1527
|
const [isPlaying, setIsPlaying] = useState(false);
|
|
1512
1528
|
const { t } = useI18n();
|
|
1513
|
-
const { audioUrl = `https://unpkg.com/${"@stream-io/video-react-sdk"}@${"1.
|
|
1529
|
+
const { audioUrl = `https://unpkg.com/${"@stream-io/video-react-sdk"}@${"1.32.1"}/assets/piano.mp3`, } = props;
|
|
1514
1530
|
// Update audio output device when selection changes
|
|
1515
1531
|
useEffect(() => {
|
|
1516
1532
|
const audio = audioElementRef.current;
|
|
@@ -1727,7 +1743,7 @@ const CancelCallButton = ({ disabled, caption, onClick, onLeave, }) => {
|
|
|
1727
1743
|
return (jsx(IconButton, { disabled: disabled, icon: "call-end", variant: "danger", title: caption ?? t('Leave call'), "data-testid": "cancel-call-button", onClick: handleClick }));
|
|
1728
1744
|
};
|
|
1729
1745
|
|
|
1730
|
-
const CallControls = ({ onLeave }) => (jsxs("div", { className: "str-video__call-controls", children: [jsx(Restricted, { requiredGrants: [OwnCapability.SEND_AUDIO], children: jsx(SpeakingWhileMutedNotification, { children: jsx(ToggleAudioPublishingButton, {}) }) }), jsx(Restricted, { requiredGrants: [OwnCapability.SEND_VIDEO], children: jsx(ToggleVideoPublishingButton, {}) }), jsx(Restricted, { requiredGrants: [OwnCapability.CREATE_REACTION], children: jsx(ReactionsButton, {}) }), jsx(Restricted, { requiredGrants: [OwnCapability.SCREENSHARE], children: jsx(ScreenShareButton, {}) }), jsx(Restricted, { requiredGrants: [
|
|
1746
|
+
const CallControls = ({ onLeave }) => (jsxs("div", { className: "str-video__call-controls", children: [jsx(Restricted, { requiredGrants: [OwnCapability.SEND_AUDIO], children: jsx(MicCaptureErrorNotification, { children: jsx(SpeakingWhileMutedNotification, { children: jsx(ToggleAudioPublishingButton, {}) }) }) }), jsx(Restricted, { requiredGrants: [OwnCapability.SEND_VIDEO], children: jsx(ToggleVideoPublishingButton, {}) }), jsx(Restricted, { requiredGrants: [OwnCapability.CREATE_REACTION], children: jsx(ReactionsButton, {}) }), jsx(Restricted, { requiredGrants: [OwnCapability.SCREENSHARE], children: jsx(ScreenShareButton, {}) }), jsx(Restricted, { requiredGrants: [
|
|
1731
1747
|
OwnCapability.START_RECORD_CALL,
|
|
1732
1748
|
OwnCapability.STOP_RECORD_CALL,
|
|
1733
1749
|
], children: jsx(RecordCallButton, {}) }), jsx(CancelCallButton, { onLeave: onLeave })] }));
|
|
@@ -2837,7 +2853,7 @@ const ParticipantOverlay = (props) => {
|
|
|
2837
2853
|
showLiveBadge ||
|
|
2838
2854
|
showMuteButton ||
|
|
2839
2855
|
showSpeakerName;
|
|
2840
|
-
const { participant } = useParticipantViewContext();
|
|
2856
|
+
const { participant, participantViewElement } = useParticipantViewContext();
|
|
2841
2857
|
const { useParticipantCount, useSpeakerState } = useCallStateHooks();
|
|
2842
2858
|
const participantCount = useParticipantCount();
|
|
2843
2859
|
const duration = useUpdateCallDuration();
|
|
@@ -2848,7 +2864,9 @@ const ParticipantOverlay = (props) => {
|
|
|
2848
2864
|
return (jsx("div", { className: "str-video__livestream-layout__overlay", children: overlayBarVisible && (jsxs("div", { className: "str-video__livestream-layout__overlay__bar", children: [showLiveBadge && (jsx("span", { className: "str-video__livestream-layout__live-badge", children: t('Live') })), showParticipantCount && (jsx("span", { className: "str-video__livestream-layout__viewers-count", children: humanizeParticipantCount
|
|
2849
2865
|
? humanize(participantCount)
|
|
2850
2866
|
: participantCount })), showSpeakerName && (jsx("span", { className: "str-video__livestream-layout__speaker-name", title: participant.name || participant.userId || '', children: participant.name || participant.userId || '' })), showDuration && (jsx("span", { className: "str-video__livestream-layout__duration", children: formatDuration(duration) })), showMuteButton && (jsx("span", { className: clsx('str-video__livestream-layout__mute-button', isSpeakerMuted &&
|
|
2851
|
-
'str-video__livestream-layout__mute-button--muted'), onClick: () => speaker.setVolume(isSpeakerMuted ? 1 : 0) })), enableFullScreen &&
|
|
2867
|
+
'str-video__livestream-layout__mute-button--muted'), onClick: () => speaker.setVolume(isSpeakerMuted ? 1 : 0) })), enableFullScreen &&
|
|
2868
|
+
participantViewElement &&
|
|
2869
|
+
typeof participantViewElement.requestFullscreen !== 'undefined' && (jsx("span", { className: "str-video__livestream-layout__go-fullscreen", onClick: toggleFullScreen }))] })) }));
|
|
2852
2870
|
};
|
|
2853
2871
|
const useUpdateCallDuration = () => {
|
|
2854
2872
|
const { useIsCallLive, useCallSession } = useCallStateHooks();
|
|
@@ -3228,7 +3246,7 @@ const checkCanJoinEarly = (startsAt, joinAheadTimeSeconds) => {
|
|
|
3228
3246
|
return Date.now() >= +startsAt - (joinAheadTimeSeconds ?? 0) * 1000;
|
|
3229
3247
|
};
|
|
3230
3248
|
|
|
3231
|
-
const [major, minor, patch] = ("1.
|
|
3249
|
+
const [major, minor, patch] = ("1.32.1").split('.');
|
|
3232
3250
|
setSdkInfo({
|
|
3233
3251
|
type: SfuModels.SdkType.REACT,
|
|
3234
3252
|
major,
|
|
@@ -3236,5 +3254,5 @@ setSdkInfo({
|
|
|
3236
3254
|
patch,
|
|
3237
3255
|
});
|
|
3238
3256
|
|
|
3239
|
-
export { AcceptCallButton, Audio, AudioVolumeIndicator, Avatar, AvatarFallback, BackgroundFiltersProvider, BackstageLayout, BaseVideo, CallControls, CallParticipantListing, CallParticipantListingItem, CallParticipantsList, CallPreview, CallRecordingList, CallRecordingListHeader, CallRecordingListItem, CallStats, CallStatsButton, CancelCallButton, CancelCallConfirmButton, CompositeButton, DefaultParticipantViewUI, DefaultReactionsMenu, DefaultScreenShareOverlay, DefaultVideoPlaceholder, DeviceSelector, DeviceSelectorAudioInput, DeviceSelectorAudioOutput, DeviceSelectorVideo, DeviceSettings, DropDownSelect, DropDownSelectOption, EmptyCallRecordingListing, GenericMenu, GenericMenuButtonItem, Icon, IconButton, LivestreamLayout, LivestreamPlayer, LoadingCallRecordingListing, LoadingIndicator, MenuToggle, MenuVisualType, NoiseCancellationProvider, Notification, PaginatedGridLayout, ParticipantActionsContextMenu, ParticipantDetails, ParticipantView, ParticipantViewContext, ParticipantsAudio, PermissionNotification, PermissionRequestList, PermissionRequests, PipLayout, Reaction, ReactionsButton, RecordCallButton, RecordCallConfirmationButton, RecordingInProgressNotification, RingingCall, RingingCallControls, ScreenShareButton, SearchInput, SearchResults, SpeakerLayout, SpeakerTest, SpeakingWhileMutedNotification, SpeechIndicator, StatCard, StreamCall, StreamTheme, StreamVideo, TextButton, ToggleAudioOutputButton, ToggleAudioPreviewButton, ToggleAudioPublishingButton, ToggleVideoPreviewButton, ToggleVideoPublishingButton, Tooltip, Video$1 as Video, VideoPreview, WithTooltip, applyFilter, defaultEmojiReactionMap, defaultReactions, translations, useBackgroundFilters, useDeviceList, useFilteredParticipants, useHorizontalScrollPosition, useMenuContext, useModeration, useNoiseCancellation, useParticipantViewContext, usePersistedDevicePreferences, useRequestPermission, useTrackElementVisibility, useVerticalScrollPosition };
|
|
3257
|
+
export { AcceptCallButton, Audio, AudioVolumeIndicator, Avatar, AvatarFallback, BackgroundFiltersProvider, BackstageLayout, BaseVideo, CallControls, CallParticipantListing, CallParticipantListingItem, CallParticipantsList, CallPreview, CallRecordingList, CallRecordingListHeader, CallRecordingListItem, CallStats, CallStatsButton, CancelCallButton, CancelCallConfirmButton, CompositeButton, DefaultParticipantViewUI, DefaultReactionsMenu, DefaultScreenShareOverlay, DefaultVideoPlaceholder, DeviceSelector, DeviceSelectorAudioInput, DeviceSelectorAudioOutput, DeviceSelectorVideo, DeviceSettings, DropDownSelect, DropDownSelectOption, EmptyCallRecordingListing, GenericMenu, GenericMenuButtonItem, Icon, IconButton, LivestreamLayout, LivestreamPlayer, LoadingCallRecordingListing, LoadingIndicator, MenuToggle, MenuVisualType, MicCaptureErrorNotification, NoiseCancellationProvider, Notification, PaginatedGridLayout, ParticipantActionsContextMenu, ParticipantDetails, ParticipantView, ParticipantViewContext, ParticipantsAudio, PermissionNotification, PermissionRequestList, PermissionRequests, PipLayout, Reaction, ReactionsButton, RecordCallButton, RecordCallConfirmationButton, RecordingInProgressNotification, RingingCall, RingingCallControls, ScreenShareButton, SearchInput, SearchResults, SpeakerLayout, SpeakerTest, SpeakingWhileMutedNotification, SpeechIndicator, StatCard, StreamCall, StreamTheme, StreamVideo, TextButton, ToggleAudioOutputButton, ToggleAudioPreviewButton, ToggleAudioPublishingButton, ToggleVideoPreviewButton, ToggleVideoPublishingButton, Tooltip, Video$1 as Video, VideoPreview, WithTooltip, applyFilter, defaultEmojiReactionMap, defaultReactions, translations, useBackgroundFilters, useDeviceList, useFilteredParticipants, useHorizontalScrollPosition, useMenuContext, useModeration, useNoiseCancellation, useParticipantViewContext, usePersistedDevicePreferences, useRequestPermission, useTrackElementVisibility, useVerticalScrollPosition };
|
|
3240
3258
|
//# sourceMappingURL=index.es.js.map
|