@stream-io/video-react-sdk 1.7.25 → 1.7.27
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 +17 -0
- package/dist/index.cjs.js +17 -26
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +17 -26
- package/dist/index.es.js.map +1 -1
- package/dist/src/components/DeviceSettings/DeviceSelectorAudio.d.ts +3 -4
- package/dist/src/components/DeviceSettings/DeviceSelectorVideo.d.ts +3 -4
- package/dist/src/utilities/callControlHandler.d.ts +1 -1
- package/package.json +3 -3
- package/src/components/DeviceSettings/DeviceSelectorAudio.tsx +11 -18
- package/src/components/DeviceSettings/DeviceSelectorVideo.tsx +11 -16
- package/src/hooks/usePersistedDevicePreferences.ts +6 -21
- package/src/utilities/callControlHandler.ts +4 -4
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.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)
|
|
6
|
+
|
|
7
|
+
### Dependency Updates
|
|
8
|
+
|
|
9
|
+
* `@stream-io/video-client` updated to version `1.11.11`
|
|
10
|
+
* `@stream-io/video-react-bindings` updated to version `1.2.5`
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* 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))
|
|
15
|
+
|
|
16
|
+
## [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)
|
|
17
|
+
|
|
18
|
+
### Dependency Updates
|
|
19
|
+
|
|
20
|
+
* `@stream-io/video-client` updated to version `1.11.10`
|
|
21
|
+
* `@stream-io/video-react-bindings` updated to version `1.2.4`
|
|
5
22
|
## [1.7.25](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-1.7.24...@stream-io/video-react-sdk-1.7.25) (2024-11-27)
|
|
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,
|
|
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)
|
|
184
|
-
|
|
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 =
|
|
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 (
|
|
1104
|
+
return async () => {
|
|
1112
1105
|
try {
|
|
1113
|
-
await handler(
|
|
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 = (
|
|
1253
|
+
const DeviceSelectorAudioInput = ({ title, visualType, }) => {
|
|
1261
1254
|
const { useMicrophoneState } = videoReactBindings.useCallStateHooks();
|
|
1262
1255
|
const { microphone, selectedDevice, devices } = useMicrophoneState();
|
|
1263
|
-
|
|
1264
|
-
|
|
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 = (
|
|
1270
|
+
const DeviceSelectorVideo = ({ title, visualType, }) => {
|
|
1279
1271
|
const { useCameraState } = videoReactBindings.useCallStateHooks();
|
|
1280
1272
|
const { camera, devices, selectedDevice } = useCameraState();
|
|
1281
|
-
|
|
1282
|
-
|
|
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.
|
|
2557
|
+
const [major, minor, patch] = ("1.7.27").split('.');
|
|
2567
2558
|
videoClient.setSdkInfo({
|
|
2568
2559
|
type: videoClient.SfuModels.SdkType.REACT,
|
|
2569
2560
|
major,
|