Skip to main content
Version: 0.x.x

Stream Class Events - Javascript


state

  • This callback is triggered when the state of a video or screen-share video stream changes.
  • It helps track whether the stream is active, stuck, frozen, resolved, or ended.
note

This event is emitted exclusively for remote participants, specifically for their video and screen share video streams.

Parameters

  • state: Specifies the current state of the stream.

    • Type: String
    • Possible values:
      • "active": Stream is working normally.
      • "stuck": Stream is not progressing as expected.
      • "freeze-detected": Video freeze has been detected.
      • "freeze-resolved": Video freeze has been resolved.
      • "ended": Stream has ended.
  • timestamp: The time (in milliseconds since epoch) when the state change occurred.

    • Type: Number

Example

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

Got a Question? Ask us on discord


Was this helpful?