feat: enhance CallWindow with error handling and track management

- Added error handling logic to manage Jitsi connection and track creation errors, providing user-friendly feedback through the new ErrorModal.
- Introduced functionality to dynamically create and manage local audio and video tracks during calls.
- Updated Jitsi configuration to separate host and port for improved connection handling.
- Refactored call initiation logic to ensure robust error reporting and user guidance during connection issues.
This commit is contained in:
2025-11-21 19:52:50 -03:00
parent 1f48247493
commit 5122eacddd
4 changed files with 686 additions and 77 deletions

View File

@@ -28,7 +28,7 @@ export function obterConfiguracaoJitsi(): ConfiguracaoJitsi {
const domain = import.meta.env.VITE_JITSI_DOMAIN || 'localhost:8443';
const appId = import.meta.env.VITE_JITSI_APP_ID || 'sgse-app';
const roomPrefix = import.meta.env.VITE_JITSI_ROOM_PREFIX || 'sgse';
const useHttps = import.meta.env.VITE_JITSI_USE_HTTPS === 'true';
const useHttps = import.meta.env.VITE_JITSI_USE_HTTPS === 'true' || domain.includes(':8443');
return {
domain,
@@ -38,6 +38,15 @@ export function obterConfiguracaoJitsi(): ConfiguracaoJitsi {
};
}
/**
* Obter host e porta separados do domínio
*/
export function obterHostEPorta(domain: string): { host: string; porta: number } {
const [host, portaStr] = domain.split(':');
const porta = portaStr ? parseInt(portaStr, 10) : (domain.includes('8443') ? 8443 : 443);
return { host: host || 'localhost', porta };
}
/**
* Gerar nome único para a sala Jitsi
*/