Get Room Information
The Flutter SDK provides the following methods:
- getRoomId(): Provides the room ID of the connected user.
- getClientId(): Provides the client ID of the connected endpoint.
- getClientName(): Provides the name of the user connected through the client endpoint.
- getRole(): Provides the user role connected to the room.
- whoami(): Provides the complete user meta information.
- getUserList(): Provides the list of users in the room.
- getRemoteStreams(): Provides the list of remote streams.
- isRoomActiveTalker(): To check if the room has any active talkers.
- setAdvancedOptions(): To set the advanced options.
- getAdvancedOptions(): To get the advanced options.
- getReceiveVideoQuality(): Provides information about the video quality.
Get a Room ID
The getRoomId()
method provides the ID of a room you are connected to. The Room ID is assigned to each room during Room Creation.
Class: EnxRtc
Method: static Future<String> getRoomId()
Sample Code
String room_id = EnxRtc.getRoomId();
Get Client ID of the connected User
The getClientId()
method provides the client ID of the connected endpoint. The client ID is unique for each user connected to a room for the session.
Class: EnxRtc
Method: static Future<String> getClientId()
Sample Code
String ClientId = EnxRtc.getClientId();
Get Name of the Connected User
The getClientName()
method provides the name of the user connected through the client endpoint.
Class: EnxRtc
Method: static Future<String> getClientName()
Sample Code
String ClientName = EnxRtc.getClientName();
Get Role of the Connected User
The getRole()
method provides the user's role connected to the Room for the session, either Moderator or Participant.
Class: EnxRtc
Method: static Future<String> getRole()
Returns: Enumerated Values: moderator, participant
Sample Code
String role = EnxRtc.getRole();
Get Information of the Connected User
The whoami()
method provides the complete User Meta Information of the connected user.
Class: EnxRtc
Method: static Future<Map<String, dynamic>> whoAmI()
Sample Code
JSONObject myinfo = EnxRtc.whoami();
Get a List of the Connected Users
To get a list of connected users to a room that an endpoint is also connected to, use the getUserList()
method. It returns a JSON with the list of connected users' information.
Class: EnxRtc
Method: static Future<List<dynamic>> getUserList()
Sample Code
List users= EnxRtc.getUserList();// Return List Users/*[{"clientId": "", // Unique Client ID assigned by EnableX"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 local stream"subscribe": Boolean, // Whether user can subscribe remote streams"record": Boolean, // Whether user can initiate recording"stats": Boolean, // Whether user can view stream status"controlhandlers": Boolean}}]*/
Get a List of Remote Streams
The getRemoteStreams()
method provides the list of remote streams available a room.
Class: room.getRemoteStreams()
Method: public Map < String, EnxStream > getRemoteStreams()
Sample Code
Map <String, EnxStream> remoteStreams = room.getRemoteStreams();
If the Room has an Active Talker
The isRoomActiveTalker()
method checks if the Room has an active talker.
Class: EnxRtc
Method: static Future<bool> isRoomActiveTalker()
Sample Code
await EnxRtc.isRoomActiveTalker();
Advance Stream Options
Set Advanced Options
The EnxRtc.setAdvancedOptions()
method is used to set the advanced options.
Class: EnxRtc
Method: static Future<void> setAdvancedOptions(List<dynamic> advanceOptions)
Parameter: advanceOptions
: String. A list of advance options to set. e.g. ["battery_updates", "notify-video-resolution-change"].
Sample Code
EnxRtc.setAdvancedOptions(["battery_updates", "notify-video-resolution-change"]);
Get Advanced Options
The EnxRtc.getAdvancedOptions()
method is used to get the advanced options.
Class: EnxRtc
Method: static Future<void> getAdvancedOptions()
Event Listeners: onGetAdvanceOptions
: Gets the options
Sample Code
EnxRtc.getAdvancedOptions();EnxRtc.onGetAdvancedOptions= (Map<dynamic, dynamic> map) {};
Get Video Quality
The EnxRtc.getReceiveVideoQuality()
method is used to know about the video quality at the client endpoint.
Class: EnxRtc
Method: static Future<String> getReceiveVideoQuality(String streamType)
Parameter: streamType
: String. Enumerated Values: talker
, canvas
.
Sample Code
await EnxRtc.getReceiveVideoQuality(streamType);