@stream-io/video-react-sdk 1.33.3 → 1.33.4
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 +10 -0
- package/dist/embedded.cjs.js +11 -4
- package/dist/embedded.cjs.js.map +1 -1
- package/dist/embedded.es.js +11 -4
- package/dist/embedded.es.js.map +1 -1
- package/dist/index.cjs.js +12 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +12 -5
- package/dist/index.es.js.map +1 -1
- package/dist/src/components/NoiseCancellation/NoiseCancellationProvider.d.ts +4 -0
- package/package.json +2 -2
- package/src/components/NoiseCancellation/NoiseCancellationProvider.tsx +15 -3
package/dist/index.cjs.js
CHANGED
|
@@ -1347,7 +1347,7 @@ const SpeakerTest = (props) => {
|
|
|
1347
1347
|
const audioElementRef = react.useRef(null);
|
|
1348
1348
|
const [isPlaying, setIsPlaying] = react.useState(false);
|
|
1349
1349
|
const { t } = videoReactBindings.useI18n();
|
|
1350
|
-
const { audioUrl = `https://unpkg.com/${"@stream-io/video-react-sdk"}@${"1.33.
|
|
1350
|
+
const { audioUrl = `https://unpkg.com/${"@stream-io/video-react-sdk"}@${"1.33.4"}/assets/piano.mp3`, } = props;
|
|
1351
1351
|
// Update audio output device when selection changes
|
|
1352
1352
|
react.useEffect(() => {
|
|
1353
1353
|
const audio = audioElementRef.current;
|
|
@@ -2024,6 +2024,7 @@ const NoiseCancellationProvider = (props) => {
|
|
|
2024
2024
|
}, [noiseCancellation]);
|
|
2025
2025
|
const isSupported = isSupportedByBrowser && hasCapability && noiseCancellationAllowed;
|
|
2026
2026
|
const [isEnabled, setIsEnabled] = react.useState(false);
|
|
2027
|
+
const [isReady, setIsReady] = react.useState(false);
|
|
2027
2028
|
const deinit = react.useRef(undefined);
|
|
2028
2029
|
react.useEffect(() => {
|
|
2029
2030
|
if (!call || !isSupported)
|
|
@@ -2032,17 +2033,23 @@ const NoiseCancellationProvider = (props) => {
|
|
|
2032
2033
|
const unsubscribe = noiseCancellation.on('change', (v) => setIsEnabled(v));
|
|
2033
2034
|
const init = (deinit.current || Promise.resolve())
|
|
2034
2035
|
.then(() => noiseCancellation.init({ tracer: call.tracer }))
|
|
2035
|
-
.then(() =>
|
|
2036
|
+
.then(() => {
|
|
2037
|
+
setIsReady(true);
|
|
2038
|
+
return call.microphone.enableNoiseCancellation(noiseCancellation);
|
|
2039
|
+
})
|
|
2036
2040
|
.catch((e) => console.error(`Can't initialize noise cancellation`, e));
|
|
2037
2041
|
return () => {
|
|
2038
2042
|
deinit.current = init
|
|
2039
2043
|
.then(() => call.microphone.disableNoiseCancellation())
|
|
2040
2044
|
.then(() => noiseCancellation.dispose())
|
|
2041
|
-
.then(() => unsubscribe())
|
|
2045
|
+
.then(() => unsubscribe())
|
|
2046
|
+
.catch((e) => console.error("Can't clean up noise cancellation", e))
|
|
2047
|
+
.finally(() => setIsReady(false));
|
|
2042
2048
|
};
|
|
2043
2049
|
}, [call, isSupported, noiseCancellation]);
|
|
2044
2050
|
const contextValue = react.useMemo(() => ({
|
|
2045
2051
|
isSupported,
|
|
2052
|
+
isReady,
|
|
2046
2053
|
isEnabled,
|
|
2047
2054
|
setSuppressionLevel: (level) => {
|
|
2048
2055
|
if (!noiseCancellation)
|
|
@@ -2066,7 +2073,7 @@ const NoiseCancellationProvider = (props) => {
|
|
|
2066
2073
|
});
|
|
2067
2074
|
}
|
|
2068
2075
|
},
|
|
2069
|
-
}), [isEnabled, isSupported, noiseCancellation]);
|
|
2076
|
+
}), [isEnabled, isReady, isSupported, noiseCancellation]);
|
|
2070
2077
|
return (jsxRuntime.jsx(NoiseCancellationContext.Provider, { value: contextValue, children: children }));
|
|
2071
2078
|
};
|
|
2072
2079
|
|
|
@@ -3137,7 +3144,7 @@ const checkCanJoinEarly = (startsAt, joinAheadTimeSeconds) => {
|
|
|
3137
3144
|
return Date.now() >= +startsAt - (joinAheadTimeSeconds ?? 0) * 1000;
|
|
3138
3145
|
};
|
|
3139
3146
|
|
|
3140
|
-
const [major, minor, patch] = ("1.33.
|
|
3147
|
+
const [major, minor, patch] = ("1.33.4").split('.');
|
|
3141
3148
|
videoClient.setSdkInfo({
|
|
3142
3149
|
type: videoClient.SfuModels.SdkType.REACT,
|
|
3143
3150
|
major,
|