configureVirtualBackground()

configureVirtualBackground(options: VirtualBackgroundOptions)
Enables or modifies (if already enabled) the virtual background for local user with given options. Either blur, image or imageUrl field needs to be specified. The enforce param is optional and if set to true, then it will make it impossible for the local user to manually change the virtual background once entered inside the room.
VirtualBackgroundOptions {
enforce?: boolean;
blur?: 'balanced' | 'strong';
image?: string;
imageUrl?: string;
}
Possible predefined values for image are: "office", "office2", "beach", "fireworks", "bookshelf", "forest", "mountain", "savannah"
//Enables strong blur of the background for the local user
sambaFrame.configureVirtualBackground({blur: 'strong'});
/*Enables balanced blur of the background for the local user and enforces it,
so the user cannot change it once inside the room*/
sambaFrame.configureVirtualBackground({blur: 'balanced', enforce: true});
//Sets a forest virtual background for the local user
sambaFrame.configureVirtualBackground({image: 'forest'});
//Sets an image from a public url as a virtual background for the local user
sambaFrame.configureVirtualBackground({imageUrl: 'https://someUrlOfAnImageHere'});
Sample use cases:
  • You may want to control virtual background for the local user dynamically during the meeting.
The related events are virtualBackgroundChanged and virtualBackgroundDisabled if you want to be informed when the virtual background settings have been changed.