onRenderVideoFrame property

void Function(String channelId, int remoteUid, VideoFrame videoFrame)? onRenderVideoFrame
final

Occurs each time the SDK receives a video frame sent by the remote user.

After you successfully register the video frame observer, the SDK triggers this callback each time it receives a video frame. In this callback, you can get the video data sent from the remote end before rendering, and then process it according to the particular scenarios. It is recommended that you ensure the modified parameters in videoFrame are consistent with the actual situation of the video frames in the video frame buffer. Otherwise, it may cause unexpected rotation, distortion, and other issues in the local preview and remote video display. If the video data type you get is RGBA, the SDK does not support processing the data of the alpha channel. Due to framework limitations, this callback does not support sending processed video data back to the SDK.

  • videoFrame The video frame. See VideoFrame. The default value of the video frame data format obtained through this callback is as follows: Android: I420 iOS: I420 macOS: I420 Windows: YUV420
  • remoteUid The user ID of the remote user who sends the current video frame.
  • channelId The channel ID.

Implementation

final void Function(String channelId, int remoteUid, VideoFrame videoFrame)?
    onRenderVideoFrame;