Detecting audio and video quality changes (JavaScript Only)
If a client experiences periods of degraded network connectivity, this may be reflected on the
subscriber call quality. The Subscriber object dispatches a qualityScoreChanged event
when the calculated audio and video MOS scores change. These scores are reported as integers between 1 (worst) and 5 (best),
corresponding to bad, poor, fair, good, and excellent. For more details, see the Subscriber qualityScoreChanged event.
A Subscriber object dispatches this event only when one of the quality scores has changed. Each Subscribe dispatches events with its own audio and video quality scores, depending on whether it is subscribing to audio, video, or both.
In response to these events, your application can (optionally) notify the client of network conditions resulting in degraded call quality:
subscriber.on('qualityScoreChanged', ({qualityScore}) => {
if (qualityScore.audioQualityScore <= 3){
// Alert the user that the remote party is experiencing degraded service
}
if (qualityScore.videoQualityScore <= 3){
// Alert the user that the remote party is experiencing degraded service
}
});