Docs / Flutter / ZEGOCLOUD
ZEGOCLOUD on Flutter
Beautify the published camera of a zego_express_engine 3.x call. Facevity enables ZEGO's custom video processing natively with one Dart call.
Demo app: facevity-flutter-demo on GitHub
Facevity enables ZEGO’s custom video processing on the native engine (a GL texture on ZEGO’s GL thread on Android, a CVPixelBuffer on iOS) and returns the processed frame with sendCustomVideoProcessed…. Preview and publish both use it.
1. Requirements
facevity_flutterset up as in the quick startzego_express_engine3.x- iOS:
'zego'in$FacevityRtcHooksin the Podfile. Android detects it automatically.
2. Attach before preview and publishing
final fv = await Facevity.initialize(licenseAsset: 'assets/facevity/license.fvl', params: BeautyParams.natural);
await ZegoExpressEngine.createEngineWithProfile(
ZegoEngineProfile(appID, ZegoScenario.Default, appSign: appSign));
await fv.rtc.zego.attach(); // BEFORE startPreview / startPublishingStream
await ZegoExpressEngine.instance.loginRoom(roomID, ZegoUser(userID, userName));
await ZegoExpressEngine.instance.startPreview(canvas: canvas);
await ZegoExpressEngine.instance.startPublishingStream(streamID);
3. Tear down
await ZegoExpressEngine.instance.stopPublishingStream();
await ZegoExpressEngine.instance.stopPreview();
await fv.rtc.zego.detach();
await ZegoExpressEngine.destroyEngine();
Notes
- Do not call
enableCustomVideoProcessingfrom Dart yourself: it would replace Facevity’s handler. - This is a texture path on Android and a pixel-buffer path on iOS, so
buffer.pathis not needed.
Next: LiveKit on Flutter · all platforms
Need help with an integration? Contact the Facevity team. We answer integration questions during trials.