startRemoteView abstract method

void startRemoteView(
  1. String userId,
  2. TRTCVideoStreamType streamType,
  3. int viewId
)

Subscribe to remote user's video stream and bind video rendering control

Calling this API allows the SDK to pull the video stream of the specified userId and render it to the rendering control specified by the view parameter. You can set the display mode of the video image through setRemoteRenderParams.

  • If you already know the userId of a user who has a video stream in the room, you can directly call startRemoteView to subscribe to the user's video image.

  • If you don't know which users in the room are publishing video streams, you can wait for the notification from TRTCCloudListener.onUserVideoAvailable after enterRoom.

Calling this API only starts pulling the video stream, and the image needs to be loaded and buffered at this time. After the buffering is completed, you will receive a notification from TRTCCloudListener.onFirstVideoFrame.

Parameters:

Note

The following requires your attention:

  1. The SDK supports watching the big image and substream image or small image and substream image of a userId at the same time, but does not support watching the big image and small image at the same time.

  2. Only when the specified userId enables dual-channel encoding through enableSmallVideoStream can the user's small image be viewed.

  3. If the small image of the specified userId does not exist, the SDK will switch to the big image of the user by default.

Implementation

void startRemoteView(String userId, TRTCVideoStreamType streamType, int viewId);