enableVirtualBackground static method

Future<void> enableVirtualBackground({
  1. required Uint8List backgroundImage,
  2. double thresholdConfidence = 0.7,
})

Implementation

static Future<void> enableVirtualBackground({
  required Uint8List backgroundImage,
  double thresholdConfidence = 0.7,
}) async {
  if (!WebRTC.platformIsMobile && !WebRTC.platformIsMacOS) return;
  // Invoke the native method "enableVirtualBackground" through WebRTC plugin,
  // passing the backgroundImage and thresholdConfidence as parameters.
  WebRTC.invokeMethod("enableVirtualBackground", {
    "imageBytes": backgroundImage,
    "confidence": thresholdConfidence,
  });
}