ok that alot

This commit is contained in:
NoLogicAlan committed 2026-05-11 22:24:08 +03:00
1 parent df1a783fde
commit 5f33ee231d
17 files changed
+64 -47

No files matched your search

+7 -4
View File
@@ -91,11 +91,14 @@ function getLivePlayerCount(playerMap) {
if (conn) {
const room = conn.room;
if (room) {
const state = room.state;
// Use @livekit/rtc-node Node.js SDK API:
// room.isConnected — boolean getter (true when connected)
// room.connectionState — ConnectionState enum (0=disconnected, 1=connected, 2=reconnecting)
// room.state does NOT exist in the Node.js SDK (browser-only API)
const isConnected = room.isConnected;
const connectionState = room.connectionState;
// Explicitly dead states → skip
if (state === "disconnected" || state === "failed" || state === 0) continue;
// undefined = connected on some LiveKit builds (no persistent state prop)
// "connected" = explicitly connected
if (!isConnected && (connectionState === 0 || connectionState === "disconnected")) continue;
}
// conn exists but no room → still a valid LiveKit connection reference
} else {