Tuesday, 7 May, 2019 UTC


Summary

A few months ago we announced Twilio Programmable Video Network Quality API: a simple mechanism enabling end-users to be notified, in real-time, about their network quality using a 1-to-5 scale as a measure. Our developer community is incredibly important to us; we have been working hard to address the feedback you’ve provided since the launch. Today, we are thrilled to announce an enhanced version of the Network Quality API. Based on your feedback, we’ve released new features that enable broader quality monitoring and diagnostics.
Before delving into the details of these new features, we’d first like to share with you the feedback that influenced these updates. We will then outline what has changed and how to use these enhancements in your work.
Developer Feedback on Programmable Video Network Quality API
To explain why we’ve implemented these new features, we’d like to recap what we learned from our developer community:
What developers liked about the Network Quality API:
  • Prevents user frustration with their application providers: Informs end-users about problems in their own network allowing them to uncover the root cause of their quality issues.
  • Clean Code: The Network Quality API is simple to use and understand.
What developers would like to see included in the Network Quality API:
  • Opportunity to expand quality reporting: The Network Quality API only provides the Quality Level of the local participant. We heard it would be helpful to include quality information about remote participants, enabling end-users to understand not only if they are publishing with the right quality but also if (and which) remote participants are receiving accurate communications.
  • Desire for additional information: The 1-to-5 scale is simple to understand, but sometimes developers, and even end-users, want to have more information about what the specific network problem is in order to resolve the issue. For example, when getting a Quality Level of 1, they would like to know whether it is due to packet loss, to narrow bandwidth, or to other causes.
New Network Quality API Features
Based on this feedback, we’ve made some updates to the Network Quality API that expands the scope of the quality reporting it provides and adds more detailed quality statistics. Specifically, the new features are:
  • Quality Level for Remote Participants, which allows any end-user to have information about the network quality of the other connected participants.
  • Network Quality Statistics, which provides detailed network metrics, making it possible to understand and therefore better diagnose the root cause of the most common network problems.
Developing with the enhanced Network Quality API
To use these enhancements you need the JavaScript SDK v1.18.0+. The following code snippet illustrates how it works:
var Video = require('twilio-video'); var token = getAccessToken();  Video.connect(token, {  name: 'my-room',  audio: { name: 'microphone' },  video: { name: 'camera' },  networkQuality: {  local: 1, // LocalParticipant's Network Quality verbosity [1 - 3]  remote: 2 // RemoteParticipants' Network Quality verbosity [0 - 3]  } }).then(function(room) {  // Change Network Quality verbosity levels after joining the Room  room.localParticipant.setNetworkQualityConfiguration({  local: 2,  remote: 1  }); }); 
You can now specify at connect time the Network Quality Verbosity for both the local and remote participants. Verbosity can take any of the following values:
  • 0: No quality data is published.
  • 1: Only the 1-to-5 Quality Level is published.
  • 2: Everything in verbosity 1 plus the four components of the Quality Level. That is, you get four different Quality Levels corresponding to:
    • Inbound audio
    • Inbound video
    • Outbound audio
    • Outbound video
  • 3: Everything in verbosity 2 plus detailed network stats for all the components. These include:
    • Used bandwidth
    • Available bandwidth
    • Packet loss
    • Jitter
    • Latency
In addition, verbosity can be modified dynamically after a participant connects using the setNetworkQualityConfiguration primitive of the localParticipant. This enhances the API flexibility allowing your application to increase the verbosity when needed and allowing it to save bandwidth when detailed network quality information is not needed.
For further details, check out our Network Quality API official documentation.
What’s next with the Network Quality API
We’re planning to ship:
  • Full support for iOS SDK (currently we only support local Quality Level)
  • Support for Android SDK (no current support)
If you have questions or ideas for how we can improve the Network Quality API do not hesitate to reach out to us.
We can’t wait to see what you build!