Monitoring Remote Participants' Stream - Flutter
Each RTCStream reports when its media stops or starts flowing. Listen with stream.on(Events.streamStateChanged, ...). The room does not deliver this event.
The handler receives the new state as a StreamState and a timestamp in milliseconds since epoch. The states are:
FREEZE_DETECTED: the picture has stopped moving.FREEZE_RESOLVED: frames have flowed again for about five seconds after a freeze.STUCK: no media has arrived for about five seconds.ACTIVE: the stream started or resumed, so media is expected again. A new stream's firstACTIVEarrives about one second after it is enabled.ENDED: the stream was closed. Nothing more arrives on it.
room.on(Events.streamEnabled, (RTCStream stream) {
if (stream.kind == MediaType.VIDEO) {
stream.on(Events.streamStateChanged, (StreamState state, int timestamp) {
print("${stream.participantId}'s video is now ${state.name}");
});
}
});
Remove the handler with stream.off() when you no longer need it.
To check the quality of the video you receive from a remote participant, call getVideoStats() on that participant from a timer. Refer to the Understanding Call Quality guide for the metrics it returns.
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

