/** * A new user joined the conference. */USER_JOINED = 'conference.userJoined',/** * A user has left the conference. */USER_LEFT = 'conference.userLeft',/** * User role changed. */USER_ROLE_CHANGED = 'conference.roleChanged',
/** * A new media track was added to the conference. * @param {JitsiTrack} track the added JitsiTrack */TRACK_ADDED = 'conference.trackAdded',/** * Audio levels of a media track (attached to the conference) was changed. */TRACK_AUDIO_LEVEL_CHANGED = 'conference.audioLevelsChanged',/** * A media track (attached to the conference) mute status was changed. * @param {JitsiParticipant|null} the participant that initiated the mute if it is a remote mute. */TRACK_MUTE_CHANGED = 'conference.trackMuteChanged',/** * The media track was removed from the conference. * @param {JitsiTrack} track the removed JitsiTrack */TRACK_REMOVED = 'conference.trackRemoved',
/** * Indicates that the connection to the conference has been established * XXX This is currently fired when the *ICE* connection enters 'connected' state for the first time. */CONNECTION_ESTABLISHED = 'conference.connectionEstablished',/** * Indicates that the connection to the conference has been interrupted * XXX This is currently fired when the *ICE* connection is interrupted. */CONNECTION_INTERRUPTED = 'conference.connectionInterrupted',/** * Indicates that the connection to the conference has been restored. * XXX This is currently fired when the *ICE* connection is restored. */CONNECTION_RESTORED = 'conference.connectionRestored',
// Get all participants (excluding local)const participants = conference.getParticipants();// Get participant by ID const participant = conference.getParticipantById(participantId);// Get participant countconst count = conference.getParticipantCount();// Get local participant IDconst myId = conference.myUserId();
From JitsiConference.ts:292-367, the participants are stored in a Map:
/** * List of all the participants in the conference. * @type {Map<string, JitsiParticipant>} */this.participants = new Map();
// Get all local tracksconst localTracks = conference.getLocalTracks();// Get local tracks by media typeconst audioTracks = conference.getLocalTracks(MediaType.AUDIO);const videoTracks = conference.getLocalTracks(MediaType.VIDEO);
The conference can operate in two modes:Peer-to-Peer (P2P):
Direct connection between two participants
Lower latency, better quality for 1-on-1 calls
Automatically enabled when configured and only 2 participants present
Jitsi Videobridge (JVB):
Multi-party conferencing through the bridge
Used for 3+ participants
Supports advanced features like simulcast
From JitsiConference.ts:461-467:
/** * Flag set to <tt>true</tt> when P2P session has been established * and this conference is currently in the peer to peer mode. * @type {boolean} */this.p2p = false;
// Receive video from 5 participants conference.setLastN(5);// Receive video from all participantsconference.setLastN(-1);// Get current LastNconst lastN = conference.getLastN();