Skip to main content
Version: 5.x.x

Monitoring Call Quality - Flutter

Monitoring the local participant’s call quality is essential to ensure a smooth and uninterrupted room experience. Changes in network conditions or device performance can directly affect audio and video quality. By subscribing to the qualityLimitation event accessible from the Room class, your app can detect these changes in real-time and provide immediate feedback to the participant.

Why It Matters​

Even brief network congestion, low bandwidth, or high CPU usage can impact the room experience. Monitoring these limitations allows your app to:

  • Notify the local participant of potential issues affecting audio or video quality.
  • Let the participant take action, like switching networks or closing other heavy applications.

Example Usage​

The event handler receives three parameters: type, state and timestamp. Refer to the Monitoring Network Quality guide for their values.

import 'dart:async';
import 'package:videosdk/videosdk.dart';

late Room _room;

@override
void initState() {
super.initState();

// Create room
_room = VideoSDK.createRoom(
roomId: widget.roomId,
token: widget.token,
participantName: "John Doe",
micEnabled: micEnabled,
camEnabled: camEnabled,
defaultCamera: FacingMode.FRONT, // camera used when the room starts
);

setRoomEventListener();

// Join room
unawaited(joinRoom());
}

Future<void> joinRoom() async {
// On Android, the SDK does not ask for camera and microphone permission.
await VideoSDK.requestPermissions();
try {
await _room.join();
} on VideoSDKError catch (error) {
print("Could not join the room: ${error.code} ${error.name}");
}
}

// Listening to room events
void setRoomEventListener() {
_room.on(
Events.qualityLimitation,
(String type, String state, int? timestamp) {
print(
"Quality Limitation for $type in state $state at $timestamp",
);
},
);
}

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