@stream-io/video-react-sdk 1.7.26 → 1.7.28

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,23 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [1.7.28](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-1.7.27...@stream-io/video-react-sdk-1.7.28) (2024-12-03)
6
+
7
+ ### Dependency Updates
8
+
9
+ * `@stream-io/video-client` updated to version `1.11.12`
10
+ * `@stream-io/video-react-bindings` updated to version `1.2.6`
11
+ ## [1.7.27](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-1.7.26...@stream-io/video-react-sdk-1.7.27) (2024-11-29)
12
+
13
+ ### Dependency Updates
14
+
15
+ * `@stream-io/video-client` updated to version `1.11.11`
16
+ * `@stream-io/video-react-bindings` updated to version `1.2.5`
17
+
18
+ ### Bug Fixes
19
+
20
+ * revert [#1604](https://github.com/GetStream/stream-video-js/issues/1604) ([#1607](https://github.com/GetStream/stream-video-js/issues/1607)) ([567e4fb](https://github.com/GetStream/stream-video-js/commit/567e4fb309509b6b0d814826856d0a15efe16271))
21
+
5
22
  ## [1.7.26](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-1.7.25...@stream-io/video-react-sdk-1.7.26) (2024-11-28)
6
23
 
7
24
  ### Dependency Updates
package/dist/index.cjs.js CHANGED
@@ -128,10 +128,8 @@ const usePersistDevicePreferences = (key, shouldPersistRef) => {
128
128
  *
129
129
  * @param key the key to use for local storage.
130
130
  */
131
- const useApplyDevicePreferences = (key, onWillApply, onApplied) => {
131
+ const useApplyDevicePreferences = (key, onApplied) => {
132
132
  const call = videoReactBindings.useCall();
133
- const onWillApplyRef = react.useRef(onWillApply);
134
- onWillApplyRef.current = onWillApply;
135
133
  const onAppliedRef = react.useRef(onApplied);
136
134
  onAppliedRef.current = onApplied;
137
135
  react.useEffect(() => {
@@ -180,21 +178,16 @@ const useApplyDevicePreferences = (key, onWillApply, onApplied) => {
180
178
  console.warn('Failed to load device preferences', err);
181
179
  }
182
180
  if (preferences) {
183
- await initMic(preferences.mic).catch((err) => {
184
- console.warn('Failed to apply microphone preferences', err);
185
- });
186
- await initCamera(preferences.camera).catch((err) => {
187
- console.warn('Failed to apply camera preferences', err);
188
- });
181
+ await initMic(preferences.mic);
182
+ await initCamera(preferences.camera);
189
183
  initSpeaker(preferences.speaker);
190
184
  }
191
185
  };
192
- onWillApplyRef.current();
193
186
  apply()
187
+ .then(() => onAppliedRef.current())
194
188
  .catch((err) => {
195
189
  console.warn('Failed to apply device preferences', err);
196
- })
197
- .then(() => onAppliedRef.current());
190
+ });
198
191
  return () => {
199
192
  cancel = true;
200
193
  };
@@ -207,7 +200,7 @@ const useApplyDevicePreferences = (key, onWillApply, onApplied) => {
207
200
  */
208
201
  const usePersistedDevicePreferences = (key = '@stream-io/device-preferences') => {
209
202
  const shouldPersistRef = react.useRef(false);
210
- useApplyDevicePreferences(key, () => (shouldPersistRef.current = false), () => (shouldPersistRef.current = true));
203
+ useApplyDevicePreferences(key, () => (shouldPersistRef.current = true));
211
204
  usePersistDevicePreferences(key, shouldPersistRef);
212
205
  };
213
206
  const parseDeviceId = (deviceId) => deviceId !== defaultDevice ? deviceId : undefined;
@@ -1108,9 +1101,9 @@ const DefaultReactionsMenu = ({ reactions, layout = 'horizontal', }) => {
1108
1101
  */
1109
1102
  const createCallControlHandler = (props, handler) => {
1110
1103
  const logger = videoClient.getLogger(['react-sdk']);
1111
- return async (...args) => {
1104
+ return async () => {
1112
1105
  try {
1113
- await handler(...args);
1106
+ await handler();
1114
1107
  }
1115
1108
  catch (error) {
1116
1109
  if (props.onError) {
@@ -1257,13 +1250,12 @@ const DeviceSelector = (props) => {
1257
1250
  return jsxRuntime.jsx(DeviceSelectorDropdown, { ...rest, icon: icon });
1258
1251
  };
1259
1252
 
1260
- const DeviceSelectorAudioInput = (props) => {
1253
+ const DeviceSelectorAudioInput = ({ title, visualType, }) => {
1261
1254
  const { useMicrophoneState } = videoReactBindings.useCallStateHooks();
1262
1255
  const { microphone, selectedDevice, devices } = useMicrophoneState();
1263
- const handleChange = createCallControlHandler(props, async (deviceId) => {
1264
- await microphone.select(deviceId);
1265
- });
1266
- return (jsxRuntime.jsx(DeviceSelector, { devices: devices || [], selectedDeviceId: selectedDevice, type: "audioinput", onChange: handleChange, title: props.title, visualType: props.visualType, icon: "mic" }));
1256
+ return (jsxRuntime.jsx(DeviceSelector, { devices: devices || [], selectedDeviceId: selectedDevice, type: "audioinput", onChange: async (deviceId) => {
1257
+ await microphone.select(deviceId);
1258
+ }, title: title, visualType: visualType, icon: "mic" }));
1267
1259
  };
1268
1260
  const DeviceSelectorAudioOutput = ({ title, visualType, }) => {
1269
1261
  const { useSpeakerState } = videoReactBindings.useCallStateHooks();
@@ -1275,13 +1267,12 @@ const DeviceSelectorAudioOutput = ({ title, visualType, }) => {
1275
1267
  }, title: title, visualType: visualType, icon: "speaker" }));
1276
1268
  };
1277
1269
 
1278
- const DeviceSelectorVideo = (props) => {
1270
+ const DeviceSelectorVideo = ({ title, visualType, }) => {
1279
1271
  const { useCameraState } = videoReactBindings.useCallStateHooks();
1280
1272
  const { camera, devices, selectedDevice } = useCameraState();
1281
- const handleChange = createCallControlHandler(props, async (deviceId) => {
1282
- await camera.select(deviceId);
1283
- });
1284
- return (jsxRuntime.jsx(DeviceSelector, { devices: devices || [], type: "videoinput", selectedDeviceId: selectedDevice, onChange: handleChange, title: props.title, visualType: props.visualType, icon: "camera" }));
1273
+ return (jsxRuntime.jsx(DeviceSelector, { devices: devices || [], type: "videoinput", selectedDeviceId: selectedDevice, onChange: async (deviceId) => {
1274
+ await camera.select(deviceId);
1275
+ }, title: title, visualType: visualType, icon: "camera" }));
1285
1276
  };
1286
1277
 
1287
1278
  const DeviceSettings = ({ visualType = exports.MenuVisualType.MENU, }) => {
@@ -2563,7 +2554,7 @@ const LivestreamPlayer = (props) => {
2563
2554
  return (jsxRuntime.jsx(StreamCall, { call: call, children: jsxRuntime.jsx(LivestreamLayout, { ...layoutProps }) }));
2564
2555
  };
2565
2556
 
2566
- const [major, minor, patch] = ("1.7.26").split('.');
2557
+ const [major, minor, patch] = ("1.7.28").split('.');
2567
2558
  videoClient.setSdkInfo({
2568
2559
  type: videoClient.SfuModels.SdkType.REACT,
2569
2560
  major,