enableVirtualBackground method

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

Implementation

@override
Future<void> enableVirtualBackground({
  required Uint8List backgroundImage,
  double thresholdConfidence = 0.7,
}) async {
  final MediaStream? segmentedStream = await startVirtualBackground(
    backgroundImage: backgroundImage,
    textureId: _mParticipant?.cameraSource?.textureId.toString(),
  );

  if (segmentedStream == null) return;

  _replaceVideoTrack(segmentedStream.getVideoTracks().first);
}