Whether your app is using WebRTC to enable remote collaboration or to connect healthcare professionals with their patients, the user experience should be seamless.
Media quality is affected by a number of factors but is especially susceptible to end-user network environments. Understanding the network conditions for WebRTC calls can ensure higher media quality and predictability. To tackle this issue, we launched a new feature called the Smart Connectivity Test.
The Smart Connectivity Test API
Our Javascript library (callstats.js) runs WebRTC-specific tests to measure the network quality of end users before an actual call or conference begins. It measures the status of the media connectivity, round-trip time (RTT), fraction losses, and throughput available to end-user devices. TheSmart Connectivity Test is run against callstats.io TURN servers using WebRTC data channels.
You can access the Smart Connectivity Test results using our “on” function, as shown below:
//Usage
callstats.on("preCallTestResults", csPreCallTestResultsCallback);
function preCallTestResultsCallback(status, results) {
//Check the status if (status == callstats.callStatsAPIReturnStatus.success) {
//Results
var connectivity = results.mediaConnectivity;
var rtt = results.rtt;
var loss = results.fractionalLoss;
var throughput = results.throughput;
}
else {
console.log("Smart Connectivity Test could not be run");
}
}
App developers can use “status” to check if the Smart Connectivity Test has completed. The test will return success
or failure
upon completion and will run as long as the callback is not fired. TheSmart Connectivity Test might return partial results if the tests are interrupted or if the call begins while theSmart Connectivity Test is running. You can disable the Smart Connectivity Test by setting “disablePrecalltest” to true
in configParams
.
Please note that callstats.js should be initialized during the page load or early enough for the Smart Connectivity Test to be completed before the call or conference begins.
Results On The callstats.io Dashboard
The results of the Smart Connectivity Test are available for each participant under the “More Information” section of the participants' table in the conference view. To avoid a poor user experience, it is highly recommended that operators expose these network diagnostics results to end users. This informs end users so they may switch to a better network before starting a call or conference, and updates application developers so they may apply an optimal configuration to the application.
Network Test Page
The Smart Connectivity Test is also publicly available at network.callstats.io.
Comments
0 comments
Please sign in to leave a comment.