JitsiConnection class.
Overview
TheJitsiConnection class provides access to the Jitsi Meet server-side video conferencing service. It handles XMPP connection establishment, authentication, and provides the foundation for creating conferences.
Creating a Connection
Connection Options
Required Options
| Option | Type | Description |
|---|---|---|
serviceUrl | string | WebSocket URL for XMPP connection |
hosts.domain | string | XMPP domain name |
enableWebsocketResume | boolean | Enable WebSocket session resumption |
p2pStunServers | array | STUN servers for P2P connections |
Optional Options
Authentication
Anonymous Connection
Connect without credentials:Authenticated Connection
Connect with username and password:JWT Token Authentication
Provide a JWT token during connection creation:Event Handlers
Managing Connections
Disconnect
Properly close the connection:Refresh Authentication Token
Renew JWT tokens before expiration:Get Connection Info
Retrieve connection details:Feature Management
Advertise client capabilities:Attaching to Existing Sessions
For optimized reconnection, attach to an existing XMPP session:Best Practices
Handle reconnection gracefully
Handle reconnection gracefully
Implement exponential backoff for reconnection attempts:
Monitor connection quality
Monitor connection quality
Use connection statistics to monitor quality:
Clean up resources
Clean up resources
Always remove event listeners when done:
Next Steps
Managing Conferences
Learn how to create and manage conferences
Handling Media Tracks
Work with audio and video tracks