Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat(virtual-background): default to V2 engine unless explicitly disabled

Jaya Allamsetty92dc6bf1f9bb
diff --git a/react/features/stream-effects/virtual-background/JitsiStreamBackgroundEffect.ts b/react/features/stream-effects/virtual-background/JitsiStreamBackgroundEffect.ts
index 3a03221e2e..fd79d165ac 100644
--- a/react/features/stream-effects/virtual-background/JitsiStreamBackgroundEffect.ts
+++ b/react/features/stream-effects/virtual-background/JitsiStreamBackgroundEffect.ts
@@ -38,12 +38,13 @@ export interface IV2EffectInit {
/**
* Virtual background stream effect.
*
- * When {@code enableV2} is false (default), the class behaves identically to the original V1
+ * When {@code enableV2} is false, the class behaves identically to the original V1
* engine: main-thread TFLite WASM inference, Canvas 2D compositing, TimerWorker frame driver.
*
- * When {@code enableV2} is true, the constructor delegates to the pipeline/backend/compositor
- * abstraction: Worker-based inference, WebGL compositing, and insertable streams (with
- * captureStream fallback). The captureStream fallback reuses the shared video/canvas/timer.
+ * When {@code enableV2} is true (default), the constructor delegates to the
+ * pipeline/backend/compositor abstraction: Worker-based inference, WebGL compositing, and
+ * insertable streams (with captureStream fallback). The captureStream fallback reuses the
+ * shared video/canvas/timer.
*/
export default class JitsiStreamBackgroundEffect {
_backend: WorkerSegmentationBackend | null = null;
diff --git a/react/features/stream-effects/virtual-background/index.ts b/react/features/stream-effects/virtual-background/index.ts
index e7cadaa80b..9cb1347ad8 100644
--- a/react/features/stream-effects/virtual-background/index.ts
+++ b/react/features/stream-effects/virtual-background/index.ts
@@ -38,8 +38,12 @@ export async function createVirtualBackgroundEffect(virtualBackground: IVirtualB
}
const fullVbConfig = APP.store.getState()['features/base/config'].virtualBackground;
- if (fullVbConfig?.enableV2) {
- const vbConfig = fullVbConfig.advanced;
+ // V2 is the default engine. V1 is only used when enableV2 is explicitly set to false.
+ // (The type of enableV2 is `boolean | undefined` per IConfig, so `undefined` picks V2.)
+ const useV2Engine = fullVbConfig?.enableV2 !== false;
+
+ if (useV2Engine) {
+ const vbConfig = fullVbConfig?.advanced;
const capabilities = await detectDeviceTier(vbConfig);
logger.info(