Session Management
Session Management covers the moderator controls available in an EnableX Cordova session: recording, room-wide audio muting, entry restrictions, participant role management, force-disconnect, session extension, and session termination. All methods on this page are moderator-only unless noted otherwise.
An EnableX session can be recorded as individual streams and then transcoded into a single composite video file for later playback. Recording can be configured to start automatically when the first user joins, or triggered on demand by the moderator.
Auto-Recording
To start recording automatically, create the room with settings.auto_recording: true in
the Room Creation API payload. Recording begins as soon as the first participant joins — no SDK
call is needed.
Start Recording
startRecord() initiates on-demand recording. The moderator receives
onStartRecordingEvent as a confirmation, and all other participants receive
onRoomRecordingOn so they can display a recording indicator.
- Method:
window.EnxRtc.startRecord()
window.EnxRtc.startRecord();
// Moderator confirmation
window.EnxRtc.addEventListner("onStartRecordingEvent", function(data) {
console.log("Recording started:", JSON.stringify(data.data));
showRecordingBadge();
});
// All participants are notified
window.EnxRtc.addEventListner("onRoomRecordingOn", function(data) {
console.log("Room recording ON:", JSON.stringify(data.data));
showRecordingIndicator();
});
Stop Recording
stopRecord() stops the current recording segment. The moderator receives
onStopRecordingEvent and all participants receive onRoomRecordingOff.
- Method:
window.EnxRtc.stopRecord()
window.EnxRtc.stopRecord();
// Moderator confirmation
window.EnxRtc.addEventListner("onStopRecordingEvent", function(data) {
console.log("Recording stopped:", JSON.stringify(data.data));
hideRecordingBadge();
});
// All participants are notified
window.EnxRtc.addEventListner("onRoomRecordingOff", function(data) {
console.log("Room recording OFF:", JSON.stringify(data.data));
hideRecordingIndicator();
});
Play a Recorded File
Recordings stored on the EnableX server are protected by HTTP Basic Authentication. Standard video
players cannot access them with a URL alone — you must supply access credentials. The recommended
approach is to add the cordova-plugin-video-player plugin:
cordova plugin add cordova-plugin-video-player
Hard mute is a room-level audio control that forces all participants to mute their microphones. A new participant who joins a hard-muted room is automatically muted. Only the moderator can lift a hard mute — participants cannot unmute themselves while it is active.
Hard Mute a Room
- Method:
window.EnxRtc.hardMute()
| Event | Fired To | Description |
|---|---|---|
onHardMuted | Moderator | Confirms the room is now hard-muted |
onReceivedHardMute | All participants | Notifies everyone that hard mute is active |
window.EnxRtc.hardMute();
window.EnxRtc.addEventListner("onHardMuted", function(data) {
console.log("Hard mute applied (moderator):", JSON.stringify(data.data));
});
window.EnxRtc.addEventListner("onReceivedHardMute", function(data) {
console.log("Room hard muted (all):", JSON.stringify(data.data));
disableMicrophoneButton();
});
Hard Unmute a Room
- Method:
window.EnxRtc.hardUnMute()
| Event | Fired To | Description |
|---|---|---|
onHardUnMuted | Moderator | Confirms the room is no longer hard-muted |
onReceivedHardUnMute | All participants | Notifies everyone that hard mute is lifted |
window.EnxRtc.hardUnMute();
window.EnxRtc.addEventListner("onHardUnMuted", function(data) {
console.log("Hard mute lifted (moderator):", JSON.stringify(data.data));
});
window.EnxRtc.addEventListner("onReceivedHardUnMute", function(data) {
console.log("Room unmuted (all):", JSON.stringify(data.data));
enableMicrophoneButton();
});
Moderators can lock a room to prevent any new participants from joining the session. The lock can be lifted at any time to allow subsequent users in.
Lock a Room
- Method:
window.EnxRtc.lockRoom()
| Event | Fired To | Description |
|---|---|---|
onAckLockRoom | Moderator | Room has been locked |
onLockedRoom | All participants | Notifies everyone the room is locked |
window.EnxRtc.lockRoom();
window.EnxRtc.addEventListner("onAckLockRoom", function(data) {
console.log("Room locked (moderator):", JSON.stringify(data.data));
});
window.EnxRtc.addEventListner("onLockedRoom", function(data) {
console.log("Room is locked (all):", JSON.stringify(data.data));
showLockedBadge();
});
Unlock a Room
- Method:
window.EnxRtc.unLockRoom()
| Event | Fired To | Description |
|---|---|---|
onAckUnLockRoom | Moderator | Room has been unlocked |
onUnLockedRoom | All participants | Notifies everyone the room is unlocked |
window.EnxRtc.unLockRoom();
window.EnxRtc.addEventListner("onAckUnLockRoom", function(data) {
console.log("Room unlocked (moderator):", JSON.stringify(data.data));
});
window.EnxRtc.addEventListner("onUnLockedRoom", function(data) {
console.log("Room is unlocked (all):", JSON.stringify(data.data));
hideLockedBadge();
});
switchUserRole() promotes a participant to the moderator role. The promoted participant
gains access to all moderator controls, and the current moderator becomes a regular participant. The
new moderator can subsequently grant the role to another participant.
- Method:
window.EnxRtc.switchUserRole(clientId) - Parameter:
clientId— String. Client ID of the participant to promote
| Event | Fired To | Description |
|---|---|---|
onSwitchedUserRole | Moderator | Confirms the role-switch request was accepted |
onUserRoleChanged | All participants | Notifies everyone of the role change; new moderator receives extra moderation data |
window.EnxRtc.switchUserRole(clientId);
window.EnxRtc.addEventListner("onSwitchedUserRole", function(data) {
console.log("Role switch acknowledged:", JSON.stringify(data.data));
});
window.EnxRtc.addEventListner("onUserRoleChanged", function(data) {
console.log("Role changed in room:", JSON.stringify(data.data));
refreshModeratorControls(data.data);
});
dropUser() allows the moderator to force-disconnect one or more participants from the
session. Pass an array of client IDs to drop multiple users at once.
- Method:
window.EnxRtc.dropUser(clientIDs) - Parameter:
clientIDs— Array of client ID strings to disconnect
| Event | Fired To | Description |
|---|---|---|
onAckDropUser | Moderator | Confirms the drop was processed |
onRoomDisConnected | Dropped users | Notifies dropped participants with the disconnection reason |
// Drop one or more participants
var clientsToRemove = ["client_id_1", "client_id_2"];
window.EnxRtc.dropUser(clientsToRemove);
window.EnxRtc.addEventListner("onAckDropUser", function(data) {
console.log("Users dropped:", JSON.stringify(data.data));
});
// Fired at the dropped users' endpoints
window.EnxRtc.addEventListner("onRoomDisConnected", function(data) {
console.log("Disconnected from room:", JSON.stringify(data.data));
showDisconnectionReason(data.data.reason);
});
Every room has a maximum duration set at creation time, counted from when the first user joins. To accommodate over-running sessions, EnableX opens an extension window 10 minutes before closure and again at 5 minutes. Any connected participant can trigger an extension. The extension can add between 10 and 30 minutes to the session, and there is no limit on how many times a session can be extended.
- Method:
window.EnxRtc.extendConferenceDuration()
| Event | Fired To | Description |
|---|---|---|
onConferenceRemainingDuration | All participants | Fires when an extension window opens; payload shows minutes remaining |
onConferencessExtended | All participants | Confirms the session has been extended |
// Extension window is open — trigger an extension
window.EnxRtc.addEventListner("onConferenceRemainingDuration", function(data) {
console.log("Session ending soon:", JSON.stringify(data.data));
// Optionally prompt the user before extending
window.EnxRtc.extendConferenceDuration();
});
// Extension confirmed for everyone
window.EnxRtc.addEventListner("onConferencessExtended", function(data) {
console.log("Session extended:", JSON.stringify(data.data));
updateSessionTimer(data.data.extendedDuration);
});
destroy() terminates the entire session for all participants. Every connected user is
disconnected and the room is closed. Use this instead of disconnect() when you want to
end the session for everyone, not just the local user.
- Method:
window.EnxRtc.destroy()
| Event | Fired To | Description |
|---|---|---|
onAckDestroy | Moderator | Confirms the destroy request was accepted |
onRoomDisConnected | All participants | Notifies everyone that the session has ended |
window.EnxRtc.destroy();
window.EnxRtc.addEventListner("onAckDestroy", function(data) {
console.log("Session destroyed (moderator):", JSON.stringify(data.data));
});
window.EnxRtc.addEventListner("onRoomDisConnected", function(data) {
console.log("Session ended (all):", JSON.stringify(data.data));
navigateToHomeScreen();
});