The APIs are on the global singleton
MeetingKit, not on MeetingKitRoom—virtual background applies to the single shared camera capture pipeline in the process, so it’s a device-level setting that applies to all rooms at once. When you’re in multiple rooms at the same time, there’s no way to “turn on virtual background for just one room.”Switching cameras during the meeting (switchCamera) and reconnecting after a disconnect both rebuild the capture pipeline, and the SDK automatically replays the whole current configuration, so you don’t need to re-apply anything at these points.Step 1: Install the virtual background component
We recommend installing it before you need virtual background, for example when entering the meeting page. Passnil for modelPath to use the SDK’s built-in person segmentation model.
Step 2: Set the background effect
Background blur and background replacement are mutually exclusive; the later call wins. Both APIs are remembered even if called before installation and take effect automatically once installation completes, so you don’t need to care about their order relative toinstallVirtualBackground:.
Step 3: Turn virtual background on or off
After installation, it’s off by default and must be turned on explicitly. When off, frames pass straight through with zero overhead, and no inference runs.SEAErrorConflict. Turning it off clears the inter-frame state, so the next time it’s turned on it converges again from the first frame and doesn’t flash a stale mask.
Step 4: Keep the frame rate up on low-end devices (optional)
By default, person segmentation runs on every frame. On low-end devices, you can increase the inference interval, trading mask reuse for frame rate; then turn on mask sync as needed to eliminate trailing artifacts.When
inferenceInterval is 1, turning setVirtualBackgroundMaskSync: on or off makes no difference at all—it only takes effect after you increase the inference interval.