Docs / React Native / ZEGOCLOUD
ZEGOCLOUD on React Native
Beautify the published camera of a zego-express-engine-reactnative 3.x call. Facevity enables custom video processing on the native engine.
Demo app: facevity-react-native-demo on GitHub
The React Native ZEGO SDK wraps the native SDK, so Facevity enables custom video processing on the same native engine: a texture on ZEGO’s GL thread on Android, a CVPixelBuffer on iOS. Preview and publish both use the processed frame.
1. Requirements
react-native-facevityset up as in the quick startzego-express-engine-reactnative3.x- iOS:
'zego'in$FacevityRtcHooksin the Podfile. Android detects it automatically.
2. Attach before preview and publishing
import ZegoExpressEngine from 'zego-express-engine-reactnative';
import { Beauty, Facevity } from 'react-native-facevity';
const fv = await Facevity.initialize({ licenseToken });
await fv.setParams(Beauty.NATURAL);
await ZegoExpressEngine.createEngineWithProfile({ appID, appSign, scenario: 0 });
await fv.rtc.zego.attach(); // BEFORE startPreview / startPublishingStream
await ZegoExpressEngine.instance().loginRoom(roomID, { userID, userName });
ZegoExpressEngine.instance().startPreview(view);
ZegoExpressEngine.instance().startPublishingStream(streamID);
3. Tear down
ZegoExpressEngine.instance().stopPublishingStream();
ZegoExpressEngine.instance().stopPreview();
await fv.rtc.zego.detach();
await ZegoExpressEngine.destroyEngine();
Notes
- Do not call ZEGO’s
enableCustomVideoProcessingyourself: it would replace Facevity’s handler. - Texture and pixel-buffer paths:
buffer.pathis not needed.
Next: LiveKit on React Native · all platforms
Need help with an integration? Contact the Facevity team. We answer integration questions during trials.