@stream-io/video-react-sdk 1.26.0 → 1.26.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 +13 -0
- package/dist/index.cjs.js +30 -23
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +30 -24
- package/dist/index.es.js.map +1 -1
- package/dist/src/components/DeviceSettings/index.d.ts +1 -0
- package/dist/src/core/components/CallLayout/LivestreamLayout.d.ts +5 -0
- package/package.json +3 -3
- package/src/components/DeviceSettings/index.ts +1 -0
- package/src/core/components/CallLayout/LivestreamLayout.tsx +68 -45
package/dist/index.es.js
CHANGED
|
@@ -1331,6 +1331,21 @@ const ScreenShareButton = (props) => {
|
|
|
1331
1331
|
: 'screen-share-start-button', disabled: disableScreenShareButton, onClick: handleClick, children: jsx(Icon, { icon: isSomeoneScreenSharing ? 'screen-share-on' : 'screen-share-off' }) }) }) }) }));
|
|
1332
1332
|
};
|
|
1333
1333
|
|
|
1334
|
+
const AudioVolumeIndicator = () => {
|
|
1335
|
+
const { useMicrophoneState } = useCallStateHooks();
|
|
1336
|
+
const { isEnabled, mediaStream } = useMicrophoneState();
|
|
1337
|
+
const [audioLevel, setAudioLevel] = useState(0);
|
|
1338
|
+
useEffect(() => {
|
|
1339
|
+
if (!isEnabled || !mediaStream)
|
|
1340
|
+
return;
|
|
1341
|
+
const disposeSoundDetector = createSoundDetector(mediaStream, ({ audioLevel: al }) => setAudioLevel(al), { detectionFrequencyInMs: 80, destroyStreamOnStop: false });
|
|
1342
|
+
return () => {
|
|
1343
|
+
disposeSoundDetector().catch(console.error);
|
|
1344
|
+
};
|
|
1345
|
+
}, [isEnabled, mediaStream]);
|
|
1346
|
+
return (jsxs("div", { className: "str-video__audio-volume-indicator", children: [jsx(Icon, { icon: isEnabled ? 'mic' : 'mic-off' }), jsx("div", { className: "str-video__audio-volume-indicator__bar", children: jsx("div", { className: "str-video__audio-volume-indicator__bar-value", style: { transform: `scaleX(${audioLevel / 100})` } }) })] }));
|
|
1347
|
+
};
|
|
1348
|
+
|
|
1334
1349
|
const SelectContext = createContext({});
|
|
1335
1350
|
const Select = (props) => {
|
|
1336
1351
|
const { children, icon, defaultSelectedLabel, defaultSelectedIndex, handleSelect: handleSelectProp, } = props;
|
|
@@ -1441,21 +1456,6 @@ const DeviceSelector = (props) => {
|
|
|
1441
1456
|
return jsx(DeviceSelectorDropdown, { ...rest, icon: icon });
|
|
1442
1457
|
};
|
|
1443
1458
|
|
|
1444
|
-
const AudioVolumeIndicator = () => {
|
|
1445
|
-
const { useMicrophoneState } = useCallStateHooks();
|
|
1446
|
-
const { isEnabled, mediaStream } = useMicrophoneState();
|
|
1447
|
-
const [audioLevel, setAudioLevel] = useState(0);
|
|
1448
|
-
useEffect(() => {
|
|
1449
|
-
if (!isEnabled || !mediaStream)
|
|
1450
|
-
return;
|
|
1451
|
-
const disposeSoundDetector = createSoundDetector(mediaStream, ({ audioLevel: al }) => setAudioLevel(al), { detectionFrequencyInMs: 80, destroyStreamOnStop: false });
|
|
1452
|
-
return () => {
|
|
1453
|
-
disposeSoundDetector().catch(console.error);
|
|
1454
|
-
};
|
|
1455
|
-
}, [isEnabled, mediaStream]);
|
|
1456
|
-
return (jsxs("div", { className: "str-video__audio-volume-indicator", children: [jsx(Icon, { icon: isEnabled ? 'mic' : 'mic-off' }), jsx("div", { className: "str-video__audio-volume-indicator__bar", children: jsx("div", { className: "str-video__audio-volume-indicator__bar-value", style: { transform: `scaleX(${audioLevel / 100})` } }) })] }));
|
|
1457
|
-
};
|
|
1458
|
-
|
|
1459
1459
|
const DeviceSelectorAudioInput = ({ title, visualType, volumeIndicatorVisible = true, }) => {
|
|
1460
1460
|
const { useMicrophoneState } = useCallStateHooks();
|
|
1461
1461
|
const { microphone, selectedDevice, devices } = useMicrophoneState();
|
|
@@ -2657,13 +2657,14 @@ const LivestreamLayout = (props) => {
|
|
|
2657
2657
|
? participants.find(hasScreenShare)
|
|
2658
2658
|
: undefined;
|
|
2659
2659
|
usePaginatedLayoutSortPreset(call);
|
|
2660
|
-
const
|
|
2661
|
-
const {
|
|
2662
|
-
const floatingParticipantOverlay = hasOngoingScreenShare &&
|
|
2663
|
-
|
|
2664
|
-
, {
|
|
2660
|
+
const { floatingParticipantProps, muted, ParticipantViewUI } = props;
|
|
2661
|
+
const overlay = ParticipantViewUI ?? (jsx(ParticipantOverlay, { showParticipantCount: props.showParticipantCount, showDuration: props.showDuration, showLiveBadge: props.showLiveBadge, showSpeakerName: props.showSpeakerName, enableFullScreen: props.enableFullScreen }));
|
|
2662
|
+
const floatingParticipantOverlay = hasOngoingScreenShare &&
|
|
2663
|
+
(ParticipantViewUI ?? (jsx(ParticipantOverlay
|
|
2665
2664
|
// these elements aren't needed for the video feed
|
|
2666
|
-
|
|
2665
|
+
, {
|
|
2666
|
+
// these elements aren't needed for the video feed
|
|
2667
|
+
showParticipantCount: floatingParticipantProps?.showParticipantCount ?? false, showDuration: floatingParticipantProps?.showDuration ?? false, showLiveBadge: floatingParticipantProps?.showLiveBadge ?? false, showSpeakerName: floatingParticipantProps?.showSpeakerName ?? true, enableFullScreen: floatingParticipantProps?.enableFullScreen ?? true })));
|
|
2667
2668
|
return (jsxs("div", { className: "str-video__livestream-layout__wrapper", children: [!muted && jsx(ParticipantsAudio, { participants: remoteParticipants }), hasOngoingScreenShare && presenter && (jsx(ParticipantView, { className: "str-video__livestream-layout__screen-share", participant: presenter, ParticipantViewUI: overlay, trackType: "screenShareTrack", muteAudio // audio is rendered by ParticipantsAudio
|
|
2668
2669
|
: true })), currentSpeaker && (jsx(ParticipantView, { className: clsx(hasOngoingScreenShare &&
|
|
2669
2670
|
clsx('str-video__livestream-layout__floating-participant', `str-video__livestream-layout__floating-participant--${floatingParticipantProps?.position ?? 'top-right'}`)), participant: currentSpeaker, ParticipantViewUI: floatingParticipantOverlay || overlay, mirror: props.mirrorLocalParticipantVideo !== false ? undefined : false, muteAudio // audio is rendered by ParticipantsAudio
|
|
@@ -2685,13 +2686,18 @@ const BackstageLayout = (props) => {
|
|
|
2685
2686
|
BackstageLayout.displayName = 'BackstageLayout';
|
|
2686
2687
|
const ParticipantOverlay = (props) => {
|
|
2687
2688
|
const { enableFullScreen = true, showParticipantCount = true, showDuration = true, showLiveBadge = true, showSpeakerName = false, } = props;
|
|
2689
|
+
const overlayBarVisible = enableFullScreen ||
|
|
2690
|
+
showParticipantCount ||
|
|
2691
|
+
showDuration ||
|
|
2692
|
+
showLiveBadge ||
|
|
2693
|
+
showSpeakerName;
|
|
2688
2694
|
const { participant } = useParticipantViewContext();
|
|
2689
2695
|
const { useParticipantCount } = useCallStateHooks();
|
|
2690
2696
|
const participantCount = useParticipantCount();
|
|
2691
2697
|
const duration = useUpdateCallDuration();
|
|
2692
2698
|
const toggleFullScreen = useToggleFullScreen();
|
|
2693
2699
|
const { t } = useI18n();
|
|
2694
|
-
return (jsx("div", { className: "str-video__livestream-layout__overlay", children: 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: 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) })), enableFullScreen && (jsx("span", { className: "str-video__livestream-layout__go-fullscreen", onClick: toggleFullScreen }))] }) }));
|
|
2700
|
+
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: 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) })), enableFullScreen && (jsx("span", { className: "str-video__livestream-layout__go-fullscreen", onClick: toggleFullScreen }))] })) }));
|
|
2695
2701
|
};
|
|
2696
2702
|
const useUpdateCallDuration = () => {
|
|
2697
2703
|
const { useIsCallLive, useCallSession } = useCallStateHooks();
|
|
@@ -3020,7 +3026,7 @@ const checkCanJoinEarly = (startsAt, joinAheadTimeSeconds) => {
|
|
|
3020
3026
|
return Date.now() >= +startsAt - (joinAheadTimeSeconds ?? 0) * 1000;
|
|
3021
3027
|
};
|
|
3022
3028
|
|
|
3023
|
-
const [major, minor, patch] = ("1.26.
|
|
3029
|
+
const [major, minor, patch] = ("1.26.1").split('.');
|
|
3024
3030
|
setSdkInfo({
|
|
3025
3031
|
type: SfuModels.SdkType.REACT,
|
|
3026
3032
|
major,
|
|
@@ -3028,5 +3034,5 @@ setSdkInfo({
|
|
|
3028
3034
|
patch,
|
|
3029
3035
|
});
|
|
3030
3036
|
|
|
3031
|
-
export { AcceptCallButton, Audio, 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, 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, useNoiseCancellation, useParticipantViewContext, usePersistedDevicePreferences, useRequestPermission, useTrackElementVisibility, useVerticalScrollPosition };
|
|
3037
|
+
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, 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, useNoiseCancellation, useParticipantViewContext, usePersistedDevicePreferences, useRequestPermission, useTrackElementVisibility, useVerticalScrollPosition };
|
|
3032
3038
|
//# sourceMappingURL=index.es.js.map
|