@stream-io/video-filters-web 0.7.3 → 0.7.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 +6 -0
- package/dist/index.cjs.js +7 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +7 -5
- package/dist/index.es.js.map +1 -1
- package/package.json +2 -2
- package/src/VirtualBackground.ts +8 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stream-io/video-filters-web",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.4",
|
|
4
4
|
"main": "./dist/index.cjs.js",
|
|
5
5
|
"module": "./dist/index.es.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"CHANGELOG.md"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@mediapipe/tasks-vision": "^0.10.
|
|
31
|
+
"@mediapipe/tasks-vision": "^0.10.34",
|
|
32
32
|
"@stream-io/worker-timer": "^1.2.5",
|
|
33
33
|
"wasm-feature-detect": "^1.8.0"
|
|
34
34
|
},
|
package/src/VirtualBackground.ts
CHANGED
|
@@ -63,8 +63,9 @@ export class VirtualBackground extends BaseVideoProcessor {
|
|
|
63
63
|
|
|
64
64
|
this.isSegmenterReady = true;
|
|
65
65
|
} catch (error) {
|
|
66
|
-
console.error('[virtual-background] Segmenter init failed:', error);
|
|
67
66
|
this.isSegmenterReady = false;
|
|
67
|
+
this.hooks.onError?.(error);
|
|
68
|
+
throw error;
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
71
|
|
|
@@ -145,8 +146,12 @@ export class VirtualBackground extends BaseVideoProcessor {
|
|
|
145
146
|
|
|
146
147
|
private async loadBackground(url?: string) {
|
|
147
148
|
if (!url) return null;
|
|
148
|
-
const result = await fetch(url);
|
|
149
|
-
if (!result.ok)
|
|
149
|
+
const result = await fetch(url, { signal: this.abortController.signal });
|
|
150
|
+
if (!result.ok) {
|
|
151
|
+
throw new Error(
|
|
152
|
+
`[virtual-background] Failed to load background image: ${result.status} ${result.statusText}`,
|
|
153
|
+
);
|
|
154
|
+
}
|
|
150
155
|
|
|
151
156
|
return {
|
|
152
157
|
type: 'image',
|