RTCStream

class RTCStream

One media stream a Participant is publishing — their mic, camera, screen share or share audio.

The SDK hands these to ParticipantEventListener.onStreamEnabled and ParticipantEventListener.onStreamDisabled; application code never constructs one. A stream object belongs to the event that delivered it — the next onStreamEnabled for the same participant brings a new instance, so switch on kind rather than holding one by identity.

Types

Link copied to clipboard

Told when a video stream's health changes; see setOnStreamStateChangedListener.

Properties

Link copied to clipboard
val id: String

Server-assigned stream ID, and the key this stream has in Participant.streams.

Link copied to clipboard

What this stream carries.

Link copied to clipboard

The ID of the participant publishing this stream.

Link copied to clipboard
val track: MediaStreamTrack

The track to render.

Functions

Link copied to clipboard
suspend fun pause()

Stops receiving this remote stream's media, freeing its downstream bandwidth. The participant keeps publishing it to everyone else.

Link copied to clipboard
suspend fun resume()

Starts receiving a stream that pause stopped.

Link copied to clipboard

Sets the listener told when this stream's health changes — the practical way to tell "their camera is on but I am seeing nothing". Only remote video and share streams report; audio never does. null removes it.