Virtual backgrounds
The Video SDK for Linux lets you replace a user's camera background with a virtual background. On Linux, the virtual background methods live directly on IZoomVideoSDKVideoHelper. There is no separate virtual background helper. Each background image is represented by an IVirtualBackgroundItem.
Typical flow
To apply a virtual background:
- Add an image with
addVirtualBackgroundItem, which returns anIVirtualBackgroundItemfor the image you added. - Apply it with
setVirtualBackgroundItem. - Remove it later with
removeVirtualBackgroundItem, or read the active item withgetSelectedVirtualBackgroundItem.
Use getVirtualBackgroundItemList to retrieve the items you have added.
Example
IZoomVideoSDKVideoHelper* pVideoHelper = m_pVideoSDK->getVideoHelper();
// Add a background image and apply it.
IVirtualBackgroundItem* pItem = NULL;
if (pVideoHelper->addVirtualBackgroundItem("/path/to/background.jpg", &pItem) == ZoomVideoSDKErrors_Success)
{
pVideoHelper->setVirtualBackgroundItem(pItem);
}
// Remove the background later.
pVideoHelper->removeVirtualBackgroundItem(pItem);
Read an item's image path and name with getImageFilePath and getImageName.