ConferenceClient object.
Installation
Key concepts
- Room — a named session identified by a
roomId. Multiple users join the same room to exchange audio and video. - Participant — a user in the room, identified by a
userId. Each participant can publish audio/video (role:publisher) or receive only (role:subscriber). - Media tracks — participants publish their local
MediaStreamvia WHIP, and subscribe to each other’s streams via WHEP. You receive aMediaStreamfor each subscribed participant to attach to a<video>element.
Joining a room
Subscribe to new participants
Listen for
NEW_PARTICIPANT and subscribe automatically so you receive their video as soon as they join.Media controls
Mute and unmute your local audio and video without leaving the room.Screen sharing
Virtual backgrounds
Virtual backgrounds use@mediapipe/selfie_segmentation to replace or blur the area behind your camera feed.
Available background types:
| Type | Description |
|---|---|
VirtualBackgroundTypes.NONE | No background processing |
VirtualBackgroundTypes.BLUR | Strong blur |
VirtualBackgroundTypes.SLIGHT_BLUR | Light blur |
VirtualBackgroundTypes.IMAGE | Image replacement |
VirtualBackgroundTypes.COLOR | Solid color replacement |
Local recording
Record participant streams directly in the browser. The recording is stored locally and downloaded as a ZIP file.Chat
Send and receive text messages within the room using PubNub. Pass your PubNub keys in theConferenceClient config.
Configuration reference
| Property | Type | Default | Description |
|---|---|---|---|
host | string | Required | Red5 Pro server address |
nodeGroup | string | undefined | Target node group for scaling |
iceServers | RTCIceServer[] | undefined | STUN/TURN server configurations |
reconnectionEnabled | boolean | false | Enable automatic reconnection |
maxVideoBitrateKbps | number | undefined | Maximum video bitrate for publishing |
statsPollingInterval | number | undefined | WebRTC stats polling interval in ms |
pubnubPublishKey | string | undefined | PubNub key for chat |
pubnubSubscribeKey | string | undefined | PubNub key for chat |
enableNoiseCancellation | boolean | false | Enable RNNoise noise suppression |
API reference highlights
Room management
Room management
| Method | Returns | Description |
|---|---|---|
join(roomId, userId, token, role, mediaStream, videoEnabled, audioEnabled) | Promise<boolean> | Join a conference room |
leave() | Promise<void> | Leave the conference room |
getRoomUsers() | Object | Get all current room users |
getIsJoined() | boolean | true if currently in a room |
getIsPublishing() | boolean | true if currently publishing |
Subscribing
Subscribing
| Method | Returns | Description |
|---|---|---|
subscribe(user: User) | Promise<{ subscriber, user, mediaStream }> | Subscribe to a participant’s stream |
unsubscribe(userId: string) | Promise<void> | Stop subscribing to a participant |
Events
Events
| Event | Description |
|---|---|
USER_PUBLISHED | Local client published successfully |
NEW_PARTICIPANT | A new participant joined the room |
PARTICIPANT_DISCONNECTED | A participant left the room |
SUBSCRIBE_SUCCESS | Successfully subscribed to a participant |
ROOM_STATE_UPDATE | Room users, roles, or states changed |
CHAT_MESSAGE | A chat message was received |
ISSUES_DETECTED | Network or WebRTC issues detected |
VIDEO_MUTED / AUDIO_MUTED | Video or audio muted successfully |
