@stream-io/video-react-sdk 0.6.9 → 0.6.11
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 +18 -0
- package/dist/index.cjs.js +11 -8
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +11 -8
- package/dist/index.es.js.map +1 -1
- package/package.json +3 -3
- package/src/components/BackgroundFilters/BackgroundFilters.tsx +10 -7
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
### [0.6.11](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-0.6.10...@stream-io/video-react-sdk-0.6.11) (2024-04-25)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **filters:** Synchronize filter loading and unloading ([#1326](https://github.com/GetStream/stream-video-js/issues/1326)) ([cfab745](https://github.com/GetStream/stream-video-js/commit/cfab7455cfde6d7161ac823dc338e51bea00bcce))
|
|
11
|
+
|
|
12
|
+
### [0.6.10](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-0.6.9...@stream-io/video-react-sdk-0.6.10) (2024-04-23)
|
|
13
|
+
|
|
14
|
+
### Dependency Updates
|
|
15
|
+
|
|
16
|
+
* `@stream-io/video-client` updated to version `0.7.7`
|
|
17
|
+
* `@stream-io/video-react-bindings` updated to version `0.4.18`
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* **feedback:** Collect user feedback ([#1324](https://github.com/GetStream/stream-video-js/issues/1324)) ([b415de0](https://github.com/GetStream/stream-video-js/commit/b415de0828e402f8d3b854553351843aad2e8473))
|
|
22
|
+
|
|
5
23
|
### [0.6.9](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-0.6.8...@stream-io/video-react-sdk-0.6.9) (2024-04-23)
|
|
6
24
|
|
|
7
25
|
### Dependency Updates
|
package/dist/index.cjs.js
CHANGED
|
@@ -127,21 +127,24 @@ const BackgroundFilters = (props) => {
|
|
|
127
127
|
const [canvasRef, setCanvasRef] = react.useState(null);
|
|
128
128
|
const [width, setWidth] = react.useState(1920);
|
|
129
129
|
const [height, setHeight] = react.useState(1080);
|
|
130
|
-
|
|
130
|
+
// Holds a ref to the `resolve` function of the returned Promise as part
|
|
131
|
+
// of the `camera.registerFilter()` API. Once the filter is initialized,
|
|
132
|
+
// it should be called with the filtered MediaStream as an argument.
|
|
133
|
+
const signalFilterReadyRef = react.useRef();
|
|
131
134
|
const [mediaStream, setMediaStream] = react.useState();
|
|
132
|
-
const
|
|
135
|
+
const unregister = react.useRef();
|
|
133
136
|
react.useEffect(() => {
|
|
134
137
|
if (!call || !backgroundFilter)
|
|
135
138
|
return;
|
|
136
|
-
|
|
139
|
+
const register = (unregister.current || Promise.resolve()).then(() => call.camera.registerFilter(async (ms) => {
|
|
137
140
|
return new Promise((resolve) => {
|
|
138
141
|
setMediaStream(ms);
|
|
139
|
-
|
|
142
|
+
signalFilterReadyRef.current = resolve;
|
|
140
143
|
});
|
|
141
144
|
}));
|
|
142
145
|
return () => {
|
|
143
|
-
|
|
144
|
-
.then((
|
|
146
|
+
unregister.current = register
|
|
147
|
+
.then((unregisterFilter) => unregisterFilter())
|
|
145
148
|
.then(() => setMediaStream(undefined))
|
|
146
149
|
.catch((err) => console.error('Failed to unregister filter', err));
|
|
147
150
|
};
|
|
@@ -156,7 +159,7 @@ const BackgroundFilters = (props) => {
|
|
|
156
159
|
setWidth(w);
|
|
157
160
|
setHeight(h);
|
|
158
161
|
}
|
|
159
|
-
const resolveFilter =
|
|
162
|
+
const resolveFilter = signalFilterReadyRef.current;
|
|
160
163
|
if (!resolveFilter)
|
|
161
164
|
return;
|
|
162
165
|
const filter = canvasRef.captureStream();
|
|
@@ -2433,7 +2436,7 @@ const VerticalScrollButtons = ({ scrollWrapper, }) => {
|
|
|
2433
2436
|
};
|
|
2434
2437
|
const hasScreenShare = (p) => !!p?.publishedTracks.includes(videoClient.SfuModels.TrackType.SCREEN_SHARE);
|
|
2435
2438
|
|
|
2436
|
-
const [major, minor, patch] = ("0.6.
|
|
2439
|
+
const [major, minor, patch] = ("0.6.11" ).split('.');
|
|
2437
2440
|
videoClient.setSdkInfo({
|
|
2438
2441
|
type: videoClient.SfuModels.SdkType.REACT,
|
|
2439
2442
|
major,
|