@stream-io/video-react-sdk 1.18.12 → 1.19.0

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
@@ -1,4 +1,4 @@
1
- import { hasAudio, hasScreenShareAudio, CallingState, hasVideo, hasScreenShare, OwnCapability, Browsers, VisibilityState, getLogger, disposeOfMediaStream, SfuModels, isPinned, name, NoiseCancellationSettingsModeEnum, paginatedLayoutSortPreset, combineComparators, screenSharing, speakerLayoutSortPreset, CallTypes, defaultSortPreset, setSdkInfo } from '@stream-io/video-client';
1
+ import { hasAudio, hasScreenShareAudio, CallingState, hasVideo, hasScreenShare, OwnCapability, Browsers, VisibilityState, hasPausedTrack, getLogger, disposeOfMediaStream, SfuModels, isPinned, name, NoiseCancellationSettingsModeEnum, paginatedLayoutSortPreset, combineComparators, screenSharing, speakerLayoutSortPreset, CallTypes, defaultSortPreset, setSdkInfo } from '@stream-io/video-client';
2
2
  export * from '@stream-io/video-client';
3
3
  import { useCall, useCallStateHooks, useI18n, Restricted, useToggleCallRecording, useConnectedUser, StreamCallProvider, StreamVideoProvider, useStreamVideoClient } from '@stream-io/video-react-bindings';
4
4
  export * from '@stream-io/video-react-bindings';
@@ -787,7 +787,10 @@ const Video$1 = ({ enabled = true, mirror, trackType, participant, className, Vi
787
787
  : false;
788
788
  const isInvisible = trackType === 'none' ||
789
789
  viewportVisibilityState?.[trackType] === VisibilityState.INVISIBLE;
790
- const hasNoVideoOrInvisible = !enabled || !isPublishingTrack || isInvisible;
790
+ const hasNoVideoOrInvisible = !enabled ||
791
+ !isPublishingTrack ||
792
+ isInvisible ||
793
+ hasPausedTrack(participant, trackType);
791
794
  const mirrorVideo = mirror === undefined
792
795
  ? isLocalParticipant && trackType === 'videoTrack'
793
796
  : mirror;
@@ -2217,9 +2220,11 @@ const DefaultScreenShareOverlay = () => {
2217
2220
  const call = useCall();
2218
2221
  const { t } = useI18n();
2219
2222
  const stopScreenShare = () => {
2220
- call?.screenShare.disable();
2223
+ call?.screenShare.disable().catch((err) => {
2224
+ console.error('Failed to stop screen sharing:', err);
2225
+ });
2221
2226
  };
2222
- 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, className: "str-video__screen-share-overlay__button", children: [jsx(Icon, { icon: "close" }), " ", t('Stop Screen Sharing')] })] }));
2227
+ 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')] })] }));
2223
2228
  };
2224
2229
  const DefaultParticipantViewUI = ({ indicatorsVisible = true, menuPlacement = 'bottom-start', showMenuButton = true, ParticipantActionsContextMenu: ParticipantActionsContextMenu$1 = ParticipantActionsContextMenu, }) => {
2225
2230
  const { participant, trackType } = useParticipantViewContext();
@@ -2232,7 +2237,7 @@ const DefaultParticipantViewUI = ({ indicatorsVisible = true, menuPlacement = 'b
2232
2237
  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 })] }));
2233
2238
  };
2234
2239
  const ParticipantDetails = ({ indicatorsVisible = true, }) => {
2235
- const { participant } = useParticipantViewContext();
2240
+ const { participant, trackType } = useParticipantViewContext();
2236
2241
  const { isLocalParticipant, connectionQuality, pin, sessionId, name, userId, } = participant;
2237
2242
  const call = useCall();
2238
2243
  const { t } = useI18n();
@@ -2241,7 +2246,8 @@ const ParticipantDetails = ({ indicatorsVisible = true, }) => {
2241
2246
  const hasAudioTrack = hasAudio(participant);
2242
2247
  const hasVideoTrack = hasVideo(participant);
2243
2248
  const canUnpin = !!pin && pin.isLocalPin;
2244
- return (jsxs(Fragment, { children: [jsx("div", { className: "str-video__participant-details", children: jsxs("span", { className: "str-video__participant-details__name", children: [name || userId, indicatorsVisible && !hasAudioTrack && (jsx("span", { className: "str-video__participant-details__name--audio-muted" })), indicatorsVisible && !hasVideoTrack && (jsx("span", { className: "str-video__participant-details__name--video-muted" })), indicatorsVisible && canUnpin && (
2249
+ const isTrackPaused = trackType !== 'none' ? hasPausedTrack(participant, trackType) : false;
2250
+ return (jsxs(Fragment, { children: [jsx("div", { className: "str-video__participant-details", children: jsxs("span", { className: "str-video__participant-details__name", children: [name || userId, indicatorsVisible && !hasAudioTrack && (jsx("span", { className: "str-video__participant-details__name--audio-muted" })), indicatorsVisible && !hasVideoTrack && (jsx("span", { className: "str-video__participant-details__name--video-muted" })), indicatorsVisible && isTrackPaused && (jsx("span", { title: t('Video paused due to insufficient bandwidth'), className: "str-video__participant-details__name--track-paused" })), indicatorsVisible && canUnpin && (
2245
2251
  // TODO: remove this monstrosity once we have a proper design
2246
2252
  jsx("span", { title: t('Unpin'), onClick: () => call?.unpin(sessionId), className: "str-video__participant-details__name--pinned" })), indicatorsVisible && jsx(SpeechIndicator, {})] }) }), indicatorsVisible && (jsx(Notification, { isVisible: isLocalParticipant &&
2247
2253
  connectionQuality === SfuModels.ConnectionQuality.POOR, message: t('Poor connection quality'), children: connectionQualityAsString && (jsx("span", { className: clsx('str-video__participant-details__connection-quality', `str-video__participant-details__connection-quality--${connectionQualityAsString}`), title: connectionQualityAsString })) }))] }));
@@ -2414,6 +2420,7 @@ var en = {
2414
2420
  "{{ direction }} picture-in-picture": "{{ direction }} picture-in-picture",
2415
2421
  "Dominant Speaker": "Dominant Speaker",
2416
2422
  "Poor connection quality": "Poor connection quality. Please check your internet connection.",
2423
+ "Video paused due to insufficient bandwidth": "Video paused due to insufficient bandwidth",
2417
2424
  Participants: Participants,
2418
2425
  Anonymous: Anonymous,
2419
2426
  "No participants found": "No participants found",
@@ -2937,7 +2944,7 @@ const checkCanJoinEarly = (startsAt, joinAheadTimeSeconds) => {
2937
2944
  return Date.now() >= +startsAt - (joinAheadTimeSeconds ?? 0) * 1000;
2938
2945
  };
2939
2946
 
2940
- const [major, minor, patch] = ("1.18.12").split('.');
2947
+ const [major, minor, patch] = ("1.19.0").split('.');
2941
2948
  setSdkInfo({
2942
2949
  type: SfuModels.SdkType.REACT,
2943
2950
  major,