startVirtualBackground function
Implementation
Future<MediaStream?> startVirtualBackground({
required Uint8List backgroundImage,
String? textureId,
}) async {
try {
final String base64String = base64Encode(backgroundImage);
final JSObject? obj = enableVirtualBackground(base64String, textureId);
if (obj == null) return null;
final web.MediaStream jsStream = web.MediaStream(obj);
return rtc.MediaStreamWeb(jsStream, 'local');
} catch (error) {
return null;
}
}