Javascript API Reference
    Preparing search index...

    Class Stream

    The Stream class is responsible for handling audio, video, screen-sharing and raw track streams.

    Index
    codec: string

    This represents the codec used to encode and decode the stream.

    displaySurface: "monitor" | "window" | "browser"

    This represents the surface type of a screen-share stream — whether the shared source is an entire screen ("monitor"), an application window ("window"), or a browser tab ("browser").

    Note

    This is available for screen-share streams of both local and remote participants. It will be undefined for audio, video, or any non-screen-share stream, and on browsers that do not support this feature.

    id: string

    This represents a unique identifier assigned to the stream.

    kind: "audio" | "video" | "share" | "shareAudio" | "rawAudio" | "rawVideo"

    This represents the kind of the stream.

    • "audio" – Microphone audio
    • "video" – Camera video
    • "share" – Screen-share video
    • "shareAudio" – Screen-share audio
    • "rawAudio" – A raw audio track published with publishTrack()
    • "rawVideo" – A raw video track published with publishTrack()
    name: string

    This represents the name of a raw track, as given to publishTrack() by the sender.

    It is null for camera, microphone and screen-share streams.

    paused: boolean

    This represents whether the stream is currently paused.

    pausedByApp: boolean

    This represents whether the app has paused this remote stream by calling pause().

    • It is set to true by pause() and back to false by resume().
    • A raw video tile scrolling back into view never resumes a stream the app paused; only resume() does.
    track: MediaStreamTrack

    This represents the underlying media track associated with the stream.

    • Removes an event listener that was previously registered.

      Parameters

      • eventType: "state"

        Event name to which you want to unsubscribe.

      • listener: (data: any) => void

        Callback function which was passed while subscribing to the event.

        To view the complete list of available events and their details, refer to StreamEvent.

      Returns void

    • Registers an event listener.

      Parameters

      • eventType: "state"

        Event name to which you want to subscribe.

      • listener: (data: any) => void

        A callback function that is executed when the specified event is emitted.

        To view the complete list of available events and their details, refer to StreamEvent.

      Returns void