Description
RemoteVideoTrack renders remote video and monitors the status of the remote stream.
RemoteVideoTrack methods
setRemoteVideoEvent(event)
Parameters:
event:RTCRemoteVideoEvent, the remote stream status event callback implementation. Returns: None (Unit).
- 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()
Parameters: None.
Returns: None (
Unit).
Rendering methods inherited from VideoTrack
addPlayView(view)
VcsPlayerGlTextureView / VcsPlayerGlSurfaceView are supported.Parameters:
view:View, the render view. Returns:Boolean;trueif the view was added,falseif the type is unsupported or the view was already added.
replacePlayView(views)
Parameters:
views:MutableList<View>, the render views; onlyVcsPlayerGlTextureView/VcsPlayerGlSurfaceVieware supported. Returns: None (Unit).
removePlayView(view)
Parameters:
view:View, the target render view. Returns: None (Unit).
removeAllPlayView()
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)
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;truemeans stalled,falsemeans back to normal. Returns: None (Unit).
Video render views
Display video with the SDK’sVcsPlayerGlTextureView or VcsPlayerGlSurfaceView. The following usage applies to both remote video and local camera preview:
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 returnUnit:
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.