feat: enhance call handling by prioritizing homeservers based on active call members

This commit is contained in:
2026-04-20 21:15:46 +10:00
parent 9161c4bde2
commit 13a0c98d1d
3 changed files with 62 additions and 17 deletions

View File

@@ -30,6 +30,7 @@ import {
fetchLiveKitJWTFromServers,
getLiveKitHomeserverPriority,
} from './useRtcConfig';
import { getActiveCallMembers } from './useRoomCallMembers';
import { getAudioSettings, SCREEN_SHARE_RESOLUTIONS, SCREEN_SHARE_BITRATES } from '../settings/audio/Audio';
import { getCallSounds, CallSoundType } from './CallSounds';
@@ -306,6 +307,16 @@ export class CallService {
throw new Error(`Room ${roomId} not found`);
}
// Check if there's already an active call
const activeCallMembers = getActiveCallMembers(room);
const isJoiningExistingCall = activeCallMembers.length > 0;
if (isJoiningExistingCall) {
console.log(`Joining existing call with ${activeCallMembers.length} participant(s)`);
} else {
console.log('Starting new call');
}
const homeserverPriority = getLiveKitHomeserverPriority(
room,
this.config.homeserverBaseUrl,