getNetworkStats()
getNetworkStats()
You can poll the getNetworkStats()
method to continually read the current network performance.
Return type
Returns a Promise that resolves to a stats
object with the following properties:
latest
: a collection of statistics from the most recent time period. These statistics are updated approximately once every two seconds:recvBitsPerSecond
: total data from video and/or audio being received in bits per secondsendBitsPerSecond
: total data from video and/or audio being sent in bits per secondtimestamp
: a unix timestamp (seconds since the epoch)videoRecvBitsPerSecond
: total data from video being received in bits per secondvideoRecvPacketLoss
: estimated data lost from the received video over a two second periodvideoSendBitsPerSecond
: total data from video being sent in bits per secondvideoSendPacketLoss
: estimated data lost from the video being sent over a two second periodtotalSendPacketLoss
: estimated data lost from the audio and video being sent over a two second periodtotalRecvPacketLoss
: estimated data lost from the received audio and video over a two second period
worstVideoRecvPacketLoss
: the highestvideoRecvPacketLoss
number seen over a two second period during the callworstVideoSendPacketLoss
: highestvideoSendPacketLoss
number seen over a two second period during the callthreshold
:'good'
|'low'
|'very-low'
, an assessment of the current network quality. The threshold value is calculated from network stats averaged over an approximately 30-second rolling window. By default, we lower the bandwidth used for the call when the network quality drops tolow
, and we turn off the local camera when the network quality drops tovery-low
.quality
: a subjective calculation of the current network quality on a scale of 1-100.
To those building audio-only apps:
As noted by their property names, any key that includes video
only applies to video. recvBitsPerSecond
, sendBitsPerSecond
, totalSendPacketLoss
, and totalRecvPacketLoss
, however, do cover both audio and video.