Javascript API Reference
    Preparing search index...

    Type Alias StreamEvent

    type StreamEvent = {
        state: (data: { state: string; timestamp: number }) => void;
    }
    Index

    Events

    Events

    state: (data: { state: string; timestamp: number }) => void
    • Triggered when the state of a video or screen-share stream changes.

    • This event helps track whether the stream is active, stuck, frozen,recovered, or ended.

    Note

    This event is emitted only for remote participants and applies specifically to video and screen-share streams.

    Type Declaration

      • (data: { state: string; timestamp: number }): void
      • Parameters

        • data: { state: string; timestamp: number }
          • state: string

            The current state of the stream:

            • "active" — The stream is functioning normally.
            • "stuck" — The stream is no longer progressing as expected.
            • "freeze-detected" — A freeze in the video stream has been detected.
            • "freeze-resolved" — The previously detected freeze has been resolved.
            • "ended" — The stream has ended.
          • timestamp: number

            Timestamp (in milliseconds since epoch) indicating when the state change occurred.

        Returns void

    stream.on("state", ({ state, timestamp }) => {
    // Handle stream state changes
    });