testConnectionQuality(options)
Prebuilt
Custom
Assesses WebRTC connection quality by connecting to Daily’s TURN servers and measuring round-trip time and packet loss over the test duration. 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().
A result does not determine whether a user is allowed to join a call — it’s up to you to decide what to do with
'bad' or 'warning' results.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. Default:
15. Maximum: 30.Return value
ReturnsPromise<DailyConnectionQualityTestStats>.
Overall connection quality verdict. The result is determined when any one condition is met:
'good'—packetLoss< 5% andmaxRTT< 300ms'warning'—packetLoss5–10% ormaxRTT300–600ms'bad'—packetLoss≥ 10% ormaxRTT≥ 600ms'failed'— connection to Daily’s TURN servers could not be made'aborted'— test stopped before data gathering started (viastopTestConnectionQuality())
The raw metrics used to determine the result:
maxRTT(seconds) — the highestcurrentRoundTripTimesampled during the testpacketLoss(percentage) — calculated frompacketsLostandpacketsReceived
How long the test ran in seconds.