feat: enhance call handling by prioritizing homeservers based on active call members
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user