startRemoteView method Null safety

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

Display remote video image or substream

Parameters:

userId: userId of the specified remote user

streamType: Video stream type of the userId specified for watching:

  • HD big image: TRTCCloudDef.TRTC_VIDEO_STREAM_TYPE_BIG

  • Smooth big image: TRTCCloudDef.TRTC_VIDEO_STREAM_TYPE_SMALL

  • Substream (screen sharing): TRTCCloudDe.TRTC_VIDEO_STREAM_TYPE_SUB

viewId: viewId generated by TRTCCloudVideoView

Implementation

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