Skip to main content

Description

RemoteVideoTrack renders remote video and monitors the status of the remote stream.

RemoteVideoTrack methods

setRemoteVideoEvent(event)

Description: Sets the remote video stream status listener and registers the global clock check.
Parameters:
  • event: RTCRemoteVideoEvent, the remote stream status event callback implementation. Returns: None (Unit).
When the status is reported:
  • If no valid frame is received for about 3 consecutive seconds after subscribing, the callback reports isChoke = true.
  • When valid frames resume, the callback reports isChoke = false.

removeRemoteVideoEvent()

Description: Removes the remote stream status listener and cancels the global clock check.
Parameters: None.
Returns: None (Unit).

Rendering methods inherited from VideoTrack

addPlayView(view)

Description: Adds a single render view. Only VcsPlayerGlTextureView / VcsPlayerGlSurfaceView are supported.
Parameters:
  • view: View, the render view. Returns: Boolean; true if the view was added, false if the type is unsupported or the view was already added.

replacePlayView(views)

Description: Replaces the entire list of render views.
Parameters:
  • views: MutableList<View>, the render views; only VcsPlayerGlTextureView / VcsPlayerGlSurfaceView are supported. Returns: None (Unit).

removePlayView(view)

Description: Removes the specified render view.
Parameters:
  • view: View, the target render view. Returns: None (Unit).

removeAllPlayView()

Description: Removes all render views.
Parameters: None.
Returns: None (Unit).

RTCRemoteVideoEvent callback interface

RTCRemoteVideoEvent is the remote video stream status callback interface, registered through setRemoteVideoEvent(event).

onReceiveStreamStatusChange(channel, uid, trackDesc, isChoke)

Description: Called when the status of a remote video stream changes.
Parameters:
  • channel: String, the ID of the channel the remote stream belongs to.
  • uid: String, the remote user ID.
  • trackDesc: String, the track description.
  • isChoke: Boolean, whether the stream is stalled; true means stalled, false means back to normal. Returns: None (Unit).

Video render views

Display video with the SDK’s VcsPlayerGlTextureView or VcsPlayerGlSurfaceView. The following usage applies to both remote video and local camera preview:
XML example:
Call the view’s onResume() / onPause() along with the screen lifecycle. When a view is no longer needed, remove it from the track first, then call onDestroy() to release render resources. Don’t reuse a destroyed view. The track feeds frames to the view, so you don’t need to call updateFrame yourself for normal subscriptions or camera preview.

Display configuration

The following methods are available on both views and all return Unit:
Rotation, flip, and mode changes take effect from the next frame; if no new frame arrives, the displayed frame doesn’t change. The scale type can apply to the current frame. The configuration belongs only to this view and doesn’t change the video sent to remote users.

updateFrame(y, u, v, width, height, format, rotationDegrees)

Use this only when your app submits raw frames directly to a render view:
Returns: Unit. Frame data is copied before the method returns, after which the app can reuse the arrays. An invalid size, data length, pixel format, or an angle that isn’t a multiple of 90 degrees causes the frame to be rejected and the previous frame to be kept; there’s no separate failure callback. Custom mode overrides the frame orientation, but the frame angle you pass must still be valid.