Quick Reference
- Settings class:
CometChat.VirtualBackground - Apply via:
CallSettingsBuilder.setVirtualBackground(virtualBackground) - Toggle UI:
CallSettingsBuilder.showVirtualBackgroundSetting(true|false) - Runtime control:
CometChat.CallController.getInstance()→setBackgroundBlur(),setBackgroundImage(),openVirtualBackground() - Requires: Default Calling or Direct Calling setup
Implementation
After setting up Ringing or Call Session, configure virtual background options in your call settings.Settings
Configure virtual background usingCallSettingsBuilder:
| Setting | Description |
|---|---|
showVirtualBackgroundSetting(showVBSettings: boolean) | This method shows/hides the virtual background settings in the menu bar. Default value = true |
setVirtualBackground(virtualBackground: CometChat.VirtualBackground) | This method will set the virtual background setting. This methods takes an Object of Virtual Background Class. |
Open Virtual Background Setting
You can use theopenVirtualBackground() method to open the virtual background settings pop-up.
- JavaScript
- TypeScript
Set Background Blur
You can use thesetBackgroundBlur() method to apply background blur on the video stream. This method accepts a number which decides the level of blur to be applied.
- JavaScript
- TypeScript
Set Background Image
You can use thesetBackgroundImage()method to set the background image. This method takes either a URL or file Object & sets that image as the background.
- JavaScript
- TypeScript
Virtual Background Settings
TheVirtualBackground class controls how users interact with virtual background features. Pass a VirtualBackground instance to setVirtualBackground() in CallSettingsBuilder.
| Setting | Description |
|---|---|
allowBackgroundBlur(allowBackgroundBlur: boolean) | This method shows/hides the ability to allow end user to blur background. Default = true |
allowUserImages(allowUserImages: boolean) | This method shows/hides the ability to allow end user to add their own custom background image. Default = true |
showDefaultImages(showDefaultImages: boolean) | This method shows/hides the ability to allow end user to choose from default background images. Default = true |
setImages(images: Array<String>) | This method allows developer to add their custom background image which the end user can choose. |
enforceBackgroundBlur(enforceBackgroundBlur: number) | This method starts the call with background blurred. To blur the background you need to pass an integer value between 1-99 which decides the blur level. Default = 0 |
enforceBackgroundImage(enforceBackgroundImage: string) | This methods starts the call with the provided background image. |
Next Steps
Video View Customisation
Customize the main video container layout.
Recording
Record calls for playback.
Presenter Mode
Enable screen sharing and presenter mode.
Custom CSS
Customize the calling UI appearance.