setLocalVideoRenderListener method

Future<int?> setLocalVideoRenderListener(
  1. CustomLocalRender param

Start the custom rendering of local video with external texture

After this method is set, the SDK will skip its own rendering process and call back the captured data. Therefore, you need to complete image rendering on your own.

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

Returned value: textureId

For more information, please see Custom Capturing and Rendering

Sample call

var textureId = await trtcCloud.setLocalVideoRenderListener(
              userId: userInfo['userId'],
               isFront: true,
               streamType: TRTCCloudDef.TRTC_VIDEO_STREAM_TYPE_BIG,
               width: 360,
               height: 738));

Texture(key: valueKey, textureId: textureId)

When to call: call after room entry succeeds

Not supported on:

  • web


Future<int?> setLocalVideoRenderListener(CustomLocalRender param) {
  return _cloudChannel!.invokeMethod('setLocalVideoRenderListener', {
    "userId": param.userId,
    "isFront": param.isFront,
    "streamType": param.streamType,
    "width": param.width,
    "height": param.height,