Skip to main content
testNetworkConnectivity(videoTrack) Checks whether a stable connection can be established with Daily’s TURN servers. Useful for precall checks before a room is joined. The test times out automatically after 30 seconds.
A passing result does not indicate that the user is authorized to join a call — only that a TURN connection is possible. A failing result does not guarantee calls will fail: P2P calls may still work.

Why pass a video track?

Chrome and Firefox can test network connectivity without a media track, but Safari requires one. To ensure the test works across all browsers, videoTrack is required.

Parameters

videoTrack
MediaStreamTrack
required
A video track used to establish the test connection. You can obtain one from call.participants().local.tracks.video.persistentTrack after calling startCamera().

Return value

Returns Promise<DailyNetworkConnectivityTestStats>.
result
'passed' | 'failed' | 'aborted'
  • 'passed' — connection to Daily’s TURN servers was successful
  • 'failed' — connection could not be established; advise users to check their network or contact their administrator
  • 'aborted' — test was stopped via abortTestNetworkConnectivity() before completion

Example

await call.startCamera();
const videoTrack = call.participants().local.tracks.video.persistentTrack;

const { result } = await call.testNetworkConnectivity(videoTrack);

switch (result) {
  case 'failed':
    console.warn('Cannot connect to TURN servers. Try a different network.');
    break;
  case 'aborted':
    console.log('Test aborted.');
    break;
  case 'passed':
  default:
    console.log('Network connectivity confirmed.');
}

See also