List of SDK Methods
EnxRtc Base Class
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.
Method | Description |
---|---|
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 any issue causing the RTC to fail. |
clientBitrate() | To get the bitrate status of the client. |
EnxRoom Class 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.
Attributes
Attribute | Description |
---|---|
roomID | Unique room identifier generated for each room. |
clientID | Unique Client ID assigned by EnableX to the client endpoint. |
streams | Dummy Streams available for subscription. The Active Talker Notification provides a list of streams carrying media. |
remoteStreams | List of remote streams. |
localStreams | List of local streams. |
status | Status of a room connection: Enum (1=Connecting, 2=Connected, 0=Disconnected). |
awaitedParticipants | List of users awaiting moderator's approval to enter a knock-enabled room. |
raisedHands | List of users requesting Floor Access in the Lecture mode. |
approvedHands | List of users approved for Floor Access in the Lecture mode. |
Methods
The methods are listed below in the categories they belong to:
Connection
Method | Description |
---|---|
connect() | To connect a client endpoint to a room. |
disconnect() | To disconnect a client endpoint from a room. |
getRoomMetaData() | To get complete metadata of the connected room. |
getRoomId() | To retrieve the Room ID. |
getMode() | To get a room mode viz. group or lecture. |
getRole() | To get the user's role connected to a room viz. moderator or participant. |
getClientId() | To get the client ID of the user connected to a room. |
getClientName() | To get the client name of the user connected to a room. |
getUserList() | To get a list of users connected to a room. |
getAvailableFiles() | To get a list of files shared in a room after joining the session. |
getLocalStream() | Initialize a local stream at the client endpoint before it can be published to a room. |
whoami() | To provide the complete user meta information of the connected user. |
Streaming
Method | Description |
---|---|
switchCameraPreview() | To switch 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 receive a desired video quality at the client endpoint. |
getMaxTalkers() | To get the maximum number of talkers allowed in the Active Talker list. |
setTalkerCount() | To set the number of talkers for the Active Talker list. |
getTalkerCount() | To get the number of talkers in the Active Talker list. |
switchATView() | Provides the option to switch their talker view from leader or 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() | Reload the Active Talker view after any manipulation. |
enableStats() | To know the statistics of local and remote streams. |
getLocalStreamID() | To get the stream ID of the local streams. |
getStreamByStreamId() | To get the stream information for the given stream ID. |
getRemoteStreams() | Get the list of remote streams published in a room. |
isPublishing() | To know if the local stream is being published in a room. |
setAudioOnlyMode() | To switch to an audio-only call where you can neither receive anybody's video nor publish your video. |
Advanced Features
Method | Description |
---|---|
startScreenShare() | To create a screen-sharing stream. |
stopScreenShare() | To stop the ongoing screen-sharing. |
stopAllSharing() | To force stop any ongoing screen sharing with another user in a Room by the moderator. |
startCanvas() | To start canvas streaming. |
stopCanvas() | To stop canvas streaming. |
stopAllSharing() | To force stop any ongoing canvas streaming with another user in a room by the moderator. |
startAnnotation() | To start annotation on a given stream object. |
stopAnnotation() | To stop annotation on a given stream object. |
subscribeForTalkerNotification() | To receive notification for the talkers in a room or the participants acting as a source of the noise. |
sendUserData() | To send customized data adhering to a structure not bounded by EnableX message structure to one or more users connected in a session. |
pause() | To allow the user to pause a parent room after joining the breakout room. |
resume() | To resume the parent room if it was paused while joining the breakout room. |
muteRoom() | Allows the user to mute audio and/or video of the parent room after joining the breakout room. |
unMuteRoom() | To unmute audio and/or video of the parent room after disconnecting from the breakout room and resuming the parent room. |
onSpeechDetected() | To send a notification to the user when speech is detected at their endpoint. |
onNoiseDetected() | To notify the user when noise is detected at their endpoint. |
enableProximitySensor() | To enable the camera to detect proximity. |
makeOutboundCall() | To initiate an outbound call to PSTN Number or SIP URI, while in a session, thus inviting the called participant to join a session on accepting the call. |
cancelOutboundCall() | To cancel an ongoing outbound call to PSTN Number or SIP URI, thus disconnecting the participant from a session on passing the number. |
postClientLogs() | To share console log with EnableX Tech Team for an audit. |
Moderator Controls
Method | Description |
---|---|
hardMute() | To hard-mute a room where all the participants are on mute. |
hardMuteUserAudio() | Allows the moderator to hard-mute a participant's audio. |
hardMuteUserVideo() | Allows the moderator to hard-mute a participant's video. |
hardUnMuteUserAudio() | Allows the moderator to hard-unmute a participant's audio. |
hardUnMuteUserVideo() | Allows the moderator to hard-unmute a participant's video. |
startRecord() | To start the recording of a session. |
stopRecord() | To stop the recording of a session. |
startLiveRecording() | Allows a moderator to start live recording of a session. |
stopLiveRecording() | Allows a moderator to stop live recording of a session. |
switchUserRole() | Allows a moderator to designate a connected participant to act as a moderator during a session. |
lockRoom() | To lock a room preventing a new participant from joining the session. |
unLockRoom() | To unlock a room and allow subsequent users to join the session. |
dropUser() | To disconnect or force-drop a participant from a session. |
destroy() | To stop or disconnect an ongoing session. |
approveAwaitedUser() | To grant permission to a user waiting to join a knock-enabled room. |
denyAwaitedUser() | To deny permission to a user waiting to join a knock-enabled room. |
switchUserRole() | Allows a moderator to designate a connected participant to act as a moderator during a session. |
startStreaming() | To start forwarding an RTMP stream. |
stopStreaming() | To stop forwarding an RTMP stream. |
pinUsers() | To pin one or more user streams. |
addSpotlightUsers() | To add a spotlight on one or more user streams. |
Floor Access Controls
Method | Description |
---|---|
requestFloor() | Request moderator permission to access the floor and publish the local stream in the Lecture mode. |
cancelFloor() | To cancel the request for floor access pending with the moderator. |
denyFloor() | To deny a participant's request for floor access in the Lecture mode. |
grantFloor() | To grant floor access permission to participants allowing them to publish their local stream in the Lecture mode. |
finishFloor() | To finish the floor access for a participant. |
releaseFloor() | To terminate the floor access granted to some participants. |
inviteToFloor() | To provide additional options to a moderator to organize a conference in the Lecture mode. |
cancelFloorInvite() | To allow a moderator to cancel a floor invitation sent to a participant. |
acceptInviteFloorRequest() | To allow participants to accept the invitation to the floor. |
rejectInviteFloor() | To allow the invited participants to reject the invitation to the floor. |
Devices
Method | Description |
---|---|
getDevices() | To get a list of audio devices connected to the client endpoint. |
getSelectedDevice() | To get the user's name of the currently selected device. |
switchMediaDevice() | To switch to another audio device. |
switchCamera() | Allows switching between the rear and front camera as a source for the published stream. |
Breakout Room
Method | Description |
---|---|
createBreakOutRoom() | To create a breakout room. |
inviteToBreakOutRoom() | To allow the creator/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 allow users to join a breakout room. |
rejectBreakOutRoom() | To allow the invited user to reject the invitation to join a breakout room. |
clearAllBreakOutSession() | Allows the participant to clear all breakout rooms. |
destroyAllBreakOutSession() | Allows the moderator to destroy all the breakout room sessions. |
Messaging and File Sharing
Method | Description |
---|---|
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. |
downloadFile() | To download the available files. |
cancelDownload() | To cancel the ongoing file download job at your endpoint. |
CancelUpload() | To cancel an ongoing file upload job. |
Miscellaneous
Method | Description |
---|---|
postClientLogs() | To submit client endpoint logs to the EnableX Team to audit. |
changeToAudioOnly() | To change from normal to audio-only mode where the user can neither receive nor publish their video and vice-versa. |
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. |
joinAsideRoom() | To join aside room. |
Observers and their Callbacks
Room Observer
Below is a list of callbacks for Room-related events categorized by their functions. The room observer is initiated along with Room Initialization Process. |
Connection
Event | Description |
---|---|
onRoomConnected | Acknowledgment to a user when the client endpoint is successfully connected to a room. |
onRoomDisConnected | Acknowledgment to a user when the client endpoint is successfully disconnected from a room. |
onRoomError | Acknowledgment to a user when the client endpoint fails to connect to a room. |
onUserConnected | Notification to everyone in a room when a new user enters the room. |
onUserDisConnected | Notification to everyone in a room when a user is disconnected from the room. |
onConnectionLost | Acknowledgment to the user when the client endpoint loses the network connection. |
onConnectionInterrupted | Acknowledgment to the user when the client endpoint's connection is interrupted, such as a switching from WiFi to 4G and vice versa. |
onUserReconnectSuccess | Acknowledgment to the user when the client endpoint gets reconnected with EnableX successfully. |
onReconnect | Acknowledgment to the user when the client endpoint is trying to reconnect within the given time. |
Streaming
Event | Description |
---|---|
onPublishedStream | Acknowledgment to the user when the user's stream has been published into the room successfully. |
onUnPublishedStream | Acknowledgment to the user when the user's stream has been unpublished or removed from the room. |
onStreamAdded | Notification to everyone in a room when a stream is published in the room. |
onRemovedStream | Notification to everyone in a room when a stream is unpublished or removed from the room. |
onSubscribedStream | Notification to users when they successfully subscribe to a remote stream. |
onActiveTalkerList | Notification to everyone in a room when the list of active talkers is updated. |
onActiveTalkerView | Notification to everyone when video UI view built on a list of Active Talkers. |
onCanvasStarted | Notification when text messages are received. |
onCanvasStopped | Notification to everyone in a room when canvas streaming stops. |
onDialStateEvents | Notification to the call initiator about the status of the dial-out process as received from Gateway. The JSON Response returns status codes: initiated, calling, connecting, connected, and terminated. |
onDTMFCollected | Notification to everyone when DTMF input is collected. It gets the String of digits collected. |
onOutBoundCallCancel | Notification to the call initiator when the participant gets disconnected. |
Devices
Event | Description |
---|---|
onNotifyDeviceUpdate | Acknowledgment to a user that the audio device is changed. |
onDeviceAdded | Acknowledgment to a user that a new audio device has been added. |
onDeviceRemoved | Acknowledgment to a user that the audio device is removed. |
Miscellaneous
Event | Description |
---|---|
onEventError | Acknowledgment to a user when the client endpoint fails to perform an event. |
onSwitchedUserRoleChange | Acknowledgment to the Moderator when they switch a user's role. |
onUserRoleChanged | Notification to everyone in the room when a user is newly appointed as moderator and additional information provided to the newly appointed moderator. |
onReceivedChatDataRoom | The client endpoint receives messages in JSONObject. |
onAckSwitchedRoom | Acknowledgment to the moderator when the room mode switch is done. |
onRoomModeSwitched | Notification to everyone when a moderator switches to room mode. |
Aside Room Observer
Observer: EnxRoom.EnxAsideRoomObserver
: To receive the following callbacks:
Event | Description |
---|---|
onJoinedAsideRoom | Notification to everyone when joined aside room. |
onFailedAsideRoom | Notification to everyone when failed to join aside room. |
onDisconnectedAsideRoom | Notification to everyone when disconnected to joined aside room. |
Log Observer
Observer: EnxRoom.setLogsObserver(EnxLogsObserver-Object)
: To receive the following callbacks:
onLogUploaded |
When the log is uploaded to the server successfully. |
Recording Observer
Observer: EnxRoom.setRecordingObserver(EnxRecordingObserver-Object)
: To receive the following callbacks:
Event | Description |
---|---|
onStartRecordingEvent | Acknowledgment to the moderator when the recording starts. |
onStopRecordingEvent | Acknowledgment to the moderator when the recording stops. |
onRoomRecordingOn | Notification to participants when the recording starts. |
onRoomRecordingOff | Notification to the participants when the recording stops. |
onACKStartLiveRecording | Acknowledgment callback to the moderator when the live recording starts. |
onLiveRecordingNotification | Notification to the conference participants that the live recording has started or stopped. |
onRoomliverecordOn | Notification to the new user joining the session if the session is being recorded live. |
onACKStopLiveRecording | Acknowledgment callback when the live recording is stopped. |
Hard Mute Observer
Observer: EnxRoom.setMuteRoomObserver(EnxMuteRoomObserver-Object)
: To receive the following callbacks:
Event | Description |
---|---|
onMutedRoom | Acknowledgment to the moderator when the room is put on a hard mute state. |
onUnMutedRoom | Acknowledgment to the moderator when the room is put off a hard mute state. |
onReceivedMuteRoom | Notification to the participants when the room is put on a hard mute state. |
onReceivedUnMuteRoom | Notification to the participants when the room is put off a hard mute state. |
Screen Share Observer
Observer: EnxRoom.setScreenShareObserver(EnxScreenShareObserver-Object)
: To receive the following callbacks:
Event | Description |
---|---|
onScreenSharedStarted | Notification to everyone in the room when the screen sharing starts. |
onScreenSharedStopped | Notification to everyone in the room when the screen sharing stops. |
File Share Observer
Observer: setFileShareObserver(EnxFileShareObserver-Object)
: To receive the following callbacks:
- At File Sender's End
Event | Description |
---|---|
onInitFileUpload | Acknowledgment to the sender when a file upload process is initiated |
onFileUploaded | Acknowledgment to the sender when the file is uploaded. |
onFileUploadFailed | Acknowledgment to the sender when the file upload process is failed. |
- At File Receiver's End
Event | Description |
---|---|
onFileUploadStarted | Notification to the intended receiver when a file is being uploaded. |
onFileAvailable | Notification to the intended receiver when a file is ready for download. |
Bandwidth Observer
Observer: EnxRoom.setBandwidthObserver(EnxBandwidthObserver-Object)
: To receive the following callbacks:
Event | Description |
---|---|
onBandWidthUpdated | Notification to the user when a significant change is noticed in the downstream bandwidth at the client endpoint. |
Lecture Mode Observer
Observer: EnxRoom.setChairControlObserver(EnxChairControlObserver-Object)
: To receive the following callbacks:
Event | Description |
---|---|
onFloorRequested | Acknowledgment to the participant when their request for floor access is sent to the moderator. |
onFloorRequestReceived | Notification to the moderator when a new request for floor access is received. |
onGrantedFloorRequest | Notification to the participant when the moderator grants them floor access. |
onDeniedFloorRequest | Notification to the participant when the moderator denies floor access to them. |
onReleasedFloorRequest | Notification to the participant when the moderator revokes their floor access permission. |
onProcessFloorRequested | Acknowledgment to the moderator on his actions regarding floor requests such as a grant, deny, and release floor access. |
Active Talker Observer
Observer: EnxRoom.setTalkerObserver(EnxTalkerObserver-Object)
: To receive the following callbacks:
Event | Description |
---|---|
onMaxTalkerCount | Notification to the user of the maximum number of permissible Active Talkers in a room. |
onGetTalkerCount | Notification to the user with information on the number of talkers to be received in the Active Talker list. |
onSetTalkerCount | Acknowledgment to the user when they update the number of talkers to be received in the Active Talker list. |
Stats Observer
Given below is a list of callbacks for the Stats Observer. The Stats Observer is initiated along with the Stats Enabling Process.
Event | Description |
---|---|
onAcknowledgeStats | Acknowledgment to the user when the stream stats are enabled or disabled. |
onReceivedStats | Notification to the user when stream statistics are received. |
EnxStream Class Stream Handler
The EnxStream 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 to be played.
Attributes
Attribute | Description |
---|---|
id | A unique Stream ID. |
local | Boolean. True for local streams. False for remote streams. |
room | JSON Object. The room with which a stream is associated. |
showing | Boolean. Indicates whether the stream is being played. |
audio | Boolean. True if the stream carries an audio track. |
video | Boolean. True if the stream carries a video track. |
screen | Boolean. True if the stream carries screen sharing. |
videoSize | Size of video frame, defined as [minWidth, minHeight, maxWidth, maxHeight]. |
videoFrameRate | Frame Rate of video stream, defined as [min, max]. |
desktopStreamId | The Chrome Media Source ID to use for screen sharing. |
extensionId | The Extension ID to use for screen sharing. |
audioMuted | Boolean. True if audio is muted. |
videoMuted | Boolean. True if video is muted. |
attributes | The video framerate. |
Methods
The Stream Handler methods are categorized as below.
Stream Information
Method | Description |
---|---|
getId() | To obtain the ID of a particular stream. |
getAttributes() | To obtain all attributes of a stream. |
getMedia() | To get all attributes of a stream. |
getState() | To get the current state of a stream. |
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. |
hasScreen() | To know if the stream has screen sharing. |
ifLocal() | To know if the stream is a local stream. |
isAudioActive() | To know if the audio track is currently active. |
isVideoActive() | To know if the video track is currently active. |
getLocalStream() | Initialize a local stream at the client endpoint before it can be published to a room. |
Stream Controls
Method | Description |
---|---|
muteSelfAudio() | To mute the audio of a local stream. |
muteSelfVideo() | To mute 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 a stream. |
Moderator Controls
Method | Description |
---|---|
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 the participant. |
hardUnmuteVideo() | To lift the video hard-mute restriction from the participant. |
Play a Stream
Method | Description |
---|---|
attachRenderer() | To attach a stream to the player view. |
detachRenderer() | To detach a stream from the player view. |
Observers and Corresponding Callbacks
Stream Observer
Below is a category-wise listing of Stream Observer callbacks based on their functions. The Room Observer is initiated along with the room initialization process.
Streaming
Method | Description |
---|---|
onRemoteStreamAudioMute() | Notification to everyone in the room when the user's audio is muted. |
onRemoteStreamAudioUnMute() | Notification to everyone in the room when the user's audio is unmuted. |
onAudioEvent() | Notification to the stream publisher when the audio track is muted or unmuted. |
onVideoEvent() | Notification to the stream publisher when the video track is muted or unmuted. |
Messaging
Method | Description |
---|---|
onReceivedData() | When the text messages are received. |
Hard Mute Audio Observer
Observer: EnxStream.setMuteAudioStreamObserver(EnxMuteAudioStreamObserver-Object)
: To receive the following callbacks:
Event | Description |
---|---|
onHardMutedAudio | Acknowledgment to the moderator when the participant's audio stream is hard-muted. |
onHardUnMutedAudio | Acknowledgment to the moderator when the hard-mute restriction is lifted from the participant's audio stream. |
onReceivedHardMuteAudio | Notification to the participant when the moderator hard-mutes their audio stream. |
onReceivedHardUnMuteAudio | Notification to the participant when the moderator lifts the hard-mute restriction from their audio stream. |
Hard Mute Video Observer
Observer: EnxStream.setMuteVideoStreamObserver(EnxMuteVideoStreamObserver-Object)
: To receive the following callbacks:
Event | Description |
---|---|
onHardMutedVideo | Acknowledgment to the moderator when the participant's video stream is hard-muted. |
onHardUnMutedVideo | Acknowledgment to the moderator when the hard-mute restriction is lifted from the participant's video stream. |
onReceivedHardMuteVideo | Notification to the participant when the moderator hard-mutes their video stream. |
onReceivedHardUnMuteVideo | Notification to the participant when the moderator lifts the hard-mute restriction from their video stream. |