@stream-io/video-react-sdk 1.1.4 → 1.2.0
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 +14 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +14 -4
- package/dist/index.es.js.map +1 -1
- package/dist/src/components/NoiseCancellation/NoiseCancellationProvider.d.ts +1 -1
- package/package.json +4 -4
- package/src/components/NoiseCancellation/NoiseCancellationProvider.tsx +25 -4
|
@@ -14,7 +14,7 @@ export type NoiseCancellationAPI = {
|
|
|
14
14
|
* A boolean providing information whether Noise Cancelling functionalities
|
|
15
15
|
* are supported on this platform and for the current user.
|
|
16
16
|
*/
|
|
17
|
-
isSupported: boolean;
|
|
17
|
+
isSupported: boolean | undefined;
|
|
18
18
|
/**
|
|
19
19
|
* Provides information whether Noise Cancellation is active or not.
|
|
20
20
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stream-io/video-react-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"packageManager": "yarn@3.2.4",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"module": "./dist/index.es.js",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@floating-ui/react": "^0.26.5",
|
|
32
|
-
"@stream-io/video-client": "1.
|
|
32
|
+
"@stream-io/video-client": "1.3.0",
|
|
33
33
|
"@stream-io/video-filters-web": "0.1.1",
|
|
34
|
-
"@stream-io/video-react-bindings": "0.4.
|
|
34
|
+
"@stream-io/video-react-bindings": "0.4.42",
|
|
35
35
|
"chart.js": "^4.4.1",
|
|
36
36
|
"clsx": "^2.0.0",
|
|
37
37
|
"react-chartjs-2": "^5.2.0"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@rollup/plugin-json": "^6.1.0",
|
|
44
44
|
"@rollup/plugin-replace": "^5.0.5",
|
|
45
45
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
46
|
-
"@stream-io/audio-filters-web": "^0.
|
|
46
|
+
"@stream-io/audio-filters-web": "^0.2.0",
|
|
47
47
|
"@stream-io/video-styling": "^1.0.4",
|
|
48
48
|
"@types/react": "^18.3.2",
|
|
49
49
|
"react": "^18.3.1",
|
|
@@ -28,7 +28,7 @@ export type NoiseCancellationAPI = {
|
|
|
28
28
|
* A boolean providing information whether Noise Cancelling functionalities
|
|
29
29
|
* are supported on this platform and for the current user.
|
|
30
30
|
*/
|
|
31
|
-
isSupported: boolean;
|
|
31
|
+
isSupported: boolean | undefined;
|
|
32
32
|
/**
|
|
33
33
|
* Provides information whether Noise Cancellation is active or not.
|
|
34
34
|
*/
|
|
@@ -76,10 +76,31 @@ export const NoiseCancellationProvider = (
|
|
|
76
76
|
const hasCapability = useHasPermissions(
|
|
77
77
|
OwnCapability.ENABLE_NOISE_CANCELLATION,
|
|
78
78
|
);
|
|
79
|
+
const [isSupportedByBrowser, setIsSupportedByBrowser] = useState<
|
|
80
|
+
boolean | undefined
|
|
81
|
+
>(undefined);
|
|
82
|
+
|
|
83
|
+
useEffect(() => {
|
|
84
|
+
const result = noiseCancellation.isSupported();
|
|
85
|
+
|
|
86
|
+
if (typeof result === 'boolean') {
|
|
87
|
+
setIsSupportedByBrowser(result);
|
|
88
|
+
} else {
|
|
89
|
+
result
|
|
90
|
+
.then((_isSupportedByBrowser) =>
|
|
91
|
+
setIsSupportedByBrowser(_isSupportedByBrowser),
|
|
92
|
+
)
|
|
93
|
+
.catch((err) =>
|
|
94
|
+
console.error(
|
|
95
|
+
`Can't determine if noise cancellation is supported`,
|
|
96
|
+
err,
|
|
97
|
+
),
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
}, [noiseCancellation]);
|
|
101
|
+
|
|
79
102
|
const isSupported =
|
|
80
|
-
hasCapability &&
|
|
81
|
-
noiseCancellationAllowed &&
|
|
82
|
-
noiseCancellation.isSupported();
|
|
103
|
+
isSupportedByBrowser && hasCapability && noiseCancellationAllowed;
|
|
83
104
|
|
|
84
105
|
const [isEnabled, setIsEnabled] = useState(false);
|
|
85
106
|
const deinit = useRef<Promise<void>>();
|