@stream-io/video-react-sdk 0.3.43 → 0.3.45

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
@@ -131,6 +131,10 @@ const Video$1 = ({ trackType, participant, className, VideoPlaceholder = Default
131
131
  const { width = 0, height = 0 } = track.getSettings();
132
132
  setIsWideMode(width >= height);
133
133
  };
134
+ // playback may have started before we had a chance to
135
+ // attach the 'play/pause' event listener, so we set the state
136
+ // here to make sure it's in sync
137
+ setIsVideoPaused(videoElement.paused);
134
138
  videoElement.addEventListener('play', handlePlayPause);
135
139
  videoElement.addEventListener('pause', handlePlayPause);
136
140
  track.addEventListener('unmute', handlePlayPause);
@@ -138,6 +142,8 @@ const Video$1 = ({ trackType, participant, className, VideoPlaceholder = Default
138
142
  videoElement.removeEventListener('play', handlePlayPause);
139
143
  videoElement.removeEventListener('pause', handlePlayPause);
140
144
  track.removeEventListener('unmute', handlePlayPause);
145
+ // reset the 'pause' state once we unmount the video element
146
+ setIsVideoPaused(true);
141
147
  };
142
148
  }, [stream, videoElement]);
143
149
  if (!call)
@@ -870,7 +876,10 @@ const CompositeButton = forwardRef(({ caption, children, active, Menu, menuPlace
870
876
  'str-video__composite-button__button-group--active': active,
871
877
  }), children: [children, Menu && (jsx(MenuToggle, { placement: menuPlacement, ToggleButton: ToggleMenuButton$2, children: isComponentType(Menu) ? jsx(Menu, {}) : Menu }))] }), caption && (jsx("div", { className: "str-video__composite-button__caption", children: caption }))] }));
872
878
  });
873
- const ToggleMenuButton$2 = forwardRef(({ menuShown }, ref) => (jsx(IconButton, { className: 'str-video__menu-toggle-button', icon: menuShown ? 'caret-down' : 'caret-up', title: "Toggle device menu", ref: ref })));
879
+ const ToggleMenuButton$2 = forwardRef(({ menuShown }, ref) => {
880
+ const { t } = useI18n();
881
+ return (jsx(IconButton, { className: 'str-video__menu-toggle-button', icon: menuShown ? 'caret-down' : 'caret-up', title: t('Toggle device menu'), ref: ref }));
882
+ });
874
883
 
875
884
  const Tooltip = ({ children, referenceElement, tooltipClassName, tooltipPlacement = 'top', visible = false, }) => {
876
885
  const { refs, x, y, strategy } = useFloatingUIPreset({
@@ -1319,9 +1328,12 @@ const DeviceSettings = () => {
1319
1328
  return (jsx(MenuToggle, { placement: "bottom-end", ToggleButton: ToggleMenuButton, children: jsx(Menu, {}) }));
1320
1329
  };
1321
1330
  const Menu = () => (jsxs("div", { className: "str-video__device-settings", children: [jsx(DeviceSelectorVideo, {}), jsx(DeviceSelectorAudioInput, {}), jsx(DeviceSelectorAudioOutput, {})] }));
1322
- const ToggleMenuButton = forwardRef(({ menuShown }, ref) => (jsx(IconButton, { className: clsx('str-video__device-settings__button', {
1323
- 'str-video__device-settings__button--active': menuShown,
1324
- }), title: "Toggle device menu", icon: "device-settings", ref: ref })));
1331
+ const ToggleMenuButton = forwardRef(({ menuShown }, ref) => {
1332
+ const { t } = useI18n();
1333
+ return (jsx(IconButton, { className: clsx('str-video__device-settings__button', {
1334
+ 'str-video__device-settings__button--active': menuShown,
1335
+ }), title: t('Toggle device menu'), icon: "device-settings", ref: ref }));
1336
+ });
1325
1337
 
1326
1338
  const ToggleAudioPreviewButton = (props) => {
1327
1339
  const { initialAudioEnabled, toggleInitialAudioMuteState } = useMediaDevices();
@@ -2305,6 +2317,7 @@ var en = {
2305
2317
  You: You,
2306
2318
  Me: Me,
2307
2319
  Unknown: Unknown,
2320
+ "Toggle device menu": "Toggle device menu",
2308
2321
  Allow: Allow,
2309
2322
  Revoke: Revoke,
2310
2323
  Dismiss: Dismiss,
@@ -2621,7 +2634,7 @@ const VerticalScrollButtons = ({ scrollWrapper, }) => {
2621
2634
  };
2622
2635
  const hasScreenShare = (p) => !!p?.publishedTracks.includes(SfuModels.TrackType.SCREEN_SHARE);
2623
2636
 
2624
- const [major, minor, patch] = ("0.3.43" ).split('.');
2637
+ const [major, minor, patch] = ("0.3.45" ).split('.');
2625
2638
  setSdkInfo({
2626
2639
  type: SfuModels.SdkType.REACT,
2627
2640
  major,