Ask one question about whether background effects can run

- The menu asked the browser; the pipeline asked the browser and for a
  desktop. On a phone whose browser can run them, blur was offered and
  then refused: the toggle moved and the video did not change.
- Both now ask one function, and it asks the browser alone. The platform
  was the wrong measure: a phone on the fast route held 99% of its frame
  rate and was refused, a desktop on the slow one held 73% and was
  allowed.
- The in-call device switcher is still withheld on a phone; that is the
  device menu's own rule and is unchanged.
- The provider tests run as a phone, and fail with the desktop test back.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
fkwp
2026-10-08 12:22:34 +02:00
co-authored by Claude Opus 5.5
parent 9823103ef7
commit e2b89a64b9
5 changed files with 88 additions and 12 deletions
+11 -1
View File
@@ -48,10 +48,11 @@ vi.mock("@livekit/track-processors", () => ({
}),
supportsBackgroundProcessors: (): boolean => true,
}));
// A phone: the pipeline must not ask.
vi.mock("../Platform", () => ({ platform: "ios" }));
vi.mock("./BackgroundEffectTransformer", () => ({
BackgroundEffectTransformer: vi.fn(),
}));
vi.mock("../Platform", () => ({ platform: "desktop" }));
const processor = {} as ProcessorWrapper<BackgroundOptions>;
@@ -193,6 +194,15 @@ describe("ProcessorProvider", () => {
expect(track.stopProcessor).not.toHaveBeenCalled();
});
it("runs on a phone whose browser can run it", async () => {
const track = cameraTrack();
render(surfaces(track));
await blur(true);
expect(latest().supported).toBe(true);
expect(track.setProcessor).toHaveBeenCalledWith(latest().processor);
});
it("preview and call share one pipeline", async () => {
const preview = cameraTrack();
const call = cameraTrack();