Skip to main content
Version: 5.x.x

RTCStream Class Events - Flutter


streamStateChanged​

  • This event will be emitted when the health of a remote participant's video or screen-share stream changes.
  • The handler receives:
    • state (StreamState): the new state:
      • StreamState.ACTIVE: the stream started or resumed receiving. A new stream's first ACTIVE arrives about one second after it is enabled.
      • StreamState.ENDED: the stream stopped and will not produce more media.
      • StreamState.STUCK: no media has arrived for about five seconds.
      • StreamState.FREEZE_DETECTED: the picture froze.
      • StreamState.FREEZE_RESOLVED: the picture recovered, with no new freeze for about five seconds.
    • timestamp (int): when the change arrived, in milliseconds since epoch.
  • Remove the handler with off().

Example​

room.on(Events.streamEnabled, (RTCStream stream) {
stream.on(Events.streamStateChanged, (StreamState state, int timestamp) {
print("${stream.kind.name} stream of ${stream.participantId} is ${state.name}");
});
});

Got a Question? Ask us on discord


Was this helpful?

Not helpfulHelpful