@stream-io/video-react-sdk 1.39.3 → 1.40.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/dist/index.es.js CHANGED
@@ -1406,7 +1406,7 @@ const SpeakerTest = (props) => {
1406
1406
  const audioElementRef = useRef(null);
1407
1407
  const [isPlaying, setIsPlaying] = useState(false);
1408
1408
  const { t } = useI18n();
1409
- const { audioUrl = `https://unpkg.com/${"@stream-io/video-react-sdk"}@${"1.39.3"}/assets/piano.mp3`, } = props;
1409
+ const { audioUrl = `https://unpkg.com/${"@stream-io/video-react-sdk"}@${"1.40.1"}/assets/piano.mp3`, } = props;
1410
1410
  // Update audio output device when selection changes
1411
1411
  useEffect(() => {
1412
1412
  const audio = audioElementRef.current;
@@ -2392,15 +2392,30 @@ const DefaultScreenShareOverlay = () => {
2392
2392
  };
2393
2393
  return (jsxs("div", { className: "str-video__screen-share-overlay", children: [jsx(Icon, { icon: "screen-share-off" }), jsx("span", { className: "str-video__screen-share-overlay__title", children: t('You are presenting your screen') }), jsxs("button", { onClick: stopScreenShare, type: "button", className: "str-video__screen-share-overlay__button", children: [jsx(Icon, { icon: "close" }), " ", t('Stop Screen Sharing')] })] }));
2394
2394
  };
2395
- const DefaultParticipantViewUI = ({ indicatorsVisible = true, menuPlacement = 'bottom-start', showMenuButton = true, ParticipantActionsContextMenu: ParticipantActionsContextMenu$1 = ParticipantActionsContextMenu, }) => {
2395
+ /**
2396
+ * Rendered over a remote participant's tile when the browser's autoplay policy
2397
+ * has blocked their audio. Selecting it calls `call.resumeAudio()`, unblocking
2398
+ * every blocked element at once.
2399
+ */
2400
+ const DefaultAudioBlockedNotification = () => {
2401
+ const call = useCall();
2402
+ const { t } = useI18n();
2403
+ return (jsx("button", { type: "button", className: "str-video__audio-blocked-notification", onClick: call?.resumeAudio, "aria-live": "polite", children: jsxs("span", { className: "str-video__audio-blocked-notification__message", children: [jsx(Icon, { icon: "speaker" }), jsxs("span", { className: "str-video__audio-blocked-notification__text", children: [jsx("span", { className: "str-video__audio-blocked-notification__title", children: t('Audio is blocked by your system') }), jsx("span", { className: "str-video__audio-blocked-notification__subtitle", children: t('Click or tap to play audio') })] })] }) }));
2404
+ };
2405
+ const DefaultParticipantViewUI = ({ indicatorsVisible = true, menuPlacement = 'bottom-start', showMenuButton = true, ParticipantActionsContextMenu: ParticipantActionsContextMenu$1 = ParticipantActionsContextMenu, AudioBlockedNotification = DefaultAudioBlockedNotification, }) => {
2396
2406
  const { participant, trackType } = useParticipantViewContext();
2407
+ const { useAutoplayBlockedSessionIds } = useCallStateHooks();
2408
+ const blockedSessionIds = useAutoplayBlockedSessionIds();
2397
2409
  const isScreenSharing = hasScreenShare(participant);
2410
+ const shouldShowAudioBlockedNotification = !participant.isLocalParticipant &&
2411
+ trackType !== 'screenShareTrack' &&
2412
+ blockedSessionIds.includes(participant.sessionId);
2398
2413
  if (participant.isLocalParticipant &&
2399
2414
  isScreenSharing &&
2400
2415
  trackType === 'screenShareTrack') {
2401
2416
  return (jsxs(Fragment, { children: [jsx(DefaultScreenShareOverlay, {}), jsx(ParticipantDetails, { indicatorsVisible: indicatorsVisible })] }));
2402
2417
  }
2403
- return (jsxs(Fragment, { children: [showMenuButton && (jsx(MenuToggle, { strategy: "fixed", placement: menuPlacement, ToggleButton: ToggleButton, children: jsx(ParticipantActionsContextMenu$1, {}) })), jsx(Reaction, { participant: participant }), jsx(ParticipantDetails, { indicatorsVisible: indicatorsVisible })] }));
2418
+ return (jsxs(Fragment, { children: [showMenuButton && (jsx(MenuToggle, { strategy: "fixed", placement: menuPlacement, ToggleButton: ToggleButton, children: jsx(ParticipantActionsContextMenu$1, {}) })), jsx(Reaction, { participant: participant }), jsx(ParticipantDetails, { indicatorsVisible: indicatorsVisible }), AudioBlockedNotification && shouldShowAudioBlockedNotification && (jsx(AudioBlockedNotification, {}))] }));
2404
2419
  };
2405
2420
  const ParticipantDetails = ({ indicatorsVisible = true, }) => {
2406
2421
  const { participant, trackType } = useParticipantViewContext();
@@ -2557,6 +2572,8 @@ var en = {
2557
2572
  "You have no permission to share your audio": "You have no permission to share your audio",
2558
2573
  "You are presenting your screen": "You are presenting your screen",
2559
2574
  "Stop Screen Sharing": "Stop Screen Sharing",
2575
+ "Audio is blocked by your system": "Audio is blocked by your system",
2576
+ "Click or tap to play audio": "Click or tap to play audio",
2560
2577
  Allow: Allow,
2561
2578
  Revoke: Revoke,
2562
2579
  Dismiss: Dismiss,
@@ -3261,7 +3278,7 @@ const checkCanJoinEarly = (startsAt, joinAheadTimeSeconds) => {
3261
3278
  return Date.now() >= +startsAt - (joinAheadTimeSeconds ?? 0) * 1000;
3262
3279
  };
3263
3280
 
3264
- const [major, minor, patch] = ("1.39.3").split('.');
3281
+ const [major, minor, patch] = ("1.40.1").split('.');
3265
3282
  setSdkInfo({
3266
3283
  type: SfuModels.SdkType.REACT,
3267
3284
  major,
@@ -3269,5 +3286,5 @@ setSdkInfo({
3269
3286
  patch,
3270
3287
  });
3271
3288
 
3272
- 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 };
3289
+ export { AcceptCallButton, Audio, AudioVolumeIndicator, Avatar, AvatarFallback, BackgroundFiltersProvider, BackstageLayout, BaseVideo, CallControls, CallParticipantListing, CallParticipantListingItem, CallParticipantsList, CallPreview, CallRecordingList, CallRecordingListHeader, CallRecordingListItem, CallStats, CallStatsButton, CancelCallButton, CancelCallConfirmButton, CompositeButton, DefaultAudioBlockedNotification, 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 };
3273
3290
  //# sourceMappingURL=index.es.js.map