I have built a video call kind of application using the LiveKit cloud, but what is happening now is that some users are entering the video call, but because of their network connectivity, it is poor or bad. The connection is getting dropped, like the agent is getting disconnected or the internet is very bad. So, I need a test before entering the room or the call itself to verify if all the connections are stable or not. What infrastructure do we have to test this? Is there already a library that I can use, or do you have to just use the FastAPI or a network speed test API that is available on the internet? Just check the internet connection speed with fast.com or any free api that is available?
LiveKit should be resilient to poor network conditions, and we have some advanced features to deliver video to users appropriate to their bandwidth: Codecs and more | LiveKit Documentation
Having said that however, we are still constrained by the actual network conditions of the user. If you chose to, you could not allow video sharing if you determine a user’s network connection is too poor to permit it… There is nothing native in LiveKit to do this, but if it were me, I would use client-side libraries such as Android’s TelephonyManager getDataNetworkType() to achieve this.
i found this ConnectionCheck | LiveKit JS Client SDK - v2.19.0
will this be any helpful to check the user connectivity strength with my livekit cloud?
@RabbaniF22, yes, ConnectionCheck is the right tool. It’s the native LiveKit pre-call diagnostic suite. You pass it your project URL and a token, and it runs the checks that matter for an actual call: WebSocket to the signal server, WebRTC capability, TURN reachability, reconnect, publish audio, publish video, protocol fallback, and Cloud region detection. Far more useful than a generic fast.com speed test, because it exercises the same path the call will use.
Verified on main in client-sdk-js/src/connectionHelper/ConnectionCheck.ts:
// livekit-client v2.19.0+
import { ConnectionCheck } from 'livekit-client';
const checker = new ConnectionCheck(url, token);
await checker.checkWebsocket();
await checker.checkWebRTC();
await checker.checkTURN();
await checker.checkPublishAudio();
await checker.checkPublishVideo();
await checker.checkReconnect();
console.log(checker.getResults(), checker.isSuccess());
Gate the join button on isSuccess() or on specific failing checks for a clean pre-call flow.
@RabbaniF22 that is a helpful test. To get deeper diagnostics if they are using Chrome browser is to open a tab to chrome://webrtc-internals and then in another tab reproduce the issue. That should have details about exactly what is happening during the WebRTC session from that browser.