Home / Get Started / Advance Features

With the Advanced Features of EnableX, you can build more complex audio/video enabled applications by introducing more controls on streams, data or connections.

Table of Contents

Mute / Unmute Local Audio

You may like to mute audio on the published stream from an End-Point and subsequently unmute audio by adding back the audio track for the stream. When a user mutes or unmutes audio, all other connected users to the Room are notified with user-audio-muted and user-audio-unmuted events respectively. You need to listen to these events to update UI.

Mute / Unmute Local Audio using Web Toolkit

You may use EnxStream.muteAudio() and EnxStream.unmuteAudio() methods to mute and unmute audio from published stream respectively.

// To mute
 localStream.muteAudio( function(res) {
     // Handle UI here
 });

 // To unmute    
 localStream.unmuteAudio( function(res) {
     // Handle UI here
 });

 // Notification to others when a user muted
 stream.addEventListener("user-audio-muted", function (event) {
     // Handle UI here
 });

 // Notification to others when a user muted
 stream.addEventListener("user-audio-unmuted", function (event) {
     // Handle UI here
 });

Read more…

Mute / Unmute Local Audio using Android Toolkit

You may use EnxStream.muteSelfAudio() method to mute and unmute audio from the published stream.

localStream.muteSelfAudio(true);   //To mute Audio
localStream.muteSelfAudio(false);  //To unmute Audio 

Read more…

Mute / Unmute Local Audio using iOS Toolkit

Use EnxStream.muteSelfAudio() method to mute and unmute audio from Local Stream. 

[localStream muteSelfAudio:true]; // To mute audio on local stream 
[localStream muteSelfAudio:false]; // To unmute audio on  local stream 

Read more…

Mute / Unmute Local Audio using React Native Toolkit

Use Enx.muteSelfAudio() method to mute and unmute audio from Local Stream.  Content awaited…

Enx.muteSelfAudio(localStreamId, true);   //To mute audio 
Enx.muteSelfAudio(localStreamId,false);   //To unMute audio 

Read more…

Mute / Unmute Local Video

You may like to mute the video on the published stream from an End-Point and subsequently unmute video by adding back the video track for the stream. When a user mutes or unmutes video, all other connected users to the Room are notified with user-video-muted and user-video-unmuted events respectively. You need to listen to these events to update UI.

Mute / Unmute Local Video using Web Toolkit

You may use EnxStream.muteVideo() and EnxStream.unmuteVideo() methods to mute/unmute i.e. stop/start video in published stream respectively.

// To mute video
 localStream.muteVideo( function(res) {
     // Handle UI here
 });

 // To unmute video    
 localStream.unmuteVideo( function(res) {
     // Handle UI here
 });

 // Notification to others when a user video muted
 stream.addEventListener("user-video-muted", function (event) {
     // Handle UI here
 });

 // Notification to others when a user video muted
 stream.addEventListener("user-video-unmuted", function (event) {
     // Handle UI here
 });

Read more…

Mute / Unmute Local Video using Android Toolkit

You may use EnxStream.muteSelfVideo() method to mute/unmute i.e. start/stop the video in the published stream.

localStream.muteSelfVideo(true);   //To mute/stop Video
localStream.muteSelfVideo(false);  //To unmute/restart Video

Read more…

Mute / Unmute Local Video using iOS Toolkit

Use EnxStream.muteSelfVideo() method to mute and unmute video from Local Stream. 

[localStream muteSelfVideo:true]; // To mute video on local stream 
[localStream muteSelfVideo:false]; // To unmute video on  local stream 

Read more…

Mute / Unmute Local Video using React Native Toolkit

Use Enx.muteSelfVideo() method to mute and unmute video from Local Stream. Content awaited…

Enx.muteSelfVideo(localStreamId, true);   //To mute video 
Enx.muteSelfVideo(localStreamId,false);   //To unMute video 

Read more…

Start / Stop Screen Share

A Client End Point can initiate Screen-Share. The process creates a stream @ 6fps and publishes it into the Room.

Screen Share using Web Toolkit

Screen Share feature is currently available in Web Toolkit only.

To start sharing your desktop, you can call EnxRoom.startScreenShare() method. To stop ongoing Screen Share, call EnxRoom.stopScreenShare() method. When a user starts or stops Screen Share, all connected users of the room are notified with share-started and share-stopped events respectively. You need to listen to these events to update UI. As Screen-Share is also a stream, you can play it in Video Player.

// To start Screen Share
streamShare = room.startScreenShare( function(res) {
});

// To stop ongoing Screen Share
room.stopScreenShare( streamShare, function(res) {
});

// To stop ongoing Screen Share - Alternate way
room.unpublish(streamShare);
 
// Notification to users on start of Screen Share
room.addEventListener("share-started", function (event) {
     // Get Stream# 11 which carries Screen Share 
     var shared_stream = room.remoteStreams.get(11);  
     shared_stream.play("div_id", playerOptions);
});

 // Notification to users on stopping Screen Share
 room.addEventListener("share-stopped", function (event) {
     // Handle UI here
 });

Note:

  • This feature is not an Application Share, but a Screen Share. User should select a Screen and not any specific App when prompted by the browser. App Share experience may differ from browser to browser.
  • Google Chrome older than v72 needs an Extension to be installed from Web Store to initiate Screen Share i.e. at the Publisher Side.
  • Firefox & Google Chrome v72+ don’t require any Extension. They have native support to initiate screen share.

Read more…

Share Client End Logs to audit

In case you need the end user of your application to share console logs with EnableX Tech Team to debug any issues your end user is facing during a RTC session, you can do so using available methods in Toolkits. The method sends the latest 500 lines of console log to EnableX using HTTP post. You may need to build your own UI around it. More importantly, you may need to request for user’s consent before posting the logs to EnableX.

Share Client End Logs using Web Toolkit

To share the end user browser console log use EnxRtc.postClientLogs() method. Note the confirm() method is used to seek user’s consent.

if( confirm("You are posting Browser Console Log to audit.\nSure?")) {
     room.postClientLogs(token, function(res) {
          Logger.info(res.message);   
     });
 }

Read more…

Share Client End Logs using Android Toolkit

To share the Console Log, use EnxRtc.postClientLogs() method.

// To initiate and enable logging
EnxLogsUtil Logs = EnxLogsUtil.getInstance();    
Logs.enableLogs(true);

EnxRoom.postClientLogs(); // To share log

Read more…

Share Client End Logs using iOS Toolkit

To share Console Log with EnableX Tech Team for auditing purpose, use EnxRoom.postClientLogs() . The method sends latest 200KB of Console Log to EnableX.

// To enable logging
EnxLogger *logger = [EnxLogger sharedInstance];
[logger startLog];

[room postclientLogs]; // Post log to EnableX

Read more…

Share Client End Logs using React Native Toolkit

To share Console Log with EnableX Tech Team for auditing purpose, use Enx.postClientLogs() . The method sends latest 200KB of Console Log to EnableX.

Enx.enableLogs(true); // Enable Logging
Enx.postClientLogs(); // Post Log to EnableX

logsUploaded : event =>{
   // Logs uploaded
   // event = { msg:'success', result:0 } 
}

Read more…

Handle Active Talker

During a Multi-Party Video Conference, more server and Client End Point resources are consumed. Therefore, EnableX sends only 6 streams of active talkers (generating sound) in the Room to each end-point. Additionally, it sends 2 streams, viz. Screen Share (Stream# 11) and Canvas Stream (Stream# 21).

The list of Active-Talkers is available in JSON format along with an event whenever there is a change in the Talkers list. The list of Active Talkers comprises talkers in ascending order i.e. latest talker will be listed first. Therefore, you may expect to receive the event very frequently in a noisy room.

// Active Talkers JSON format
{    "active" : true,
     "activeList": [
         {   "clientId" : "String", 
             "mediatype" : "audiovideo", // Enum: audiovideo, audioonly
             "name" : "String",
             "reason" : "user",
             "streamId" : Number,
             "videoaspectratio" : "16:9", 
             "videomuted" : Boolean
         }
     ]
 }

Please note that the Local Stream will never be included in the Active Talkers JSON list sent to an end-point even if the endpoint is talking. Hence Active Talker JSON list sent to different end-points may vary. Also, in case you need to play own stream, please use Local Stream.

This Active Talkers JSON list is useful for handling UI and also to play audio/video streams from remote users. Remember that before you can play any stream from the Active Talkers list, you should have subscribed to all “dummy” streams available in the room.

Handling Active Talkers using Web Toolkit

Active-Talkers list is received with an event named active-talkers-updated whenever there is a change in the talkers list. Get the JSON activeList and loop through to find the stream available with the same ID in the room. Once received, we can play the stream using stream.play() method.

room.addEventListener('active-talkers-updated', function (event) {
     TalkerList = event.message.activeList;
     for (var i = 0; i < TalkerList.length; i++) {
         if (ATUserList[i] && ATUserList[i].streamId) {
             var stream  = room.remoteStreams.get(ATUserList[i].streamId);
             var stream_id   = ATUserList[i].streamId;
             var username    = ATUserList[i].name;
             stream.play("DOM_ELEMENT_ID", PlayerOptions);
         }
     }                       
 }

Read more…

Handling Active Talkers using Android Toolkit

Active-Talkers list is received with a callback onActiveTalkerList whenever there is a change in the talkers list. Get the JSONArray activeList and loop through to find the stream available with the same ID in the room. The Stream can played using an object of EnxPlayerView class.

@Override
public void onActiveTalkerList(final JSONObject jsonObject) {
     JSONArray talkerList  = jsonObject.getJSONArray("activeList");
     for (int i = 0; i < talkerList.length(); i++) {
         JSONObject talker = talkerList.getJSONObject(i);
         String strteamID =  talker.getString("streamId");
         String stremName =  talker.getString("name");
         String mediatype =  talker.getString("mediatype");

         remoteStreams = room.getRemoteStreams();
         EnxStream stream = remoteStreams.get(strteamID); 
         
         stream.attachRenderer(EnxPlayerView Object);
     }
 }

Read more…

Handling Active Talkers using iOS Toolkit

Active-Talkers list is received with a delegate method –room:activeTalkerList: whenever there is a change in the talkers list. Get the Dictionary activeList and loop through to find the stream available with the same ID in the room.

// Updated Active Talkers list received
-(void)room:(EnxRoom *)room activeTalkerList:(NSArray *)Data{
	NSDictionary *responseDict = Data[0];
	NSArray *activeTalkerArray = responseDict[@”activeList”] ;
	
	// Loop through Active Talker List
	for (int i = 0; i < activeTalkerArray.count; i++) {
          NSDictionary *activeTalkerDict = activeTalkerArray[i];

	  // Get remote stream from streamid
          NSString *streamId = activeTalkerDict[@”streamId”];
          EnxStream *stream = room.streamsByStreamId[streamId]; 
	  
	  // init player view
	  EnxPlayerView *playerView = [[EnxPlayerView alloc] initWithFrame:frame];
          [stream attachRenderer:playerView];
          [playerView setDelegate:self];
	}
}

Read more…

Handling Active Talkers using React Native Toolkit

Active-Talkers list is received with a activeTalkerList  Callback whenever there is a change in the talkers list. Get the JSON Array activeList and loop through to find the stream available with the same ID in the room.

activeTalkerList: event => {
	var tempArray = [];
        tempArray = event;
   	if (tempArray.length > 0) {
		this.setState({activeTalkerStreams: tempArray});
        }
	return (
	      <View>
		{this.state.activeTalkerStreams.map(function(element, index) {
		    return (
		      <EnxPlayerView key={String(element.streamId)}
			streamId={String(element.streamId)}
			style={{ width: width, height: height }}/>
		    );
		})}
	      </View>
	);
}

Read more…


Explore Developer Guide