startRemoteView method

Future<void> startRemoteView(
  1. String userId,
  2. int streamType,
  3. int? viewId
)

订阅远端用户的视频流,同时绑定视频渲染控件

参数:

userId:指定的远程用户的 userId

streamType:指定观看的 userId 的视频流类型:

viewId:由 TRTCCloudVideoView 生成的 viewId

不支持:

  • macOS

Implementation

Future<void> startRemoteView(String userId, int streamType, int? viewId) {
  if (viewId == null) {
    return _cloudChannel.invokeMethod(
        'startRemoteView', {"userId": userId, "streamType": streamType});
  } else {
    return TRTCCloudVideoViewController(viewId)
        .startRemoteView(userId, streamType);
  }
}