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

AttributeDescription
roomIDUnique room identifier generated for each room.
clientIDUnique Client ID assigned by EnableX to the client endpoint.
streamsDummy Streams available for subscription. The Active Talker Notification provides a list of streams carrying media.
remoteStreamsList of remote streams.
localStreamsList of local streams.
statusStatus of a room connection: Enum (1=Connecting, 2=Connected, 0=Disconnected).
awaitedParticipantsList of users awaiting moderator's approval to enter a knock-enabled room.
raisedHandsList of users requesting Floor Access in the Lecture mode.
approvedHandsList of users approved for Floor Access in the Lecture mode.

Methods

The methods are listed below in the categories they belong to:

Connection

MethodDescription
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

MethodDescription
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

MethodDescription
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

MethodDescription
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

MethodDescription
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

MethodDescription
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

MethodDescription
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

MethodDescription
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

MethodDescription
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

EventDescription
onRoomConnectedAcknowledgment to a user when the client endpoint is successfully connected to a room.
onRoomDisConnectedAcknowledgment to a user when the client endpoint is successfully disconnected from a room.
onRoomErrorAcknowledgment to a user when the client endpoint fails to connect to a room.
onUserConnectedNotification to everyone in a room when a new user enters the room.
onUserDisConnectedNotification to everyone in a room when a user is disconnected from the room.
onConnectionLostAcknowledgment to the user when the client endpoint loses the network connection.
onConnectionInterruptedAcknowledgment to the user when the client endpoint's connection is interrupted, such as a switching from WiFi to 4G and vice versa.
onUserReconnectSuccessAcknowledgment to the user when the client endpoint gets reconnected with EnableX successfully.
onReconnectAcknowledgment to the user when the client endpoint is trying to reconnect within the given time.

Streaming

EventDescription
onPublishedStreamAcknowledgment to the user when the user's stream has been published into the room successfully.
onUnPublishedStreamAcknowledgment to the user when the user's stream has been unpublished or removed from the room.
onStreamAddedNotification to everyone in a room when a stream is published in the room.
onRemovedStreamNotification to everyone in a room when a stream is unpublished or removed from the room.
onSubscribedStreamNotification to users when they successfully subscribe to a remote stream.
onActiveTalkerListNotification to everyone in a room when the list of active talkers is updated.
onActiveTalkerViewNotification to everyone when video UI view built on a list of Active Talkers.
onCanvasStartedNotification when text messages are received.
onCanvasStoppedNotification to everyone in a room when canvas streaming stops.
onDialStateEventsNotification 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.
onDTMFCollectedNotification to everyone when DTMF input is collected. It gets the String of digits collected.
onOutBoundCallCancelNotification to the call initiator when the participant gets disconnected.

Devices

EventDescription
onNotifyDeviceUpdateAcknowledgment to a user that the audio device is changed.
onDeviceAddedAcknowledgment to a user that a new audio device has been added.
onDeviceRemovedAcknowledgment to a user that the audio device is removed.

Miscellaneous

EventDescription
onEventErrorAcknowledgment to a user when the client endpoint fails to perform an event.
onSwitchedUserRoleChangeAcknowledgment to the Moderator when they switch a user's role.
onUserRoleChangedNotification to everyone in the room when a user is newly appointed as moderator and additional information provided to the newly appointed moderator.
onReceivedChatDataRoomThe client endpoint receives messages in JSONObject.
onAckSwitchedRoomAcknowledgment to the moderator when the room mode switch is done.
onRoomModeSwitchedNotification to everyone when a moderator switches to room mode.

Aside Room Observer
Observer: EnxRoom.EnxAsideRoomObserver: To receive the following callbacks:

EventDescription
onJoinedAsideRoomNotification to everyone when joined aside room.
onFailedAsideRoomNotification to everyone when failed to join aside room.
onDisconnectedAsideRoomNotification 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:

EventDescription
onStartRecordingEventAcknowledgment to the moderator when the recording starts.
onStopRecordingEventAcknowledgment to the moderator when the recording stops.
onRoomRecordingOnNotification to participants when the recording starts.
onRoomRecordingOffNotification to the participants when the recording stops.
onACKStartLiveRecordingAcknowledgment callback to the moderator when the live recording starts.
onLiveRecordingNotificationNotification to the conference participants that the live recording has started or stopped.
onRoomliverecordOnNotification to the new user joining the session if the session is being recorded live.
onACKStopLiveRecordingAcknowledgment callback when the live recording is stopped.

Hard Mute Observer
Observer: EnxRoom.setMuteRoomObserver(EnxMuteRoomObserver-Object): To receive the following callbacks:

EventDescription
onMutedRoomAcknowledgment to the moderator when the room is put on a hard mute state.
onUnMutedRoomAcknowledgment to the moderator when the room is put off a hard mute state.
onReceivedMuteRoomNotification to the participants when the room is put on a hard mute state.
onReceivedUnMuteRoomNotification 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:

EventDescription
onScreenSharedStartedNotification to everyone in the room when the screen sharing starts.
onScreenSharedStoppedNotification to everyone in the room when the screen sharing stops.

File Share Observer
Observer: setFileShareObserver(EnxFileShareObserver-Object): To receive the following callbacks:

  1. At File Sender's End
EventDescription
onInitFileUploadAcknowledgment to the sender when a file upload process is initiated
onFileUploadedAcknowledgment to the sender when the file is uploaded.
onFileUploadFailedAcknowledgment to the sender when the file upload process is failed.
  1. At File Receiver's End
EventDescription
onFileUploadStartedNotification to the intended receiver when a file is being uploaded.
onFileAvailableNotification to the intended receiver when a file is ready for download.

Bandwidth Observer
Observer: EnxRoom.setBandwidthObserver(EnxBandwidthObserver-Object): To receive the following callbacks:

EventDescription
onBandWidthUpdatedNotification 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:

EventDescription
onFloorRequestedAcknowledgment to the participant when their request for floor access is sent to the moderator.
onFloorRequestReceivedNotification to the moderator when a new request for floor access is received.
onGrantedFloorRequestNotification to the participant when the moderator grants them floor access.
onDeniedFloorRequestNotification to the participant when the moderator denies floor access to them.
onReleasedFloorRequestNotification to the participant when the moderator revokes their floor access permission.
onProcessFloorRequestedAcknowledgment 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:

EventDescription
onMaxTalkerCountNotification to the user of the maximum number of permissible Active Talkers in a room.
onGetTalkerCountNotification to the user with information on the number of talkers to be received in the Active Talker list.
onSetTalkerCountAcknowledgment 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.

EventDescription
onAcknowledgeStatsAcknowledgment to the user when the stream stats are enabled or disabled.
onReceivedStatsNotification 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

AttributeDescription
idA unique Stream ID.
localBoolean. True for local streams. False for remote streams.
roomJSON Object. The room with which a stream is associated.
showingBoolean. Indicates whether the stream is being played.
audioBoolean. True if the stream carries an audio track.
videoBoolean. True if the stream carries a video track.
screenBoolean. True if the stream carries screen sharing.
videoSizeSize of video frame, defined as [minWidth, minHeight, maxWidth, maxHeight].
videoFrameRateFrame Rate of video stream, defined as [min, max].
desktopStreamIdThe Chrome Media Source ID to use for screen sharing.
extensionIdThe Extension ID to use for screen sharing.
audioMutedBoolean. True if audio is muted.
videoMutedBoolean. True if video is muted.
attributesThe video framerate.

Methods

The Stream Handler methods are categorized as below.

Stream Information

MethodDescription
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

MethodDescription
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

MethodDescription
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

MethodDescription
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

MethodDescription
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

MethodDescription
onReceivedData()When the text messages are received.

Hard Mute Audio Observer
Observer: EnxStream.setMuteAudioStreamObserver(EnxMuteAudioStreamObserver-Object): To receive the following callbacks:

EventDescription
onHardMutedAudioAcknowledgment to the moderator when the participant's audio stream is hard-muted.
onHardUnMutedAudioAcknowledgment to the moderator when the hard-mute restriction is lifted from the participant's audio stream.
onReceivedHardMuteAudioNotification to the participant when the moderator hard-mutes their audio stream.
onReceivedHardUnMuteAudioNotification 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:

EventDescription
onHardMutedVideoAcknowledgment to the moderator when the participant's video stream is hard-muted.
onHardUnMutedVideoAcknowledgment to the moderator when the hard-mute restriction is lifted from the participant's video stream.
onReceivedHardMuteVideoNotification to the participant when the moderator hard-mutes their video stream.
onReceivedHardUnMuteVideoNotification to the participant when the moderator lifts the hard-mute restriction from their video stream.