@stream-io/video-react-sdk 1.7.5 → 1.7.7
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 +16 -0
- package/dist/index.cjs.js +5 -38
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +2 -35
- package/dist/index.es.js.map +1 -1
- package/dist/src/hooks/index.d.ts +0 -1
- package/package.json +3 -3
- package/src/components/CallControls/RecordCallButton.tsx +5 -2
- package/src/components/Notification/RecordingInProgressNotification.tsx +4 -2
- package/src/hooks/index.ts +0 -1
- package/dist/src/hooks/useToggleCallRecording.d.ts +0 -5
- package/src/hooks/useToggleCallRecording.ts +0 -36
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stream-io/video-react-sdk",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.7",
|
|
4
4
|
"packageManager": "yarn@3.2.4",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"module": "./dist/index.es.js",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@floating-ui/react": "^0.26.24",
|
|
35
|
-
"@stream-io/video-client": "1.10.
|
|
35
|
+
"@stream-io/video-client": "1.10.2",
|
|
36
36
|
"@stream-io/video-filters-web": "0.1.4",
|
|
37
|
-
"@stream-io/video-react-bindings": "1.1.
|
|
37
|
+
"@stream-io/video-react-bindings": "1.1.12",
|
|
38
38
|
"chart.js": "^4.4.4",
|
|
39
39
|
"clsx": "^2.0.0",
|
|
40
40
|
"react-chartjs-2": "^5.2.0"
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
|
|
3
3
|
import { OwnCapability } from '@stream-io/video-client';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
Restricted,
|
|
6
|
+
useI18n,
|
|
7
|
+
useToggleCallRecording,
|
|
8
|
+
} from '@stream-io/video-react-bindings';
|
|
5
9
|
import { CompositeButton } from '../Button/';
|
|
6
10
|
import { Icon } from '../Icon';
|
|
7
11
|
import {
|
|
@@ -11,7 +15,6 @@ import {
|
|
|
11
15
|
useMenuContext,
|
|
12
16
|
} from '../Menu';
|
|
13
17
|
import { LoadingIndicator } from '../LoadingIndicator';
|
|
14
|
-
import { useToggleCallRecording } from '../../hooks';
|
|
15
18
|
import { WithTooltip } from '../Tooltip';
|
|
16
19
|
|
|
17
20
|
export type RecordCallButtonProps = {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { PropsWithChildren, useEffect, useState } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
useI18n,
|
|
4
|
+
useToggleCallRecording,
|
|
5
|
+
} from '@stream-io/video-react-bindings';
|
|
4
6
|
import { Notification } from './Notification';
|
|
5
7
|
|
|
6
8
|
export type RecordingInProgressNotificationProps = {
|
package/src/hooks/index.ts
CHANGED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
-
import { useCall, useCallStateHooks } from '@stream-io/video-react-bindings';
|
|
3
|
-
|
|
4
|
-
export const useToggleCallRecording = () => {
|
|
5
|
-
const call = useCall();
|
|
6
|
-
const { useIsCallRecordingInProgress } = useCallStateHooks();
|
|
7
|
-
const isCallRecordingInProgress = useIsCallRecordingInProgress();
|
|
8
|
-
const [isAwaitingResponse, setIsAwaitingResponse] = useState(false);
|
|
9
|
-
|
|
10
|
-
// TODO: add permissions
|
|
11
|
-
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
// we wait until call.recording_started/stopped event to flips the
|
|
14
|
-
// `isCallRecordingInProgress` state variable.
|
|
15
|
-
// Once the flip happens, we remove the loading indicator
|
|
16
|
-
setIsAwaitingResponse((isAwaiting) => {
|
|
17
|
-
if (isAwaiting) return false;
|
|
18
|
-
return isAwaiting;
|
|
19
|
-
});
|
|
20
|
-
}, [isCallRecordingInProgress]);
|
|
21
|
-
|
|
22
|
-
const toggleCallRecording = useCallback(async () => {
|
|
23
|
-
try {
|
|
24
|
-
setIsAwaitingResponse(true);
|
|
25
|
-
if (isCallRecordingInProgress) {
|
|
26
|
-
await call?.stopRecording();
|
|
27
|
-
} else {
|
|
28
|
-
await call?.startRecording();
|
|
29
|
-
}
|
|
30
|
-
} catch (e) {
|
|
31
|
-
console.error(`Failed start recording`, e);
|
|
32
|
-
}
|
|
33
|
-
}, [call, isCallRecordingInProgress]);
|
|
34
|
-
|
|
35
|
-
return { toggleCallRecording, isAwaitingResponse, isCallRecordingInProgress };
|
|
36
|
-
};
|