SDK Methods
EnxRtc Base Class
EnxRtc is the base class for all the APIs. The EnableX base class contains methods to connect to a room and successfully publish a stream. The base class also provides additional methods to perform vital functions like media queries, runtime device updates for streams, and so on. To start using EnableX, you must create an object using the EnxRtc Constructor.
Methods
The EnxRtc class methods are listed below.
joinRoom() | To connect the client application to an EnableX room and join a session with or without a published stream. |
clientDiagnostics() | A diagnostic tool to detect issues causing the RTC to fail. |
EnxRoom Room-Handler
The EnxRoom is a derived class from EnxRtc. It handles all the room-related functions to communicate with EnableX, such as the connection of client endpoints to EnableX room, publishing and subscription of streams, and so on.
Properties
roomID |
Unique room ID generated for each room. |
roomMetadata |
Complete room information. |
clientID |
Unique client ID assigned by EnableX to the client endpoint. |
clientName |
Name of the client connected from the endpoint. |
userRole |
Role of the client connected from the endpoint. |
publishStreamId |
Published local stream ID. |
publishStream |
Published local stream object. |
remoteStreams |
List of Remote streams. |
streamsByStreamId |
Dictionary of stream Objects. |
userList |
List of users connected to the room. |
isRoomActiveTalker |
Bolean. If Active Talker is enabled in the room. |
publishingStats |
Statistics of local stream publishing. |
Methods
The methods are listed below in the categories they belong to:
Connection
connect() | To connect a client endpoint to a room. |
disconnect() | To disconnect a client endpoint from a room. |
whoami() | To obtain a user's information from a client endpoint. |
Streaming
switchCameraPreview() | To swich Camera Feed preview. |
publish() | To publish a local stream in a room. |
unpublish() | To unpublish a local stream from a room. |
subscribe() | To subscribe to a remote stream to start receiving it. |
setReceiveVideoQuality() | To opt to receive a specific video quality. |
getMaxTalkers() | To get the maximum number of talkers allowed in the Active Talker list. |
setTalkerCount() | Set the number of talkers you want to receive in the Active Talker list. |
getTalkerCount() | To get the number of talkers set to be received in the Active Talker list. |
switchATView() | The option to switch the talker view from the leader/gallery or vice versa. |
getPlayer() | Provides the option to get a particular EnxPlayerView. |
highlightBorderForClient() | Provides the choice to highlight the EnxPlayer border color. |
changeBgColorForClients() | To change the background color for an EnxPlayer. |
forceUpdateATList() | To force reload the active talker view after manipulation. |
enableStats() | To know the statistics of local and remote streams. |
enablePlayerStats() | To individually receive statistics of streams being played on the player. |
requestFloor() | To request floor access from the moderator to publish a stream in the Lecture mode. |
cancelFloor() | To allow a participant to cancel floor access request pending moderator's approval. |
getLocalStream() | Initialize a local stream at the client endpoint before publishing it to the room. |
startCanvas() | To start canvas streaming. |
stopCanvas() | To stop canvas streaming. |
stopAllSharing() | To force stop an ongoing canvas streaming. |
startAnnotation() | To start annotation on a specific stream object. |
stopAnnotation() | To stop annotation. |
Advance Features
sendMessage() | To send public and private messages to other users in a room. |
sendFiles() | To upload files to share with all or selected users in a room. |
cancelUpload() | To cancel an ongoing file upload job initiated by you. |
getAvailableFiles() | To get a list of files available for download. |
downloadFile() | To download the available files. |
cancelDownload() | To cancel the ongoing file download job at your endpoint. |
cancelAllDownload() | To cancel all ongoing file downloads at your endpoint. |
startScreenShare() | To create a screen sharing stream @ 6fps to publish in a room. |
stopScreenShare() | To stop the ongoing screen sharing. |
stopAllSharing() | To force stop ongoing screen sharing. |
exitScreenShare() | To instruct the Screen Share Broadcaster Extension to exit the ongoing session. |
sendUserData() | To send customized data adhering to a structure not bound by the EnableX message structure to one or more users connected to a session. |
Moderator Controls
muteAllUser() | To hard-mute a room where no participant can talk. |
unMuteAllUser() | To switch a room from a hard-mute state to a normal state. |
hardMuteUserAudio() | To hard-mute a participant's audio. |
hardMuteUserVideo() | To hard-mute a participant's video stream. |
hardUnMuteUserAudio() | To hard-unmute a participant's audio. |
hardUnMuteUserVideo() | To hard-unmute a participant's video stream. |
lockRoom() | To lock a room, which forbids new users from joining the session. |
unlockRoom() | To allow subsequent users to join a session. |
startRecord() | To allow a moderator to start recording a session. |
stopRecord() | To stop session recording. |
startLiveRecording() | To start live recording a session. |
stopLiveRecording() | To stop live recording a session. |
dropUser() | To allow a moderator to disconnect/force-drop one or more participants from a session. |
destroy() | To allow a moderator to conclude an ongoing session. |
approveAwaitedUser() | To allow a moderator to approve a user's entry. |
denyAwaitedUser() | To decline a user's entry to a session. |
startStreaming() | To allow a moderator to forward live video sessions over an RTMP stream to any live streaming CDNs supporting this protocol. |
stopStreaming() | To stop forwarding an RTMP stream. |
pinUsers() | To allow a moderator to pin a user to the Active Talker list irrespective of the user's activity level. |
addSpotlightUsers() | To allow a moderator to spotlight a user, pushing the user's stream to the top of the Active Talker list irrespective of the user's activity level. |
switchUserRole() | To allow a moderator to promote a participant to act as a moderator in the ongoing Session. |
switchRoomMode() | To switch from the Group to Lecture mode and vice versa during an ongoing session. |
Floor Access Controls
requestFloor() | To allow a participant to request floor access from the moderator. |
cancelFloor() | To allow a participant to cancel a floor access request pending moderator's approval. |
grantFloor() | To grant floor access to a participant in the Lecture mode. |
denyFloor() | To deny floor access to a participant in the Lecture mode. |
finishFloor() | To announce the completion of floor access and its availability for subsequent requests. |
releaseFloor() | To release floor access from a participant in the Lecture mode. |
inviteToFloor() | To invite a participant of an ongoing conference to the floor. |
cancelFloorInvite() | To allow a moderator to cancel a floor access invitation sent to a participant. |
acceptInviteFloorRequest() | To allow a participant to accept a floor invitation and talk. |
rejectInviteFloor() | To allow the invited participant to reject the floor access invitation. |
Devices
getDevices() | To obtain a list of audio devices connected to a client endpoint. |
getSelectedDevice() | To obtain the user's name of the currently selected device. |
switchMediaDevice() | To switch to another audio device. |
Breakout Room
createBreakOutRoom() | To create a breakout room. |
inviteToBreakOutRoom() | To allow the creator or owner of a breakout room to invite one or more users from the parent room to join the breakout room. |
createAndInviteBreakoutRoom() | To support specific use cases where auto-assignment of users into different breakout rooms is required. |
joinBreakoutRoom() | To join a breakout room on the breakout room creator's invitation. |
rejectBreakoutRoom() | To allow an invited user to reject the invitation to join a breakout room. |
pause() | To allow a user to pause the parent room after joining a breakout room. |
resume() | To resume the parent room if it was paused while joining a breakout room. |
muteRoom() | To allow a user to mute audio and/or video of the parent room after joining a breakout room. |
unmuteRoom() | To unmute audio and/or video of the parent room after disconnecting from a breakout room and resuming the parent room. |
disconnect() | To disconnect from a breakout room. |
clearAllBreakOutSession() | To allow a participant to clear all breakout rooms. |
destroyAllBreakOutSession() | To allow a moderator to destroy all the breakout room sessions. |
Miscellaneous
postClientLogs() | To share the console log with EnableX Technical team for audit. |
setAudioOnlyMode() | To switch to an audio-only call where you can neither receive a video from others nor publish your own video. |
makeOutboundCall() | To initiate an outbound call to PSTN number or a SIP URI while in a session inviting the called participant to join the session on accepting the call. |
cancelOutboundCall() | To cancel an ongoing outbound call to a PSTN number or a SIP URI, thus disconnecting the participant from the session on passing the number. |
stopVideoTracksOnApplicationBackground() | To configure the state of streams when moving the application from foreground to background. |
startVideoTracksOnApplicationForeground() | To configure the state of streams when moving the application from background to foreground. |
adjustLayout() | To adjust the video player layout to fit within its parent view. |
subscribeForTalkerNotification() | To receive notification for the talkers in a room or the participants acting as a source of noise. |
Delegate Methods
The Delegate methods are categorized by their functions.
Connection
room:didConnect | Acknowledgment to the user when the client endpoint is successfully connected to the room. |
roomDidDisconnected | Acknowledgment to the user when the client endpoint is disconnected from the room. |
room:didError | Acknowledgment to the user when the client endpoint fails to connect to the room. |
room:userDidJoined | Notification to everyone in a room when a new user joins the room. |
room:userDidDisconnected | Notification to everyone in a room when a user is disconnected from the room. |
Reconnection
room:didConnectionLost | Acknowledgment to the user when the client endpoint loses network connection. |
room:didConnectionInterrupted | Acknowledgment to the user when the client endpoint's connection is interrupted. For example, this can occur when the connection is switched from WiFi to 4G and vice versa. |
room:didUserReconnectSuccess | Acknowledgment to the user when the client endpoint is successfully reconnected with EnableX. |
room:didReconnect | Acknowledgment to the user when the client endpoint is trying to reconnect within the specified time. |
Streaming
room:didPublishStream | Acknowledgment to the user when the user's stream is successfully published into the room. |
room:didUnpublishStream | Acknowledgment to the user when the user's stream is unpublished/removed from the room. |
room:didAddedStream | Notification to everyone in a room when a stream is published in the room. |
room:didRemovedStream | Notification to everyone in a room when a stream is unpublished/removed from the room. |
room:didSubscribeStream | Acknowledgment to users when they successfully subscribe to a remote stream. |
room:activeTalkerList | Notification to everyone in a room when the list of Active Talkers is updated. |
room:didOutBoundCallInitiated: | Notification to the call initiator when a dial-out call is initiated. |
room:didDialStateEvents: | Notification to the call initiator about the status of the dial-out process as received from the gateway. The JSON response returns status codes as initiated, calling, connecting, connected, and terminated. |
room:didOutBoundCallCancel: | Notification to the call initiator when a participant is disconnected. |
Devices
didNotifyDeviceUpdate |
Acknowledgment to the user when an audio device is changed. |
Logging
didLogUpload |
When the log is successfully uploaded to the server. |
Recording
startRecordingEvent | Acknowledgment to the moderator when the session recording starts. |
stopRecordingEvent | Acknowledgment to the moderator when the session recording stops. |
roomRecordOn | Notification to all the participants when the session recording starts. |
roomRecordOff | Notification to all the participants when the session recording stops. |
didACKStartLiveRecording | Acknowledgment callback to the moderator when the live recording starts. |
didLiveRecordingNotification | Notification to all the participants in a conference indicating that live recording has started. |
didRoomliverecordOn | Notification to a new user joining a session if the session is being recorded live. |
didACKStopLiveRecording | Acknowledgment callback to the moderator when live recording stops. |
didRoomliverecordOn | Notification to all the participants in a conference indicating that live recording has stopped. |
Hard Mute
didMutedAllUser | Acknowledgment to the moderator when the room is put on a hard mute state. |
didUnMutedAllUser | Acknowledgment to the moderator when the room is put off a hard mute state. |
didHardMutedAll | Notification to all the participants when the room is put on a hard mute state. |
didHardUnMuteAllUser | Notification to all the participants when the room is put off a hard mute state. |
Screen Sharing
room:screenSharedStarted |
Notification to everyone in a room when screen sharing starts. |
room:screenSharedStopped |
Notification to everyone in a room when screen sharing stops. |
Canvas Streaming
room:canvasStarted | Notification to everyone in a room when canvas streaming has started. |
room:canvasStopped | Notification to everyone in a room when canvas streaming has stopped. |
Lecture Mode
didFloorRequested | Acknowledgment to a participant when the participant's request for floor access is sent to the moderator. |
didFloorRequestReceived | Notification to the moderator when a new floor access request is received. |
didGrantFloorRequested | Notification to a participant when the participant's floor access is granted by the moderator. |
didDenyFloorRequested | Notification to a participant when the participant's floor access is denied by the moderator. |
didReleaseFloorRequested | Notification to a participant when the participant's floor access permission is denied by the moderator. |
didProcessFloorRequested | Acknowledgment to a moderator on the moderator's actions on floor access requests such as granting, denying, and releasing floor access. |
Active Talkers
room:didGetMaxTalkers | Notifying a user about the maximum number of permissible active talkers in a room. |
room:didGetTalkerCount | Notifying a user about the number of active talkers to be received in the Active Talker list. |
room:didSetTalkerCount | Acknowledgment to a user when the number of active talkers is updated in the Active Talker list. |
Breakout Room
room:didAckCreateBreakOutRoom | Acknowledgment to the creator of a breakout room with the breakout room details returned in a JSON object when the breakout room is created. |
room:didAckInviteBreakOutRoom | Acknowledgment to the creator of a breakout room with a JSON object returned as a response to the invitation process. |
room:didInvitationForBreakoutRoom | Notification to the invited users when they are invited to join a breakout room. |
room:didBreakoutRoomInvited | Notification to all the moderators in the parent room when a user is invited to a breakout room. |
room:didBreakoutroomjoining | Notification sent to the invited participant when the participants are connected to a breakout room. |
room:didAckCreateAndInviteBreakOutRoom | Acknowledgment to the creator with the result of invitation in a JSON Array. |
room:didConnectedBreakoutRoom | Acknowledgment to a user when the user successfully joins a breakout room. |
room:didFailedJoinBreakOutRoom | Notification to a user when the user fails to join a breakout room. |
room:didUserJoinedBreakoutRoom: | Notification to everyone in a breakout room when a new user joins the room. |
room:didAckRejectBreakoutRoom | Acknowledgment to a user who rejected the breakout room invitation when the request to reject is successfully processed. |
room:didBreakoutRoomInviteRejected | Notification to all the moderators in the parent room when a user rejects an invitation to a breakout room. |
room:didDisconnectedBreakoutRoom | Acknowledgment to the user when the user is successfully disconnected from the breakout room. |
room:didUserDisconnectedFromBreakoutRoom | Notification to everyone in a breakout room when a user gets disconnected from the room. |
room:didDisconnectedBreakoutRoom | Notification to the moderator/owner of a breakout room with the disconnected participant's information. |
room:didDestroyedBreakoutRoom | Notification to the owner of a breakout room when the room is destroyed. |
room:didDisconnectedBreakoutRoom | Notification to the owner of a breakout room when the room is disconnected. |
Statistics
didAcknowledgeStats | Acknowledgment to the user when stream statistics are enabled or disabled. |
didReceiveStats |
Notification to the user when stream statistics are received. |
File Sharing - At File Sender's End
room:didInitFileUpload | Acknowledgment to the sender when a file upload process is initiated. |
room:didFileUploaded |
Acknowledgment to the sender when the file is uploaded. |
room:didFileUploadFailed | Acknowledgment to the sender when the file upload process fails. |
File Sharing - At File Receiver's End
room:didFileUploadStarted | Notification to the intended receiver when a file is uploaded. |
room:didFileAvailable | Notification to the intended receiver when a file is ready for download. |
room:didFileDownloaded | Notification to the receiver when a file is downloaded with either Base64 raw data that must be saved when auto-saving is false or saved in a file path. |
room:didFileDownloadFailed |
Notification to the receiver when a file download fails. |
Miscellaneous
room:didBandWidthUpdated | Notification to the user when a significant change is noticed in the downstream bandwidth at the client endpoint. |
room:didEventError | Acknowledgment to the user when the client endpoint fails to perform an event. |
room:didReceiveChatDataAtRoom |
Client endpoint receives text messages. |
room:didSwitchUserRole | Acknowledgment to the moderator when the moderator switches a user's role. |
room:didUserRoleChanged | Notification to everyone in a room when a user is newly appointed as the moderator of the room and additional information is provided to the newly appointed moderator. |
room:didAckSwitchRoom | Acknowledgment to the moderator when the room mode is switched. |
room:didRoomModeSwitched | Notification to everyone in a room when the room mode is switched by the moderator of the room. |
EnxStream Stream Handler
The EnxStream class is a derived class from EnxRtc. It handles all the media stream-related functions to initiate, configure, and transport streams to EnableX Media servers. It is also used for receiving stream endpoints for playing.
Properties
streamId |
Unique stream ID. |
isLocal | Boolean. A True value represents local stream, a False value represents remote stream. |
screen |
Boolean. True if the stream carries Screen Share. |
isSelfAudioMuted | Boolean. A True value means that a local stream's audio is muted. |
isSelfVideoMuted | Boolean. A True value means that a local stream's video is muted. |
Methods
The stream handler methods are categorized below.
Stream Information
hasAudio() | To know if the stream has an audio track. |
hasVideo() | To know if the stream has a video track. |
hasData() | To know if the stream has text data. |
Stream Controls
muteSelfAudio() | To mute/unmute the audio of a local stream. |
muteSelfVideo() | To mute/unmute the video of a local stream. |
switchCamera() | To switch the stream source from the rear to the front camera or vice-versa. |
updateConfiguration() | To reconfigure a stream by adding new or updating existing attributes of the stream. |
Moderator Controls
hardMuteAudio() | To hard mute a participant's audio. |
hardMuteVideo() | To hard mute a participant's video. |
hardUnMuteAudio() | To lift the audio hard-mute restriction from a participant. |
hardUnMuteVideo() | To lift the video hard-mute restriction from a participant. |
Play Stream
attachRenderer() | To attach a stream to the Player View. |
detachRenderer() | To detach a stream from the Player View. |
Delegate Methods
The delegate methods are categorized below based on their functions.
Streaming
didAudioEvents | Notification to a stream publisher when the audio of the publisher's local stream video is muted/unmuted. |
didVideoEvents | Notification to a stream publisher when the video of the publisher's local stream is muted/unmuted. |
stream:didSelfMuteVideo | Notification to a stream publisher when the video of the publisher's local stream is muted. |
stream:didSelfUnmuteVideo | Notification to a stream publisher when the video of the publisher's local stream is unmuted. |
stream:didSelfMuteAudio | Notification to a stream publisher when the audio of the publisher's local stream is muted. |
stream:didSelfUnmuteAudio | Notification to a stream publisher when the audio of the publisher's local stream is unmuted. |
Messaging
didReceiveData: |
When text messages are received. |
Hard Mute Audio
didhardMuteAudio | Acknowledgment to the moderator when a participant's video stream is hard-muted. |
didhardUnMuteAudio | Acknowledgment to the moderator when the hard-mute restriction is lifted from a participant's video stream. |
didRecievedHardMutedAudio | Notification to participants when the moderator hard-mutes their audio streams. |
didRecievedHardUnmutedAudio | Notification to participants when the moderator lifts the hard-mute restriction from their audio streams. |
Hard Mute Video
stream:didHardVideoMute | Acknowledgment to the moderator when a participant's video stream is hard-muted. |
stream:didHardVideoUnMute | Acknowledgment to the moderator when the hard-mute restriction is lifted from a participant's video stream. |
stream:didReceivehardMuteVideo | Notification to participants when the moderator hard-mutes their video streams. |
stream:didReceivehardUnmuteVideo | Notification to the participant when the moderator lifts the hard-mute restriction from their video stream. |