@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/dist/index.es.js
CHANGED
|
@@ -1559,7 +1559,7 @@ const createTFLiteSIMDModule = (__Module) => {
|
|
|
1559
1559
|
return __Module.ready;
|
|
1560
1560
|
};
|
|
1561
1561
|
|
|
1562
|
-
const version = "0.7.
|
|
1562
|
+
const version = "0.7.4";
|
|
1563
1563
|
const packageName = "@stream-io/video-filters-web";
|
|
1564
1564
|
|
|
1565
1565
|
// @ts-expect-error - module is not declared
|
|
@@ -2581,8 +2581,9 @@ class VirtualBackground extends BaseVideoProcessor {
|
|
|
2581
2581
|
this.isSegmenterReady = true;
|
|
2582
2582
|
}
|
|
2583
2583
|
catch (error) {
|
|
2584
|
-
console.error('[virtual-background] Segmenter init failed:', error);
|
|
2585
2584
|
this.isSegmenterReady = false;
|
|
2585
|
+
this.hooks.onError?.(error);
|
|
2586
|
+
throw error;
|
|
2586
2587
|
}
|
|
2587
2588
|
}
|
|
2588
2589
|
async transform(frame) {
|
|
@@ -2648,9 +2649,10 @@ class VirtualBackground extends BaseVideoProcessor {
|
|
|
2648
2649
|
async loadBackground(url) {
|
|
2649
2650
|
if (!url)
|
|
2650
2651
|
return null;
|
|
2651
|
-
const result = await fetch(url);
|
|
2652
|
-
if (!result.ok)
|
|
2653
|
-
|
|
2652
|
+
const result = await fetch(url, { signal: this.abortController.signal });
|
|
2653
|
+
if (!result.ok) {
|
|
2654
|
+
throw new Error(`[virtual-background] Failed to load background image: ${result.status} ${result.statusText}`);
|
|
2655
|
+
}
|
|
2654
2656
|
return {
|
|
2655
2657
|
type: 'image',
|
|
2656
2658
|
media: await createImageBitmap(await result.blob()),
|