some user calls are getting dropped as they are on...
# ask-ai
f
some user calls are getting dropped as they are on low network conditions, how can i prevent this? can i run any pre network test to verify stable internet before proceeding. can i use the https://livekit.io/connection-test?
t
Thanks for reaching out, Rabbani. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I completely understand how frustrating it can be when calls drop due to low network conditions. To help you keep your user calls stable, here are some friendly strategies you can try: • Automatic Video Management: Try enabling the "Allow pausing videos when subscribers are congested" option in your project settings. This gently pauses video during network congestion but keeps the audio flowing smoothly, and it will automatically resume video once the connection improves. • Pre-Network Test: Before your calls, you might find the LiveKit Connection Test Utility really helpful. It checks your internet stability by testing WebRTC, WebSocket, and TURN server connectivity, giving you peace of mind that everything’s set up right. • Simulcast: LiveKit’s simulcast feature adjusts video quality on the fly based on network conditions, so users with limited bandwidth still get a smooth experience. • Fallback Protocols: To keep calls steady even when networks switch or have restrictions, LiveKit supports multiple fallback connections like UDP, TCP, and TURN over TLS. Please feel free to reach out if you’d like me to walk you through any of these steps or if you have any other questions. I’m here to help! Sources: Connecting to LiveKit | LiveKit Docs | An introduction to WebRTC Simulcast | Managing Video Quality During Network Congestion | Diagnosing Connection Errors with Connection Test Utility
f
how can i integrate this livekit tester in my app, any api ?
t
I'm happy to help you integrate the LiveKit Connection Test Utility into your app! You can use the
ConnectionCheck
class from the
@livekit/client-sdk
, which offers a handy API to run connectivity diagnostics programmatically. Here’s a simple way to get started: 1. Install the SDK: First, add the LiveKit client SDK to your project by running:
npm install @livekit/client-sdk
2. Initialize ConnectionCheck: Then, create a test instance using your LiveKit server URL and a participant token:
Copy code
import { ConnectionCheck } from '@livekit/client-sdk';

const checker = new ConnectionCheck({
  url: 'your-project-url',
  token: 'your-token'
});
3. Run Tests: You can check your connectivity by calling methods like
checkWebsocket()
,
checkWebRTC()
, and `checkTURN()`:
Copy code
const websocketResult = await checker.checkWebsocket();
const webrtcResult = await checker.checkWebRTC();
const turnResult = await checker.checkTURN();
4. Handle Results: Take a look at the results to help diagnose any issues. For example:
Copy code
if (websocketResult.status === 'FAILED' &&
    webrtcResult.status === 'FAILED' &&
    turnResult.status === 'FAILED') {
  // This might indicate a firewall or VPN blocking the connection
}
5. Trigger Tests: It’s a good idea to run these tests either when your app starts or whenever a connection error happens. If you have any questions along the way or need help with implementation or generating tokens, please don’t hesitate to reach out—I’m here to support you! Sources: src/connectionHelper/ConnectionCheck.ts | Diagnosing Connection Errors with Connection Test Utility
f
or should i use the webRTC browser test, https://livekit.io/webrtc/browser-test id this better than livekit test, which one should i use?
t
I’m glad you asked about the best way to test connectivity! The LiveKit Connection Test Utility is actually a great choice compared to the WebRTC browser test, and here’s why: • LiveKit Connection Test Utility: This tool is designed specifically for LiveKit and offers detailed diagnostics, including checks for WebRTC, WebSocket, and TURN server connectivity. It also tests audio/video publishing, reconnect capabilities, and cloud region quality. It’s really helpful for spotting issues like firewall or VPN interference and ensures everything works smoothly with LiveKit’s infrastructure. • WebRTC Browser Test: This one focuses on general WebRTC capabilities in your browser but doesn’t dive into LiveKit-specific connectivity. It’s useful for a quick check on basic WebRTC support but doesn’t provide the in-depth insights you get from the LiveKit utility. So, for the most reliable way to see if your users can connect to LiveKit services, I’d definitely recommend the Connection Test Utility. If you’d like, I’m here to help you set it up or answer any other questions you might have! Sources: Operational Guidance | livekit/livekit_composite | DeepWiki | Diagnosing Connection Errors with Connection Test Utility | WebRTC Browser Test - LiveKit