The EnxRoom Class provides the following methods to access various room-related information.
Table of Contents
- Get Room ID
- Get Room Meta Data
- Get Room Mode
- Get Client Id of the connected User
- Get Name of the connected User
- Get Role of the connected User
- Get Information of the connected User
- Get list of connected Users
- Get Local Stream ID
- Get Stream by Stream ID
- Get list of Remote Streams
- Get Publish Status of Local Stream
Get Room ID
The EnxRoom.getRoomId()
method provides the ID of the Room you are connected to. The Room ID is assigned to each Room during Room Creation.
Class: EnxRoom
Method: public String getRoomId()
– No parameter required.
Returns: String Room ID.
String roomID = room.getRoomId();
Get Room Meta Information
The EnxRoom.getRoomMetaData()
method provides the Meta Information of the Room to which you are connected. The Room Meta information JSON payload contains the complete Room definition along with many run-time parameters with their current values and room-stats of connected users and streams. All the endpoints receive this information through onRoomConnected observer after getting connected to the Room. Some of the run-time parameters are updated internally by the SDK on various events.
Class: EnxRoom
Method: public JSONObject getRoomMetaData()
– No parameter needed
Returns: Room Meta Information JSON object
JSONObject roomMeta = getRoomMetaData();
Get Room Mode
The EnxRoom.getMode()
method provides the mode in which the Room operates – group mode or lecture mode.
Class: EnxRoom
Method: public String getMode()
Returns: Enumerated Values: group, lecture.
String mode = room.getMode();
Get Client ID of the connected User
The EnxRoom.getClientId()
method provides the Client ID of the connected endpoint. The Client ID is unique for each user connected to the Room for the session.
Class: EnxRoom
Method: public String getClientId()
– No parameter required.
Returns: String Client ID
String clientId = room.getClientId();
Get Name of the connected User
The EnxRoom.getClientName()
method provides the name of the user connected through the Client endpoint.
Class: EnxRoom
Method: public String getClientName()
– No parameter required.
Returns: String Client name.
String clientName = room.getClientName();
Get Role of the connected User
The EnxRoom.getRole()
method provides the role of the user connected to the Room for the session, either Moderator or Participant.
Class: EnxRoom
Method: public String getRole()
– No parameter required.
Returns: Enumerated Values: moderator, participant.
String role = room.getRole();
Get Information of the connected User
The EnxRoom.whoami()
method provides the complete User Meta Information of the connected user.
Class: EnxRoom
Method: public JSONObject whoami()
– No parameter required.
Returns: User Meta Information JSON object.
JSONObject myinfo = room.whoami();
Get List of connected Users
The EnxRoom.getUserList()
method provides a list of users connected to the Room.
Class: EnxRoom
Method: public JSONObject getUserList()
– No parameter required.
Returns: User list JSON object.
JSONObject Users = room.getUserList() // Return JSON Users /* [ { "clientId": "", // Unique Client ID assigned by the Potal "name": "", // User's name "user_ref": "", // User's Reference "role": "participant", // Enum: moderator, participant "permissions": { // In-Session Permission of User "publish": Boolean, // Whether user can pubish a local stream "subscribe": Boolean, // Whether user can subscribe to remote streams "record": Boolean, // Whether user can initiate recording "stats": Boolean, // Whether user can view stream status "controlhandlers": Boolean } } ] */
Get Local Stream ID
The EnxRoom.getLocalStreamID()
method provides the ID of your Local Stream published in the Room.
Class: EnxRoom
Method: public String getLocalStreamID()
– No parameter required.
Returns: String Stream ID.
String localStreamID = room.getLocalStreamId();
Get Stream by Stream ID
The EnxRoom.getStreamByStreamId()
method provides the Stream information for the given Stream ID.
Class: EnxRoom
Method: public EnxStream getStreamByStreamId( String StreamId)
Returns: Stream Information JSON object.
EnxStream stream = room.getStreamByStreamId( StreamID );
Get list of Remote Streams
The EnxRoom.getRemoteStreams()
method provides the list of Remote Streams available in the Room.
Class: EnxRoom
Method: public Map < String, EnxStream > getRemoteStreams()
– No parameter required.
Returns: Map Remote Streams.
Map <String, EnxStream> remoteStreams = room.getRemoteStreams();
Get Publish Status of Local Stream
The EnxRoom.isPublishing()
method is used to check if the Local Stream is currently being published into the Room.
Class: EnxRoom
Method: public boolean isPublishing()
– No parameter required.
Result: Boolean.
if (room.isPublishing()) { // Local Stream is being published. } else { // Local Stream is not being published. }