Skip to content
This repository was archived by the owner on May 23, 2025. It is now read-only.

Network Quality events

Adnan Arnautović edited this page Jan 26, 2023 · 1 revision

To provide better feedback during RTC calls with other users, you can subscribe to network quality events.

These events are used to inform the user of their local network quality as well as the network quality of the user they are connected to. With such information, it is possible to determine when call quality is being affected by deteriorating network quality, be it locally or remotely.

To use these events, one must subscribe to the network-quality-changed event for the local network quality events and remote-network-quality-changed event for the remote network quality events. This is possible by using the on method on the Call object which can be seen in the following example:

let call = infobipRTC.call('alice');
call.on('network-quality-changed', event => console.log(NetworkQuality[event]));
call.on('remote-network-quality-changed', event => console.log(NetworkQuality[event]));

It needs to be noted that remote network quality events are only available during calls that are initiated with the call method, while the local network quality events can be used during all calls originating from WebRTC.

Both of these events contain a NetworkQuality object which is an enum that describes the quality of the network in five levels ranging from BAD to EXCELLENT. The numerical values of these enums are from 1 to 5, the latter being the best quality correlating to EXCELLENT.

It is worth noting that the network quality is highly dependent on your demands. A network that can have an excellent quality during a voice call might drop to fair quality while using video.

Clone this wiki locally