testPeerToPeerCallQuality(options)
Connects to Daily’s TURN servers and collects metrics over the test duration to indicate connection quality. Useful for precall checks before a room is joined.
The test runs for 15 seconds by default (up to 30 seconds). The longer it runs, the more accurate the results. For in-depth network stats during a call, use getNetworkStats().
Parameters
A video track used to establish the test connection. You can obtain one from
call.participants().local.tracks.video.persistentTrack after calling startCamera().How long to run the test in seconds. Maximum:
30.Return value
ReturnsPromise<DailyP2PCallQualityTestResults>.
Overall connection quality verdict:
'good'—avgRecvPacketLoss< 5%,avgRoundTripTime< 300ms,avgRecvBitsPerSecond≥ 1,100kbps'warning'—avgRecvPacketLoss5–10%,avgRoundTripTime300–600ms,avgRecvBitsPerSecond700kbps–1,100kbps'bad'—avgRecvPacketLoss≥ 10%,avgRoundTripTime≥ 600ms,avgRecvBitsPerSecond< 700kbps'failed'— connection to TURN servers could not be made;errorMsganderrorfields are populated'aborted'— test stopped before data gathering started
Seconds over which data was collected.
Stats used to determine the result. All averages use an exponential moving average biased toward the most recent data.
maxRoundTripTime(seconds) — maximumcurrentRoundTripTimeavgRoundTripTime(seconds) — averagecurrentRoundTripTimeavgRecvPacketLoss(percentage) — average inbound packet lossavgAvailableOutgoingBitrate(bps) — averageavailableOutgoingBitrate(not available on Firefox)avgSendBitsPerSecond(bps) — average outbound bitrateavgRecvBitsPerSecond(bps) — average inbound bitrate
Human-readable error message. Only present when
result === 'failed'.Structured error object. Only present when
result === 'failed' and error details are available.