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

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

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

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.