Table of Contents

Mute / Unmute Audio in a Stream

Use Enx.muteSelfAudio() method to mute and unmute audio from Local Stream. When a user mutes or unmutes audio from own Published Stream, all other connected users of the room are notified with remoteStreamAudioMute and  remoteStreamAudioUnmute callbacks respectively. Listen to these events to update related UI elements.

Methods: Enx.muteSelfAudio( localStreamId, muteState )

Parameters:

  • localStreamId – String, Local Stream Id which is to be muted or unmuted
  • muteState – Boolean, Pass to true to mute, false to unmute

Callbacks:

  • remoteStreamAudioMute – To all participants notifying user has muted audio
  • remoteStreamAudioUnmute – To all participants notifying user has unmuted audio
  • audioEvent – To self that audio is either muted or unmuted
Enx.muteSelfAudio(localStreamId, true);   //To mute audio
Enx.muteSelfAudio(localStreamId,false);   //To unMute audio

// To all participant - user muted audio 
remoteStreamAudioMute:event=>{
	// event = { "result":0, "clientId":"XXX", "msg":"user muted audio" } 
}

// To all participant - user unmuted audio
remoteStreamAudioUnMute:event=>{
	// event = { "result":0, "clientId":"XXX", "msg":"user unmuted audio" } 
}

// To self - Audio muted / unmuted
audioEvent:event=>{
	// event = { "msg":"Audio Off", "result":0 } 
	// event = { "msg":"Audio On", "result":0 } 
}

Mute / Unmute Video in a Stream

Use Enx.muteSelfVideo() method to mute and unmute video from Local Stream. When a user mutes or unmutes audio from own Published Stream, all other connected users of the room are notified with remoteStreamVideoMute and remoteStreamVideoUnMute callbacks respectively. Listen to these events to update related UI elements.

Class: EnxStream

Methods: Enx.muteSelfVideo( localStreamId, muteState )

Parameters:

  • localStreamId – String, Local Stream Id whose video is to be muted or unmuted
  • muteState – Boolean, Pass to true to mute, false to unmute

Callbacks:

  • remoteStreamVideoMute – To all participants notifying user has muted video
  • remoteStreamVideoUnMute – To all participants notifying user has unmuted video
  • videoEvent – To self that video is either muted or unmuted
Enx.muteSelfVideo(localStreamId, true);   //To mute video
Enx.muteSelfVideo(localStreamId,false);   //To unMute video

// To all participant - user muted video 
remoteStreamVideoMute:event=>{
	// event = { "result":0, "clientId":"XXX", "msg":"user muted video" } 
}

// To all participant - user unmuted video
remoteStreamVideoUnMute:event=>{
	// event = { "result":0, "clientId":"XXX", "msg":"user unmuted video" } 
}

// To self - Video muted / unmuted
videoEvent:event=>{
	// event = { "msg":"Video Off", "result":0 } 
	// event = { "msg":"Video On", "result":0 } 
}