Stream

class Stream

Represents a media stream associated with a Participant.

A Stream wraps an underlying MediaStreamTrack and provides information about the stream's kind (audio, video, screen-share, or screen-share audio).

Streams are created and destroyed automatically by the SDK. You can listen for stream lifecycle events using onStreamEnabled and onStreamDisabled.

Stream Kinds:

  • "audio" — Microphone audio stream
  • "video" — Camera video stream
  • "share" — Screen-share video stream
  • "shareAudio" — Screen-share audio stream

Code Example:


participant.addEventListener(object : ParticipantEventListener() {
    override fun onStreamEnabled(stream: Stream) {
        if (stream.kind.equals("video", ignoreCase = true)) {
            val videoTrack = stream.track as VideoTrack
            videoTrack.addSink(videoView)
        }
    }
})

See also

Participant.getStreams()

Properties

Link copied to clipboard
val id: String
The unique identifier of this stream.
Link copied to clipboard
The kind of this stream: "audio", "video", "share", or "shareAudio".
Link copied to clipboard
val track: MediaStreamTrack
The underlying MediaStreamTrack for this stream.

Functions

Link copied to clipboard
fun pause()
This method can be used to pause a remote participant's stream.
Link copied to clipboard
fun resume()
This method can be used to resume a previously paused remote participant's stream.