Skip to main content
Version: 3.x.x

Stream Class Events - Flutter


streamStateChanged

  • streamStateChanged is a event which is triggered when the state of a video or screen-share video stream of the remote participant 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: int

Example

import 'package:videosdk/videosdk.dart';
Stream videoStream;
videoStream.on(Events.streamStateChanged, (state, timestamp){
print("Stream State changed to state: $state at time:$timestanp");
});

Got a Question? Ask us on discord


Was this helpful?