Stream Events - Flutter
streamStateChanged
- This event is triggered when the state of a stream changes.
- The event callback will include the current state of the stream, which can be one of the following:
active,freeze-detected,freeze-resolved,stuck. - It can be subscribed to using the
Streamclass.
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.
- Type:
-
timestamp: The time (in milliseconds since epoch) when the state change occurred.- Type:
int
- Type:
Example
Here is an example demonstrating the usage of the event mentioned on this page.
import 'package:videosdk/videosdk.dart';
Stream videoStream;
videoStream.on(Events.streamStateChanged, (state, timestamp){
print("Stream State changed to state: $state at time:$timestanp");
});
API Reference
The API references for all the methods and events utilized in this guide are provided below.
Got a Question? Ask us on discord

