enableCustomVideoRender method

Future<void> enableCustomVideoRender(
  1. bool enable,
  2. ZegoCustomVideoRenderConfig config
)

Enables or disables custom video rendering.

Available since: 1.9.0 Description: When enable is true,video custom rendering is enabled; if the value of false, video custom rendering is disabled. Use case: Use beauty features or apps that use a cross-platform UI framework (for example, Qt requires a complex hierarchical UI to achieve high-experience interaction) or game engine (e.g. Unity, Unreal Engine, Cocos) Default value: Custom video rendering is turned off by default when this function is not called. When to call: After createEngine, and before calling startPreview, startPublishingStream, startPlayingStream, createRealTimeSequentialDataManager. The configuration can only be modified after the engine is stopped, that is, after logoutRoom is called. Caution: Custom video rendering can be used in conjunction with custom video capture, but when both are enabled, the local capture frame callback for custom video rendering will no longer be called back, you should directly use the captured video frame from the custom video capture source. Related callbacks: Call setCustomVideoRenderHandler to set the callback to get video frame data. onCapturedVideoFrameRawData local preview video frame data callback, onRemoteVideoFrameRawData remote playing stream video frame data callback. Note: This function is only available in ZegoExpressVideo SDK!

  • enable enable or disable
  • config custom video render config

Implementation

Future<void> enableCustomVideoRender(
    bool enable, ZegoCustomVideoRenderConfig config) async {
  return await ZegoExpressImpl.instance
      .enableCustomVideoRender(enable, config);
}