@stream-io/video-react-sdk 0.0.58 → 0.0.60
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 +19 -0
- package/dist/src/components/Notification/PermissionNotification.d.ts +4 -4
- package/dist/src/components/Notification/SpeakingWhileMutedNotification.d.ts +5 -3
- package/dist/src/components/Notification/SpeakingWhileMutedNotification.js +5 -3
- package/dist/src/components/Notification/SpeakingWhileMutedNotification.js.map +1 -1
- package/package.json +3 -3
- package/src/components/Notification/PermissionNotification.tsx +5 -5
- package/src/components/Notification/SpeakingWhileMutedNotification.tsx +16 -8
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
### [0.0.60](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-0.0.59...@stream-io/video-react-sdk-0.0.60) (2023-07-03)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Documentation
|
|
9
|
+
|
|
10
|
+
* **react-sdk:** add PermissionNotification and PermissionRequests docs ([#731](https://github.com/GetStream/stream-video-js/issues/731)) ([7542e70](https://github.com/GetStream/stream-video-js/commit/7542e70eaca436164830d717ea90bdfa99ad5f15))
|
|
11
|
+
|
|
12
|
+
### [0.0.59](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-0.0.58...@stream-io/video-react-sdk-0.0.59) (2023-06-30)
|
|
13
|
+
|
|
14
|
+
### Dependency Updates
|
|
15
|
+
|
|
16
|
+
* `@stream-io/i18n` updated to version `0.0.7`
|
|
17
|
+
* `@stream-io/video-react-bindings` updated to version `0.0.30`
|
|
18
|
+
|
|
19
|
+
### Documentation
|
|
20
|
+
|
|
21
|
+
* **react-sdk:** add CallStats docs ([#735](https://github.com/GetStream/stream-video-js/issues/735)) ([8fb2c15](https://github.com/GetStream/stream-video-js/commit/8fb2c1501a53121dd5dd30a3bbfeee74af0ad63c))
|
|
22
|
+
* **react-sdk:** add SpeakingWhileMutedNotification docs ([#732](https://github.com/GetStream/stream-video-js/issues/732)) ([bdb9daa](https://github.com/GetStream/stream-video-js/commit/bdb9daaf921b0a790fa8013dded2ff1559d95fc9))
|
|
23
|
+
|
|
5
24
|
### [0.0.58](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-0.0.57...@stream-io/video-react-sdk-0.0.58) (2023-06-29)
|
|
6
25
|
|
|
7
26
|
### Dependency Updates
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { OwnCapability } from '@stream-io/video-client';
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
3
|
export type PermissionNotificationProps = PropsWithChildren<{
|
|
4
|
-
/**
|
|
5
|
-
* The permission to check for.
|
|
6
|
-
*/
|
|
7
|
-
permission: OwnCapability;
|
|
8
4
|
/**
|
|
9
5
|
* Set this to true if there is ongoing request for the permission.
|
|
10
6
|
*/
|
|
@@ -24,6 +20,10 @@ export type PermissionNotificationProps = PropsWithChildren<{
|
|
|
24
20
|
* the requested permission is awaiting approval.
|
|
25
21
|
*/
|
|
26
22
|
messageAwaitingApproval: string;
|
|
23
|
+
/**
|
|
24
|
+
* The permission to check for.
|
|
25
|
+
*/
|
|
26
|
+
permission: OwnCapability;
|
|
27
27
|
/**
|
|
28
28
|
* The time in milliseconds to display the notification.
|
|
29
29
|
* Defaults to 3500ms.
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
export type SpeakingWhileMutedNotificationProps = {
|
|
3
|
+
text?: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const SpeakingWhileMutedNotification: ({ children, text, }: PropsWithChildren<SpeakingWhileMutedNotificationProps>) => JSX.Element;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
import { createSoundDetector, SfuModels } from '@stream-io/video-client';
|
|
4
|
-
import { useLocalParticipant } from '@stream-io/video-react-bindings';
|
|
4
|
+
import { useI18n, useLocalParticipant } from '@stream-io/video-react-bindings';
|
|
5
5
|
import { useMediaDevices } from '../../core';
|
|
6
6
|
import { Notification } from './Notification';
|
|
7
|
-
export const SpeakingWhileMutedNotification = ({ children }) => {
|
|
7
|
+
export const SpeakingWhileMutedNotification = ({ children, text, }) => {
|
|
8
8
|
const localParticipant = useLocalParticipant();
|
|
9
9
|
const { getAudioStream } = useMediaDevices();
|
|
10
|
+
const { t } = useI18n();
|
|
11
|
+
const message = text !== null && text !== void 0 ? text : t('You are muted. Unmute to speak.');
|
|
10
12
|
const isAudioMute = !(localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.publishedTracks.includes(SfuModels.TrackType.AUDIO));
|
|
11
13
|
const audioDeviceId = localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.audioDeviceId;
|
|
12
14
|
const [isSpeakingWhileMuted, setIsSpeakingWhileMuted] = useState(false);
|
|
@@ -42,6 +44,6 @@ export const SpeakingWhileMutedNotification = ({ children }) => {
|
|
|
42
44
|
setIsSpeakingWhileMuted(false);
|
|
43
45
|
};
|
|
44
46
|
}, [isSpeakingWhileMuted]);
|
|
45
|
-
return (_jsx(Notification, Object.assign({ message:
|
|
47
|
+
return (_jsx(Notification, Object.assign({ message: message, isVisible: isSpeakingWhileMuted }, { children: children })));
|
|
46
48
|
};
|
|
47
49
|
//# sourceMappingURL=SpeakingWhileMutedNotification.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpeakingWhileMutedNotification.js","sourceRoot":"","sources":["../../../../src/components/Notification/SpeakingWhileMutedNotification.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"SpeakingWhileMutedNotification.js","sourceRoot":"","sources":["../../../../src/components/Notification/Speak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@floating-ui/react": "^0.22.0",
|
|
30
30
|
"@nivo/core": "^0.80.0",
|
|
31
31
|
"@nivo/line": "^0.80.0",
|
|
32
|
-
"@stream-io/i18n": "^0.0.
|
|
32
|
+
"@stream-io/i18n": "^0.0.7",
|
|
33
33
|
"@stream-io/video-client": "^0.0.28",
|
|
34
|
-
"@stream-io/video-react-bindings": "^0.0.
|
|
34
|
+
"@stream-io/video-react-bindings": "^0.0.30",
|
|
35
35
|
"clsx": "^1.2.1",
|
|
36
36
|
"rxjs": "~7.8.1"
|
|
37
37
|
},
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"rimraf": "^3.0.2",
|
|
51
51
|
"typescript": "^4.9.5"
|
|
52
52
|
},
|
|
53
|
-
"version": "0.0.
|
|
53
|
+
"version": "0.0.60"
|
|
54
54
|
}
|
|
@@ -10,11 +10,6 @@ import {
|
|
|
10
10
|
import { useHasPermissions } from '@stream-io/video-react-bindings';
|
|
11
11
|
|
|
12
12
|
export type PermissionNotificationProps = PropsWithChildren<{
|
|
13
|
-
/**
|
|
14
|
-
* The permission to check for.
|
|
15
|
-
*/
|
|
16
|
-
permission: OwnCapability;
|
|
17
|
-
|
|
18
13
|
/**
|
|
19
14
|
* Set this to true if there is ongoing request for the permission.
|
|
20
15
|
*/
|
|
@@ -38,6 +33,11 @@ export type PermissionNotificationProps = PropsWithChildren<{
|
|
|
38
33
|
*/
|
|
39
34
|
messageAwaitingApproval: string;
|
|
40
35
|
|
|
36
|
+
/**
|
|
37
|
+
* The permission to check for.
|
|
38
|
+
*/
|
|
39
|
+
permission: OwnCapability;
|
|
40
|
+
|
|
41
41
|
/**
|
|
42
42
|
* The time in milliseconds to display the notification.
|
|
43
43
|
* Defaults to 3500ms.
|
|
@@ -1,15 +1,26 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
1
|
+
import { PropsWithChildren, useEffect, useState } from 'react';
|
|
2
2
|
import { createSoundDetector, SfuModels } from '@stream-io/video-client';
|
|
3
|
-
import { useLocalParticipant } from '@stream-io/video-react-bindings';
|
|
3
|
+
import { useI18n, useLocalParticipant } from '@stream-io/video-react-bindings';
|
|
4
4
|
|
|
5
5
|
import { useMediaDevices } from '../../core';
|
|
6
6
|
import { Notification } from './Notification';
|
|
7
|
-
import { ChildrenOnly } from '../../types';
|
|
8
7
|
|
|
9
|
-
export
|
|
8
|
+
export type SpeakingWhileMutedNotificationProps = {
|
|
9
|
+
/*
|
|
10
|
+
Text message displayed by the notification.
|
|
11
|
+
*/
|
|
12
|
+
text?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const SpeakingWhileMutedNotification = ({
|
|
16
|
+
children,
|
|
17
|
+
text,
|
|
18
|
+
}: PropsWithChildren<SpeakingWhileMutedNotificationProps>) => {
|
|
10
19
|
const localParticipant = useLocalParticipant();
|
|
11
20
|
const { getAudioStream } = useMediaDevices();
|
|
21
|
+
const { t } = useI18n();
|
|
12
22
|
|
|
23
|
+
const message = text ?? t('You are muted. Unmute to speak.');
|
|
13
24
|
const isAudioMute = !localParticipant?.publishedTracks.includes(
|
|
14
25
|
SfuModels.TrackType.AUDIO,
|
|
15
26
|
);
|
|
@@ -51,10 +62,7 @@ export const SpeakingWhileMutedNotification = ({ children }: ChildrenOnly) => {
|
|
|
51
62
|
};
|
|
52
63
|
}, [isSpeakingWhileMuted]);
|
|
53
64
|
return (
|
|
54
|
-
<Notification
|
|
55
|
-
message="You are muted. Unmute to speak."
|
|
56
|
-
isVisible={isSpeakingWhileMuted}
|
|
57
|
-
>
|
|
65
|
+
<Notification message={message} isVisible={isSpeakingWhileMuted}>
|
|
58
66
|
{children}
|
|
59
67
|
</Notification>
|
|
60
68
|
);
|