List of SDK Methods
Methods: EnxRtc Base Class
The EnxRtc
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.
The EnxRtc
class methods are listed below.
Manage Media Devices
getDevices()
: To find a list of devices such as a camera and a microphone attached to the device running the client application.switchMediaDevice()
: To switch the audio and video source of your published stream to another camera and microphone connected to your device.clientBitrate()
: To provide the bitrate status of the client.
Diagnosis
clientDiagnostics()
: To diagnose the various WebRTC-related issues by running through the predefined test cases.
Join Session
joinRoom()
: To connect the client endpoint with an EnableX room and join an RTC session with or without a published stream.
Logging
setLogLevel()
: to write logs is a considerably time-consuming task.setOutputFunction()
: To make the logs available other than the browser console by sending them via email or creating a UI.postClientLogs()
: To send the latest 500 lines of console logs to EnableX.
Attributes: 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.
roomID
: Unique room identifier generated for each room.clientID
: Unique Client ID assigned by EnableX to a 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: EnxRoom Class Room Handler
The methods are listed below in the categories they belong to:
Room Connection
connect()
: To connect a client endpoint to a room.disconnect()
: To disconnect a client endpoint from a room.
Streaming
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.startCanvas()
: To start canvas streaming using a given Canvas DOM ID.stopCanvas()
: To stop an ongoing canvas streaming.stopAllSharing()
: To stop an ongoing canvas streaming.startScreenShare()
: To start screen sharing.stopScreenShare()
: To stop screen sharing.stopAllSharing()
: To force stop an ongoing screen sharing.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.getTalkerCount()
: To get the number of talkers in the Active Talker list.setTalkerCount()
: To set the number of talkers for the Active Talker list.subscribeStreamStatsForClient()
: To obtain the statistical information of local and subscribed remote streams.switchspeaker()
: To switch to a different speaker to play the audio.
Advanced Features
sendMessage()
: For advanced messaging features among the session participants.sendFiles()
: To initiate a file transfer.recvFiles()
: To initiate a file download.cancelUploads()
: To cancel the uploading process of individual or all files.canceldownloads()
: To cancel the downloading process of individual or all files.setAudioOnlyMode()
: To change to an audio-only call when you do not want to receive video from other participants or want to publish your video.sendUserData()
: To send a message to all or selected participants in a room using the Custom Signalling method.muteRoom()
: To mute audio or video of a parent room.unMuteRoom()
: To unmute audio or video of a parent room.disconnect()
: To disconnect from a breakout room to rejoin or resume the parent room.extendConferenceDuration()
: To enable a user to trigger extension. This is available only when an extension window is open.annotateToolAction()
: To configure tools and properties.startAnnotation()
: To initiate annotation.stopAnnotation()
: To stop annotation.makeOutboundCall()
: To initiate an outbound call to a PSTN Number or SIP URI inviting the called participant to join the session on accepting the call.subscribeMediaStats()
: To obtain the live media statistics of local, remote, canvas streams, and screen sharing being played at endpoints.subscribeForTalkerNotification()
: To subscribe to obtain Talker Notification to know to whom the participants are talking with in a room.
Breakout Room
createBreakoutRoom()
: To create a breakout room.inviteToBreakoutRoom()
: Invite one or more participants from a parent room to join a breakout room. The creator or owner of a breakout room invite the participants to the breakout rooms.createAndInviteBreakoutRoom()
: To automatically assign users to different breakout rooms.joinBreakOutRoom()
: To join a breakout room if invited to join it. This method may be used from the parent room only. A user can join only one breakout room at any given point.rejectBreakOutRoomInvite()
: Allows the invited users to reject the invitation to join a breakout room.pause()
: Allows the users to pause the parent room after joining the breakout room.resume()
: To allow users to resume the parent room if it was paused while joining the breakout room.clearAllBreakOutSession()
: Allows the participants to clear all breakout rooms.destroyAllBreakOutSession()
: Allows the moderator to stop all the breakout room sessions.
Moderator Controls
disconnectUser()
: To force disconnect a participant from a room.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.hardMute()
: To hard-mute a room where all the participants are on mute.hardUnmute()
: To lift the hard-mute restriction from the room.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 unmute a participant's audio.hardUnMuteUserVideo()
: Allows the moderator to 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.lock()
: To lock a room preventing a new participant from joining the session.unlock()
: 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.switchRoomMode()
: Allows a moderator to switch the mode of operation of a room from Group to Lecture or vice versa during a running conference.switchUserRole()
: Allows a moderator to designate a connected participant to act as a moderator during a session.startStreaming()
: To start forwarding an RTMP stream.stopForwarding()
: To stop forwarding an RTMP stream.pinUsers()
: To pin one or more user streams.unpinUsers()
: To unpin one or more pinned user streams.addSpotlightUsers()
: To add a spotlight on one or more user streams.removeSpotlightUsers()
: To remove the spotlight from one or more user streams.
Floor Access Controls
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.
Miscellaneous
addEventListener()
: Add a listener for room bound events for receiving notifications.
Events: EnxRoom Class Room Handler
Events are categorized as listed below.
Connection
room-connected
: Acknowledgment to a user when the client endpoint is successfully connected to a room.room-disconnected
: Acknowledgment to a user when the client endpoint is successfully disconnected from a room.room-failed
: Acknowledgment to a user when the client endpoint fails to connect to a room.room-awaited
: Acknowledgment to a user when the client endpoint is successfully connected to a knock-enabled room and awaiting moderator's approval to join the room.user-connected
: Notification to everyone in a room when a new user enters the room.user-disconnected
: Notification to everyone in a room when a user is disconnected from the room.bandwidth-updated
: Notification to a user when the available bandwidth is significantly changed. (Applied on down stream).
Streaming
stream-added
: Notification to everyone in a room when a stream is published in the room.stream-removed
: Notification to everyone in a room when a stream is unpublished or removed from the room.stream-failed
: Notification to a publisher of a stream when the publisher fails to publish the stream.stream-subscribed
: Notification to users when they successfully subscribe to a remote stream.stream-unsubscribed
: Notification to the users when they unsubscribe from a remote stream.user-subscribed
: Notification to the publisher of a stream when a user subscribes to the publisher's stream.user-unsubscribed
: Notification to the publisher of a stream when a user subscribes to the publisher's stream.active-talkers-updated
: Notification to everyone in a room when the list of active talkers is updated.active-talker-data-in
: Notification when text messages are received.canvas-started
: Notification when text messages are received.canvas-stopped
: Notification to everyone in a room when canvas streaming stops.share-started
: Notification to everyone in a room when screen sharing starts.share-stopped
: Notification to everyone in a room when screen sharing starts.user-audio-muted
: Notification to everyone in a room when a participant's audio is muted.user-video-muted
: Notification to everyone in a room when a participant's video is muted.user-audio-unmuted
: Notification to everyone in a room when a a participant's audio is unmuted.user-video-unmuted
: Notification to everyone in a room when a participant's video is unmuted.
Moderator Controls
user-awaited
: Notification to everyone in a room when a participant's video is unmuted.room-record-on
: Notification to everyone in a room when the session is being recorded.room-record-off
: Notification to everyone in a room when the session recording stops.room-muted
: Notification to everyone when the moderator hard-mutes the room.room-unmuted
: Notification to everyone in a room when the moderator lifts the hard mute state off the room.hardmute-user-audio
: Notification to participants when the moderator hard mutes their audio.hardmute-user-video
: Notification to participants when the moderator hard mutes their video.hardunmute-user-audio
: Notification to participants when the moderator lifts the hard mute state off their audio.hardunmute-user-video
: Notification to participants when the moderator lifts the hard mute state off their video.
Floor Access Controls
floor-requested
: Notification to the moderator when a participant requests floor access.floor-granted
: Notification to participants when the moderator grants floor access permission to them.release-floor
: Notification to participants when the moderator revokes their floor access permission.floor-released
: Notification to the moderator when a participant releases floor access.floor-denied
: Notification to participants when the moderator denies floor access permission to them.
Attributes: 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 the stream endpoints to play.
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: EnxStream Class Stream Handler
The Stream Handler methods are categorized as below.
Basics
close()
: To close and stop publishing a local stream.play()
: To play a video on the EnableX player in a given DOM ID.stop()
: To stop playing videos on the EnableX player.
Stream Information
getId()
: To obtain the ID of a particular stream.getAttributes()
: To obtain all attributes of a stream.ifAudio()
: To determine if a stream includes an audio track.ifVideo()
: To determine if a stream includes a video track.ifData()
: To determine if a stream includes text data.ifScreen()
: To determine if a stream includes screen sharing.
Stream Controls
setAttributes()
: To update or set attributes of a local stream.updateConfiguration()
: To update the audio and video bandwidth requirement of a local stream.muteAudio()
: To mute the audio of a local stream.muteVideo()
: To mute the video of a local stream.unmuteAudio()
: To unmute the audio of a local stream.unmuteVideo()
: To unmute the video of a local stream.
Miscellaneous
getVideoFrameImage()
: To take a raw image snapshot of a stream into the Canvas object.switchMicrophone()
: To switch the audio source of a local stream to another microphone connected to the device.switchCamera()
: To switch the video source of a local stream to another camera connected to the device.
Events: EnxStream Class Stream Handler
Stream Controls
media-access-allowed
: When access is granted to the camera and the microphone.media-access-denied
: When access is denied for the camera and the microphone.stream-attributes-updated
: When local stream attributes are updated.