setRemoteVideoRenderListener method

Future<int?> setRemoteVideoRenderListener(
  1. CustomRemoteRender param
)

Set up a custom rendering callback for the remote video. the SDK will skip the original rendering process and callback the received data. you will need to complete the screen rendering yourself at this time.

For more information on the parameters, please see the definition of CustomRemoteRender

Returned value: textureId

For more information, please see Custom Capturing and Rendering

Sample call

var textureId = await trtcCloud.setRemoteVideoRenderListener(
       CustomRemoteRender(
           userId: userId,
           streamType: TRTCCloudDef.TRTC_VIDEO_STREAM_TYPE_BIG,
           width: 360,
           height: 369));

Texture(key: valueKey, textureId: textureId)

When to call: call when onUserVideoAvailable is true

Not supported on:

  • web

Implementation

Future<int?> setRemoteVideoRenderListener(CustomRemoteRender param) {
  return _cloudChannel!.invokeMethod('setRemoteVideoRenderListener', {
    "userId": param.userId,
    "streamType": param.streamType,
    "width": param.width,
    "height": param.height,
  });
}