updateRemoteView method

  1. @override
void updateRemoteView(
  1. String userId,
  2. TRTCVideoStreamType streamType,
  3. int? viewId
)
override

Update remote user's video rendering control

This API can be used to update the rendering control of the remote video image. It is often used in interactive scenarios where the display area needs to be switched.

Parameters:

Implementation

@override
void updateRemoteView(String userId, TRTCVideoStreamType streamType, int? viewId) {
  TRTCLog(_tag, "updateRemoteView: $userId $streamType $viewId");
  if (viewId != null && !TRTCCloudVideoView.containsViewId(viewId)) {
    TRTCLog(_tag, "updateRemoteView fail, viewId does not exist");
    return;
  }
  TRTCCloudNative.instance.updateRemoteView(userId, streamType, _isNativeTexturePlatform ? null : viewId);
  if (_isNativeTexturePlatform) {
    if (viewId == null) {
      TRTCMethodChannel().unsetRemoteTextureRender(userId, streamType);
    } else {
      TRTCMethodChannel().setRemoteTextureRender(userId, streamType, viewId);
    }
  }
}