@stream-io/video-react-sdk 1.7.4 → 1.7.6
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 +21 -0
- package/dist/index.cjs.js +14 -61
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +11 -58
- package/dist/index.es.js.map +1 -1
- package/dist/src/hooks/index.d.ts +0 -1
- package/dist/src/translations/index.d.ts +1 -0
- package/package.json +3 -3
- package/src/components/CallControls/RecordCallButton.tsx +5 -2
- package/src/components/DeviceSettings/DeviceSelector.tsx +15 -49
- package/src/components/Notification/RecordingInProgressNotification.tsx +4 -2
- package/src/hooks/index.ts +0 -1
- package/src/translations/en.json +1 -0
- package/dist/src/hooks/useToggleCallRecording.d.ts +0 -5
- package/src/hooks/useToggleCallRecording.ts +0 -36
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [1.7.6](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-1.7.5...@stream-io/video-react-sdk-1.7.6) (2024-11-01)
|
|
6
|
+
|
|
7
|
+
### Dependency Updates
|
|
8
|
+
|
|
9
|
+
* `@stream-io/video-react-bindings` updated to version `1.1.11`
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* move useToggleCallRecording to react-bindings ([#1545](https://github.com/GetStream/stream-video-js/issues/1545)) ([73014ca](https://github.com/GetStream/stream-video-js/commit/73014ca6a4585680f581c4e9481c2d286f2fcd37))
|
|
14
|
+
|
|
15
|
+
## [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)
|
|
16
|
+
|
|
17
|
+
### Dependency Updates
|
|
18
|
+
|
|
19
|
+
* `@stream-io/video-client` updated to version `1.10.1`
|
|
20
|
+
* `@stream-io/video-react-bindings` updated to version `1.1.10`
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* various device selector issues ([#1541](https://github.com/GetStream/stream-video-js/issues/1541)) ([f23618b](https://github.com/GetStream/stream-video-js/commit/f23618bda447eeb2d66f908bdb38b24db051f87c))
|
|
25
|
+
|
|
5
26
|
## [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)
|
|
6
27
|
|
|
7
28
|
### Dependency Updates
|
package/dist/index.cjs.js
CHANGED
|
@@ -245,39 +245,6 @@ const useHorizontalScrollPosition = (scrollElement, threshold = SCROLL_THRESHOLD
|
|
|
245
245
|
return scrollPosition;
|
|
246
246
|
};
|
|
247
247
|
|
|
248
|
-
const useToggleCallRecording = () => {
|
|
249
|
-
const call = videoReactBindings.useCall();
|
|
250
|
-
const { useIsCallRecordingInProgress } = videoReactBindings.useCallStateHooks();
|
|
251
|
-
const isCallRecordingInProgress = useIsCallRecordingInProgress();
|
|
252
|
-
const [isAwaitingResponse, setIsAwaitingResponse] = react.useState(false);
|
|
253
|
-
// TODO: add permissions
|
|
254
|
-
react.useEffect(() => {
|
|
255
|
-
// we wait until call.recording_started/stopped event to flips the
|
|
256
|
-
// `isCallRecordingInProgress` state variable.
|
|
257
|
-
// Once the flip happens, we remove the loading indicator
|
|
258
|
-
setIsAwaitingResponse((isAwaiting) => {
|
|
259
|
-
if (isAwaiting)
|
|
260
|
-
return false;
|
|
261
|
-
return isAwaiting;
|
|
262
|
-
});
|
|
263
|
-
}, [isCallRecordingInProgress]);
|
|
264
|
-
const toggleCallRecording = react.useCallback(async () => {
|
|
265
|
-
try {
|
|
266
|
-
setIsAwaitingResponse(true);
|
|
267
|
-
if (isCallRecordingInProgress) {
|
|
268
|
-
await call?.stopRecording();
|
|
269
|
-
}
|
|
270
|
-
else {
|
|
271
|
-
await call?.startRecording();
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
catch (e) {
|
|
275
|
-
console.error(`Failed start recording`, e);
|
|
276
|
-
}
|
|
277
|
-
}, [call, isCallRecordingInProgress]);
|
|
278
|
-
return { toggleCallRecording, isAwaitingResponse, isCallRecordingInProgress };
|
|
279
|
-
};
|
|
280
|
-
|
|
281
248
|
const useRequestPermission = (permission) => {
|
|
282
249
|
const call = videoReactBindings.useCall();
|
|
283
250
|
const { useHasPermissions } = videoReactBindings.useCallStateHooks();
|
|
@@ -930,7 +897,7 @@ const SpeakingWhileMutedNotification = ({ children, text, placement, }) => {
|
|
|
930
897
|
|
|
931
898
|
const RecordingInProgressNotification = ({ children, text, }) => {
|
|
932
899
|
const { t } = videoReactBindings.useI18n();
|
|
933
|
-
const { isCallRecordingInProgress } = useToggleCallRecording();
|
|
900
|
+
const { isCallRecordingInProgress } = videoReactBindings.useToggleCallRecording();
|
|
934
901
|
const [isVisible, setVisible] = react.useState(false);
|
|
935
902
|
const message = text ?? t('Recording in progress...');
|
|
936
903
|
react.useEffect(() => {
|
|
@@ -990,7 +957,7 @@ const WithTooltip = ({ title, tooltipClassName, tooltipPlacement, tooltipDisable
|
|
|
990
957
|
|
|
991
958
|
const RecordEndConfirmation = () => {
|
|
992
959
|
const { t } = videoReactBindings.useI18n();
|
|
993
|
-
const { toggleCallRecording, isAwaitingResponse } = useToggleCallRecording();
|
|
960
|
+
const { toggleCallRecording, isAwaitingResponse } = videoReactBindings.useToggleCallRecording();
|
|
994
961
|
const { close } = useMenuContext();
|
|
995
962
|
return (jsxRuntime.jsxs("div", { className: "str-video__end-recording__confirmation", children: [jsxRuntime.jsxs("div", { className: "str-video__end-recording__header", children: [jsxRuntime.jsx(Icon, { icon: "recording-on" }), jsxRuntime.jsx("h2", { className: "str-video__end-recording__heading", children: t('End recording') })] }), jsxRuntime.jsx("p", { className: "str-video__end-recording__description", children: t('Are you sure you want end the recording?') }), jsxRuntime.jsxs("div", { className: "str-video__end-recording__actions", children: [jsxRuntime.jsx(CompositeButton, { variant: "secondary", onClick: close, children: t('Cancel') }), jsxRuntime.jsx(CompositeButton, { variant: "primary", onClick: toggleCallRecording, children: isAwaitingResponse ? jsxRuntime.jsx(LoadingIndicator, {}) : t('End recording') })] })] }));
|
|
996
963
|
};
|
|
@@ -999,7 +966,7 @@ const ToggleEndRecordingMenuButton = react.forwardRef(function ToggleEndRecordin
|
|
|
999
966
|
});
|
|
1000
967
|
const RecordCallConfirmationButton = ({ caption, }) => {
|
|
1001
968
|
const { t } = videoReactBindings.useI18n();
|
|
1002
|
-
const { toggleCallRecording, isAwaitingResponse, isCallRecordingInProgress } = useToggleCallRecording();
|
|
969
|
+
const { toggleCallRecording, isAwaitingResponse, isCallRecordingInProgress } = videoReactBindings.useToggleCallRecording();
|
|
1003
970
|
if (isCallRecordingInProgress) {
|
|
1004
971
|
return (jsxRuntime.jsx(videoReactBindings.Restricted, { requiredGrants: [
|
|
1005
972
|
videoClient.OwnCapability.START_RECORD_CALL,
|
|
@@ -1016,7 +983,7 @@ const RecordCallConfirmationButton = ({ caption, }) => {
|
|
|
1016
983
|
};
|
|
1017
984
|
const RecordCallButton = ({ caption }) => {
|
|
1018
985
|
const { t } = videoReactBindings.useI18n();
|
|
1019
|
-
const { toggleCallRecording, isAwaitingResponse, isCallRecordingInProgress } = useToggleCallRecording();
|
|
986
|
+
const { toggleCallRecording, isAwaitingResponse, isCallRecordingInProgress } = videoReactBindings.useToggleCallRecording();
|
|
1020
987
|
let title = caption ?? t('Record call');
|
|
1021
988
|
if (isAwaitingResponse) {
|
|
1022
989
|
title = isCallRecordingInProgress
|
|
@@ -1234,17 +1201,10 @@ const DeviceSelectorOption = ({ disabled, id, label, onChange, name, selected, d
|
|
|
1234
1201
|
}), htmlFor: id, children: [jsxRuntime.jsx("input", { type: "radio", name: name, onChange: onChange, value: value, id: id, checked: selected, defaultChecked: defaultChecked, disabled: disabled }), label] }));
|
|
1235
1202
|
};
|
|
1236
1203
|
const DeviceSelectorList = (props) => {
|
|
1237
|
-
const { devices = [], selectedDeviceId
|
|
1204
|
+
const { devices = [], selectedDeviceId, title, type, onChange } = props;
|
|
1238
1205
|
const { close } = useMenuContext();
|
|
1239
|
-
|
|
1240
|
-
|
|
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) => {
|
|
1206
|
+
const { t } = videoReactBindings.useI18n();
|
|
1207
|
+
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
1208
|
return (jsxRuntime.jsx(DeviceSelectorOption, { id: `${type}--${device.deviceId}`, value: device.deviceId, label: device.label, onChange: (e) => {
|
|
1249
1209
|
onChange?.(e.target.value);
|
|
1250
1210
|
close?.();
|
|
@@ -1252,29 +1212,20 @@ const DeviceSelectorList = (props) => {
|
|
|
1252
1212
|
}))] }));
|
|
1253
1213
|
};
|
|
1254
1214
|
const DeviceSelectorDropdown = (props) => {
|
|
1255
|
-
const { devices = [], selectedDeviceId
|
|
1256
|
-
|
|
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
|
-
}
|
|
1215
|
+
const { devices = [], selectedDeviceId, title, onChange, icon } = props;
|
|
1216
|
+
const { t } = videoReactBindings.useI18n();
|
|
1264
1217
|
const selectedIndex = devices.findIndex((d) => d.deviceId === selectedDeviceId);
|
|
1265
1218
|
const handleSelect = react.useCallback((index) => {
|
|
1266
1219
|
onChange?.(devices[index].deviceId);
|
|
1267
1220
|
}, [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
|
-
}) })] }));
|
|
1221
|
+
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
1222
|
};
|
|
1272
1223
|
const DeviceSelector = (props) => {
|
|
1273
1224
|
const { visualType = 'list', icon, placeholder, ...rest } = props;
|
|
1274
1225
|
if (visualType === 'list') {
|
|
1275
1226
|
return jsxRuntime.jsx(DeviceSelectorList, { ...rest });
|
|
1276
1227
|
}
|
|
1277
|
-
return
|
|
1228
|
+
return jsxRuntime.jsx(DeviceSelectorDropdown, { ...rest, icon: icon });
|
|
1278
1229
|
};
|
|
1279
1230
|
|
|
1280
1231
|
const DeviceSelectorAudioInput = ({ title, visualType, }) => {
|
|
@@ -2163,6 +2114,7 @@ var Join = "Join";
|
|
|
2163
2114
|
var You = "You";
|
|
2164
2115
|
var Me = "Me";
|
|
2165
2116
|
var Unknown = "Unknown";
|
|
2117
|
+
var Default = "Default";
|
|
2166
2118
|
var Refresh = "Refresh";
|
|
2167
2119
|
var Allow = "Allow";
|
|
2168
2120
|
var Revoke = "Revoke";
|
|
@@ -2213,6 +2165,7 @@ var en = {
|
|
|
2213
2165
|
Me: Me,
|
|
2214
2166
|
Unknown: Unknown,
|
|
2215
2167
|
"Toggle device menu": "Toggle device menu",
|
|
2168
|
+
Default: Default,
|
|
2216
2169
|
"Call Recordings": "Call Recordings",
|
|
2217
2170
|
Refresh: Refresh,
|
|
2218
2171
|
"Check your browser video permissions": "Check your browser video permissions",
|
|
@@ -2576,7 +2529,7 @@ const LivestreamPlayer = (props) => {
|
|
|
2576
2529
|
return (jsxRuntime.jsx(StreamCall, { call: call, children: jsxRuntime.jsx(LivestreamLayout, { ...layoutProps }) }));
|
|
2577
2530
|
};
|
|
2578
2531
|
|
|
2579
|
-
const [major, minor, patch] = ("1.7.
|
|
2532
|
+
const [major, minor, patch] = ("1.7.6").split('.');
|
|
2580
2533
|
videoClient.setSdkInfo({
|
|
2581
2534
|
type: videoClient.SfuModels.SdkType.REACT,
|
|
2582
2535
|
major,
|