Video SDK Overview
The EnableX Video SDK is a client-side library that gives your application direct, real-time control over audio and video. You use it to build the UI and experience of your video application — the SDK takes care of WebRTC internals, signalling, and media routing so you don't have to.
EnableX provides SDK libraries for all major client platforms. Each SDK exposes the same concepts — rooms, streams, events, moderator controls — adapted to the language and conventions of that platform.
Regardless of which SDK you choose, every video session needs these three things ready on your server before the client SDK can connect:
- App Credentials —
app_idandapp_keyfrom the EnableX Portal. These must stay on your server and never appear in client code. - A Room — create one via the Video API and save the
room_id. - A Token — before each user joins, your server calls the Create Token API to generate a signed JWT for that user. Your client app receives the token and passes it to the SDK.
Once your server provides a token, pick your platform SDK above and follow its setup guide to build the client.
When you build a video application with EnableX, there are two distinct layers:
- Your server uses the Video API to create rooms and issue session tokens.
- Your client app uses the Video SDK to connect a user to a room, show their camera, play other participants' streams, and give them controls.
The SDK lives entirely on the client — in the user's browser, phone, or tablet. It is the bridge between your application UI and the EnableX media infrastructure.
With the Video SDK your application can:
- Capture audio and video from the device's camera and microphone
- Publish the user's stream into the video room so others can see and hear them
- Receive and display other participants' streams
- Give users controls — mute, camera toggle, device switching, screen sharing, chat
- Give moderators controls — start/stop recording, kick users, lock rooms, manage floor access
- Notify the application of everything happening in the room in real time
The Video SDK is built around two complementary mechanisms. Understanding how they work together is the key to building with any EnableX SDK — Web, Android, iOS, or otherwise.
Methods — You Tell the SDK What To Do
A method is an action your application initiates. When you want something to happen — start recording, mute a participant, share the screen — you call the corresponding SDK method.
- Connect to a room →
room.connect() - Start publishing your camera →
room.publish(localStream) - Mute microphone →
localStream.muteAudio() - Start recording →
room.startRecord() - Remove a participant →
room.dropUser(clientId)
Methods take a callback and/or fire an event to tell you whether the action succeeded. Success is always indicated by result: 0 in the response.
Event Listeners — The Server Tells You What Happened
While methods represent your intent, events represent reality. After you (or someone else in the room) triggers an action, the EnableX server processes it and fires an event back to every connected endpoint.
This is a publish-subscribe model: the server is the publisher, and your SDK is the subscriber. Events arrive for actions you initiated, for actions other participants took, and for things the platform did automatically.
You must handle events to build a working application. Simply calling a method is not enough — you need to listen for the corresponding event to know that the action took effect and to update your UI accordingly.
Three Real-World Examples
1. Recording Starts — Everyone Needs to Know
When the moderator clicks "Record" in their app, they call room.startRecord(). EnableX starts recording and immediately fires a room-record-on event to every participant's SDK — including the moderator's own.
Each participant's application should listen for this event to show a recording indicator. This way, all users know they are being recorded, regardless of who initiated it.
// All participants (including moderator) add this listener
room.addEventListener("room-record-on", function(event) {
// Show the recording badge in UI
document.getElementById("rec-badge").style.display = "inline-flex";
console.log("Session recording started");
});
// Listen for recording stopped
room.addEventListener("room-record-off", function(event) {
document.getElementById("rec-badge").style.display = "none";
console.log("Session recording stopped");
});
2. Participants Join and Leave
When a new user connects to the room, every existing participant receives a user-connected event with that user's identity. When someone disconnects, user-disconnected fires. Handle these to keep your participant list current.
room.addEventListener("user-connected", function(event, user) {
console.log("Joined:", user.name, "| Client ID:", user.clientId);
addParticipantToList(user);
});
room.addEventListener("user-disconnected", function(event, user) {
console.log("Left:", user.name, "| Client ID:", user.clientId);
removeParticipantFromList(user.clientId);
});
3. Active Speaker Changes
As participants speak, the server updates the active talker list in real time and fires active-talkers-updated. Your application listens to this to dynamically rearrange video tiles — promoting the loudest speaker to the primary view.
room.addEventListener("active-talkers-updated", function(event) {
var speakers = event.activeList;
// speakers is an ordered array — most recently active first
updateVideoLayout(speakers);
});
room-connected and stream-added fire as soon as the connection is established. If you add listeners after calling connect(), you risk missing the first events.
Where Events Are Bound: Room vs Stream
Events in the SDK are bound on either the room object or a stream object, depending on what the event relates to.
Room events — events about the session (participants, recording, moderation, chat) — are bound on EnxRoom:
room.addEventListener("room-connected", function(event) { /* ... */ });
room.addEventListener("stream-added", function(event) { /* ... */ });
room.addEventListener("user-connected", function(event, user) { /* ... */ });
room.addEventListener("active-talkers-updated", function(event) { /* ... */ });
room.addEventListener("room-record-on", function(event) { /* ... */ });
Stream events — events about a specific media track's state (device permissions, mute status) — are bound on an EnxStream instance:
// localStream is an instance of EnxStream
localStream.addEventListener("media-access-allowed", function(event) { /* ... */ });
localStream.addEventListener("media-access-denied", function(event) { /* ... */ });
Each method's documentation page specifies whether its events fire on the room or the stream — look for the Event entries listed alongside every method.