@stream-io/video-react-sdk 1.7.3 → 1.7.5

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.5](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-1.7.4...@stream-io/video-react-sdk-1.7.5) (2024-10-30)
6
+
7
+ ### Dependency Updates
8
+
9
+ * `@stream-io/video-client` updated to version `1.10.1`
10
+ * `@stream-io/video-react-bindings` updated to version `1.1.10`
11
+
12
+ ### Bug Fixes
13
+
14
+ * various device selector issues ([#1541](https://github.com/GetStream/stream-video-js/issues/1541)) ([f23618b](https://github.com/GetStream/stream-video-js/commit/f23618bda447eeb2d66f908bdb38b24db051f87c))
15
+
16
+ ## [1.7.4](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-1.7.3...@stream-io/video-react-sdk-1.7.4) (2024-10-30)
17
+
18
+ ### Dependency Updates
19
+
20
+ * `@stream-io/video-client` updated to version `1.10.0`
21
+ * `@stream-io/video-react-bindings` updated to version `1.1.9`
5
22
  ## [1.7.3](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-1.7.2...@stream-io/video-react-sdk-1.7.3) (2024-10-28)
6
23
 
7
24
  ### Dependency Updates
package/dist/index.cjs.js CHANGED
@@ -1234,17 +1234,10 @@ const DeviceSelectorOption = ({ disabled, id, label, onChange, name, selected, d
1234
1234
  }), htmlFor: id, children: [jsxRuntime.jsx("input", { type: "radio", name: name, onChange: onChange, value: value, id: id, checked: selected, defaultChecked: defaultChecked, disabled: disabled }), label] }));
1235
1235
  };
1236
1236
  const DeviceSelectorList = (props) => {
1237
- const { devices = [], selectedDeviceId: selectedDeviceFromProps, title, type, onChange, } = props;
1237
+ const { devices = [], selectedDeviceId, title, type, onChange } = props;
1238
1238
  const { close } = useMenuContext();
1239
- // sometimes the browser (Chrome) will report the system-default device
1240
- // with an id of 'default'. In case when it doesn't, we'll select the first
1241
- // available device.
1242
- let selectedDeviceId = selectedDeviceFromProps;
1243
- if (devices.length > 0 &&
1244
- !devices.find((d) => d.deviceId === selectedDeviceId)) {
1245
- selectedDeviceId = devices[0].deviceId;
1246
- }
1247
- return (jsxRuntime.jsxs("div", { className: "str-video__device-settings__device-kind", children: [title && (jsxRuntime.jsx("div", { className: "str-video__device-settings__device-selector-title", children: title })), !devices.length ? (jsxRuntime.jsx(DeviceSelectorOption, { id: `${type}--default`, label: "Default", name: type, defaultChecked: true, value: "default" })) : (devices.map((device) => {
1239
+ const { t } = videoReactBindings.useI18n();
1240
+ return (jsxRuntime.jsxs("div", { className: "str-video__device-settings__device-kind", children: [title && (jsxRuntime.jsx("div", { className: "str-video__device-settings__device-selector-title", children: title })), devices.length === 0 ? (jsxRuntime.jsx(DeviceSelectorOption, { id: `${type}--default`, label: t('Default'), name: type, defaultChecked: true, value: "default" })) : (devices.map((device) => {
1248
1241
  return (jsxRuntime.jsx(DeviceSelectorOption, { id: `${type}--${device.deviceId}`, value: device.deviceId, label: device.label, onChange: (e) => {
1249
1242
  onChange?.(e.target.value);
1250
1243
  close?.();
@@ -1252,29 +1245,20 @@ const DeviceSelectorList = (props) => {
1252
1245
  }))] }));
1253
1246
  };
1254
1247
  const DeviceSelectorDropdown = (props) => {
1255
- const { devices = [], selectedDeviceId: selectedDeviceFromProps, title, onChange, icon, } = props;
1256
- // sometimes the browser (Chrome) will report the system-default device
1257
- // with an id of 'default'. In case when it doesn't, we'll select the first
1258
- // available device.
1259
- let selectedDeviceId = selectedDeviceFromProps;
1260
- if (devices.length > 0 &&
1261
- !devices.find((d) => d.deviceId === selectedDeviceId)) {
1262
- selectedDeviceId = devices[0].deviceId;
1263
- }
1248
+ const { devices = [], selectedDeviceId, title, onChange, icon } = props;
1249
+ const { t } = videoReactBindings.useI18n();
1264
1250
  const selectedIndex = devices.findIndex((d) => d.deviceId === selectedDeviceId);
1265
1251
  const handleSelect = react.useCallback((index) => {
1266
1252
  onChange?.(devices[index].deviceId);
1267
1253
  }, [devices, onChange]);
1268
- return (jsxRuntime.jsxs("div", { className: "str-video__device-settings__device-kind", children: [jsxRuntime.jsx("div", { className: "str-video__device-settings__device-selector-title", children: title }), jsxRuntime.jsx(DropDownSelect, { icon: icon, defaultSelectedIndex: selectedIndex, defaultSelectedLabel: devices[selectedIndex]?.label, handleSelect: handleSelect, children: devices.map((device) => {
1269
- return (jsxRuntime.jsx(DropDownSelectOption, { icon: icon, label: device.label, selected: device.deviceId === selectedDeviceId || devices.length === 1 }, device.deviceId));
1270
- }) })] }));
1254
+ return (jsxRuntime.jsxs("div", { className: "str-video__device-settings__device-kind", children: [jsxRuntime.jsx("div", { className: "str-video__device-settings__device-selector-title", children: title }), jsxRuntime.jsx(DropDownSelect, { icon: icon, defaultSelectedIndex: selectedIndex, defaultSelectedLabel: devices[selectedIndex]?.label ?? t('Default'), handleSelect: handleSelect, children: devices.length === 0 ? (jsxRuntime.jsx(DropDownSelectOption, { icon: icon, label: t('Default'), selected: true })) : (devices.map((device) => (jsxRuntime.jsx(DropDownSelectOption, { icon: icon, label: device.label, selected: device.deviceId === selectedDeviceId || devices.length === 1 }, device.deviceId)))) })] }));
1271
1255
  };
1272
1256
  const DeviceSelector = (props) => {
1273
1257
  const { visualType = 'list', icon, placeholder, ...rest } = props;
1274
1258
  if (visualType === 'list') {
1275
1259
  return jsxRuntime.jsx(DeviceSelectorList, { ...rest });
1276
1260
  }
1277
- return (jsxRuntime.jsx(DeviceSelectorDropdown, { ...rest, icon: icon, placeholder: placeholder }));
1261
+ return jsxRuntime.jsx(DeviceSelectorDropdown, { ...rest, icon: icon });
1278
1262
  };
1279
1263
 
1280
1264
  const DeviceSelectorAudioInput = ({ title, visualType, }) => {
@@ -2163,6 +2147,7 @@ var Join = "Join";
2163
2147
  var You = "You";
2164
2148
  var Me = "Me";
2165
2149
  var Unknown = "Unknown";
2150
+ var Default = "Default";
2166
2151
  var Refresh = "Refresh";
2167
2152
  var Allow = "Allow";
2168
2153
  var Revoke = "Revoke";
@@ -2213,6 +2198,7 @@ var en = {
2213
2198
  Me: Me,
2214
2199
  Unknown: Unknown,
2215
2200
  "Toggle device menu": "Toggle device menu",
2201
+ Default: Default,
2216
2202
  "Call Recordings": "Call Recordings",
2217
2203
  Refresh: Refresh,
2218
2204
  "Check your browser video permissions": "Check your browser video permissions",
@@ -2576,7 +2562,7 @@ const LivestreamPlayer = (props) => {
2576
2562
  return (jsxRuntime.jsx(StreamCall, { call: call, children: jsxRuntime.jsx(LivestreamLayout, { ...layoutProps }) }));
2577
2563
  };
2578
2564
 
2579
- const [major, minor, patch] = ("1.7.3").split('.');
2565
+ const [major, minor, patch] = ("1.7.5").split('.');
2580
2566
  videoClient.setSdkInfo({
2581
2567
  type: videoClient.SfuModels.SdkType.REACT,
2582
2568
  major,