@stream-io/video-react-sdk 1.18.2 → 1.18.4

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 CHANGED
@@ -2,6 +2,25 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [1.18.4](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-1.18.3...@stream-io/video-react-sdk-1.18.4) (2025-06-04)
6
+
7
+ ### Dependency Updates
8
+
9
+ - `@stream-io/video-client` updated to version `1.23.5`
10
+ - `@stream-io/video-react-bindings` updated to version `1.6.8`
11
+
12
+ ### Bug Fixes
13
+
14
+ - early join in LivestreamPlayer ([#1817](https://github.com/GetStream/stream-video-js/issues/1817)) ([f80e867](https://github.com/GetStream/stream-video-js/commit/f80e867a27cfca75bc3e5e244b3b08a3d894de18))
15
+ - prevent usePersistedDevicePreferences from overriding manually set status ([#1815](https://github.com/GetStream/stream-video-js/issues/1815)) ([fce2d56](https://github.com/GetStream/stream-video-js/commit/fce2d563678bfd7ef065aa150571889b84b360e8))
16
+
17
+ ## [1.18.3](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-1.18.2...@stream-io/video-react-sdk-1.18.3) (2025-06-03)
18
+
19
+ ### Dependency Updates
20
+
21
+ - `@stream-io/video-client` updated to version `1.23.4`
22
+ - `@stream-io/video-react-bindings` updated to version `1.6.7`
23
+
5
24
  ## [1.18.2](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-1.18.1...@stream-io/video-react-sdk-1.18.2) (2025-06-02)
6
25
 
7
26
  ### Dependency Updates
package/dist/index.cjs.js CHANGED
@@ -106,14 +106,12 @@ const usePersistedDevicePreferences = (key = '@stream-io/device-preferences') =>
106
106
  const preferences = parseLocalDevicePreferences(key);
107
107
  const preference = preferences[deviceKey];
108
108
  const manager = state[deviceKey];
109
- if (!manager.state.selectedDevice) {
110
- const applyPromise = preference
111
- ? applyLocalDevicePreference(manager, [preference].flat(), state.devices)
112
- : applyMutedState(manager, defaultMuted);
113
- await applyPromise.catch((err) => {
114
- console.warn(`Failed to apply ${deviceKey} device preferences`, err);
115
- });
116
- }
109
+ const applyPromise = preference
110
+ ? applyLocalDevicePreference(manager, [preference].flat(), state.devices)
111
+ : applyMutedState(manager, defaultMuted);
112
+ await applyPromise.catch((err) => {
113
+ console.warn(`Failed to apply ${deviceKey} device preferences`, err);
114
+ });
117
115
  }
118
116
  })().finally(() => setApplyingState((state) => (state === 'applying' ? 'applied' : state)));
119
117
  }, [
@@ -310,7 +308,9 @@ const applyLocalDevicePreference = async (manager, preference, devices) => {
310
308
  const device = devices.find((d) => d.deviceId === p.selectedDeviceId) ??
311
309
  devices.find((d) => d.label === p.selectedDeviceLabel);
312
310
  if (device) {
313
- await manager.select(device.deviceId);
311
+ if (!manager.state.selectedDevice) {
312
+ await manager.select(device.deviceId);
313
+ }
314
314
  muted = p.muted;
315
315
  break;
316
316
  }
@@ -320,7 +320,9 @@ const applyLocalDevicePreference = async (manager, preference, devices) => {
320
320
  }
321
321
  };
322
322
  const applyMutedState = async (manager, muted) => {
323
- await manager[muted ? 'disable' : 'enable']?.();
323
+ if (!manager.state.status) {
324
+ await manager[muted ? 'disable' : 'enable']?.();
325
+ }
324
326
  };
325
327
  const getSelectedDevicePreference = (devices, selectedDevice) => ({
326
328
  selectedDeviceId: selectedDevice || defaultDevice,
@@ -2895,7 +2897,7 @@ const useLivestreamCall = (props) => {
2895
2897
  const call = videoReactBindings.useCall();
2896
2898
  const { useIsCallLive, useOwnCapabilities } = videoReactBindings.useCallStateHooks();
2897
2899
  const canJoinLive = useIsCallLive();
2898
- const canJoinEarly = useCanJoinEearly();
2900
+ const canJoinEarly = useCanJoinEarly();
2899
2901
  const canJoinBackstage = useOwnCapabilities()?.includes('join-backstage') ?? false;
2900
2902
  const canJoinAsap = canJoinLive || canJoinEarly || canJoinBackstage;
2901
2903
  const joinBehavior = props.joinBehavior ?? 'asap';
@@ -2912,20 +2914,21 @@ const useLivestreamCall = (props) => {
2912
2914
  }, [call, canJoin, onError]);
2913
2915
  return call;
2914
2916
  };
2915
- const useCanJoinEearly = () => {
2917
+ const useCanJoinEarly = () => {
2916
2918
  const { useCallStartsAt, useCallSettings } = videoReactBindings.useCallStateHooks();
2917
2919
  const startsAt = useCallStartsAt();
2918
2920
  const settings = useCallSettings();
2919
2921
  const joinAheadTimeSeconds = settings?.backstage.join_ahead_time_seconds;
2920
- const [canJoinEarly, setCanJoinEearly] = react.useState(() => checkCanJoinEarly(startsAt, joinAheadTimeSeconds));
2922
+ const [canJoinEarly, setCanJoinEarly] = react.useState(() => checkCanJoinEarly(startsAt, joinAheadTimeSeconds));
2921
2923
  react.useEffect(() => {
2922
2924
  if (!canJoinEarly) {
2923
2925
  const handle = setInterval(() => {
2924
- setCanJoinEearly(checkCanJoinEarly(startsAt, joinAheadTimeSeconds));
2926
+ setCanJoinEarly(checkCanJoinEarly(startsAt, joinAheadTimeSeconds));
2925
2927
  }, 1000);
2926
2928
  return () => clearInterval(handle);
2927
2929
  }
2928
2930
  }, [canJoinEarly, startsAt, joinAheadTimeSeconds]);
2931
+ return canJoinEarly;
2929
2932
  };
2930
2933
  const checkCanJoinEarly = (startsAt, joinAheadTimeSeconds) => {
2931
2934
  if (!startsAt) {
@@ -2934,7 +2937,7 @@ const checkCanJoinEarly = (startsAt, joinAheadTimeSeconds) => {
2934
2937
  return Date.now() >= +startsAt - (joinAheadTimeSeconds ?? 0) * 1000;
2935
2938
  };
2936
2939
 
2937
- const [major, minor, patch] = ("1.18.2").split('.');
2940
+ const [major, minor, patch] = ("1.18.4").split('.');
2938
2941
  videoClient.setSdkInfo({
2939
2942
  type: videoClient.SfuModels.SdkType.REACT,
2940
2943
  major,