enableVirtualBackground method

FutureOr<int> enableVirtualBackground(
  1. String modelPath,
  2. VirtualBackgroundSource source
)

@detail api @author zhushufan.ref @brief Sets the original background to a specified image or a solid color. @param backgroundStickerRes The absolute path of virtual background effects. @param source Virtual background source. See VirtualBackgroundSource{@link #VirtualBackgroundSource}. @return - 0: Success. - –1000: The Effects SDK is not integrated. - –1001: This API is unavailable for your Effects SDK. - –1002: Your Effects SDK's version is incompatible. - < 0: Other error. See error code table for specific instructions. @note - You must call initCVResource{@link #IVideoEffect#initCVResource} before calling this API. - Call disableVirtualBackground{@link #IVideoEffect#disableVirtualBackground} to turn off the virtual background.

Implementation

FutureOr<int> enableVirtualBackground(
    String modelPath, VirtualBackgroundSource source) async {
  return await nativeCall('enableVirtualBackground', [modelPath, source]);
}