Availability: Web SDK v1.9.8+
The EnxRtc.clientBitrate() method provides bitrate status of the Client. It carries out the following tests to generate a response:
- Bandwidth
- Video bandwidth with TURN server
- Audio bandwidth with TURN Server
You can also build a UI to initiate the tests and generate a diagnostic report using this API.
Class: EnxRtc
Method: EnxRtc.clientBitrate(clientInfo)
Parameters:
clientInfo– Optional. JSON object with Client preferences for the execution of test cases.region– String. Region Id of ICE Server, e.g."IN", "SG", "US", "DE".Default Region ID is “DE”.
Event Notifications:
client-bitrate-finished– Notification sent when the API has completed the execution of the test case. This returns a JSON Object as the final result.client-bitrate-status– Notification sent with the test results at the beginning and end of the test. This returns a JSON Object as the test result.
Request for diagnostics:
var clientInfo = {
region: 'IN'
};
let client = EnxRtc.clientBitrate(clientInfo);
client.addEventListener("client-bitrate-status", function(response) {
// handle info message from response.message
});
client.addEventListener("client-bitrate-finished", function(response) {
// handle json from response.message
});
Response at the beginning and end of Test: client-bitrate-status
//Status at the start of test
{
"status": "started",
"test_case": "video_bandwidth",
"test_group": "bandwidth",
"test_region": "IN",
"test_server": "TURN"
}
// Status at the end of test
{
"test_group": "bandwidth",
"test_case": "video_bandwidth",
"status": "finished",
"output": {
"video_bandwidth": {
"result": "success",
"bandwidth_bps": 2221949,
"packets_lost_percentage": "0.99",
"execution_time": "31566 ms",
"success": [],
"error": [],
"warning": [],
"info": [],
"server": {
"region": "IN",
"url": "turns:ts.enablex.io:443"
}
}
},
"test_region": "IN",
"test_server": "TURN"
}
Final Response: client-bitrate-finished
{
"video": {
"bitrate_bps": 2221949,
"connection": "stable"
},
"audio": {
"bitrate_bps": 278067,
"connection": "stable"
}
}
Test Result Explanation
| Test Group | Test Case | Server | Result | Message |
|---|---|---|---|---|
| Bandwidth | Video Bandwidth | TURN | Success | Video resolution: Width x Height |
| Failure | Camera failure: Width x Height. Cannot test bandwidth without a working camera | |||
| Subject to quality | Average Video bandwidth <value> | |||
| Subject to quality | Packets lost: <value> | |||
| Subject to quality | RTT Average: <value> | |||
| Failure | getUserMedia() failed with error <error> | |||
| Failure | Frame Rate mean is 0, cannot test bandwidth without a working camera | |||
| Failure | Only Firefox and Chrome getStats() implementations are supported | |||
| Audio Bandwidth | TURN | Subject to quality | Average Audio bandwidth <value> | |
| Subject to quality | Packets lost: <value> | |||
| Subject to quality | RTT Average: <value> | |||
| Failure | getUserMedia() failed with error <error> | |||
| Failure | Only Firefox and Chrome getStats() implementations are supported |
Note: Currently this API is not working for Firefox and Safari browser.
