Table of Contents
Mute / Unmute Audio in a Stream
The EnxStream.muteSelfAudio() method is used to mute/unmute Audio of the Local Stream.
Class: EnxStream
Methods: - (void) muteSelfAudio:(BOOL)isMuted;
Parameter: isMuted – BOOL. Pass true to mute, false to unmute Audio.
Callbacks:
- didRemoteStreamAudioMute:– Notification to everyone in the Room when a user mutes self Audio.- didRemoteStreamAudioUnMute:– Notification to everyone in the Room when a user unmutes self Audio.- didAudioEvent:– Acknowledgment to the user when self Audio is muted/unmuted.
[localStream muteSelfAudio:true]; // To mute audio of local stream
[localStream muteSelfAudio:false]; // To unmute audio of local stream
// This delegate method to self that Audio is muted/unmuted.
-(void)didAudioEvent:(NSDictionary *)data{
//data is { "msg":"Audio On", "result":0 }
}
// This delegate method is to announce in the Room that a user
// has muted his Audio
-(void)stream:(EnxStream *)stream didRemoteStreamAudioMute:(NSArray *)data{
/* data is
[ {
"result":0,
"clientId":"XXX",
"msg":"user muted audio"
},
"<null>"
]
*/
}
// This delegate method is to announce in the Room that a user
// has unmuted his Audio
-(void)stream:(EnxStream *)stream didRemoteStreamAudioUnMute:(NSArray *)data{
/* data is
[ {
"result":0,
"clientId":"XXX",
"msg":"user unmuted audio"
},
"<null>"
]
*/
}
Error Codes / Exceptions:
| Code | Description |
|---|---|
| 5058 | Repeated muteSelfAudio() call made while a previous mute request is in process. |
| 5059 | Repeated muteSelfAudio() call made while a previous unmute request is in process. |
| 5060 | Repeated muteSelfAudio() call made after Audio has been muted already. |
| 5061 | Trying to unmute Audio without muting it first. |
| 5062 | Unable to unmute Audio as Audio hard-muted by the Moderator. |
Note: In case of error, <null> is received at the first Index and Error Info at the second Index.
Mute / Unmute Video in a Stream
The EnxStream.muteSelfVideo() method is used to mute/unmute Video of the Local Stream.
Class: EnxStream
Methods: - (void) muteSelfVideo:(BOOL)isMuted;
Parameter: isMuted – BOOL. true to mute, false to unmute Video.
Callbacks:
- didRemoteStreamVideoMute:– Notification to everyone in the Room when a user mutes self Video.- didRemoteStreamVideoUnMute:– Notification to everyone in the Room when a user unmutes self Video.- didVideoEvent:– Acknowledgment to the user when self Video is muted/unmuted.
[localStream muteSelfVideo:true]; // To mute video of local stream.
[localStream muteSelfVideo:false]; // To unmute video of local stream.
// This delegate method to self. Video is muted/unmuted.
-(void)didVideoEvent:(NSDictionary *)data{
//data is { "msg":"Video On", "result":0 }
}
// This delegate method is to announce in the Room that a user
// has muted his Video
-(void)stream:(EnxStream *)stream didRemoteStreamVideoMute:(NSArray *)data{
/* data is
[ {
"result":0,
"clientId":"XXX",
"msg":"user muted video"
},
"<null>"
]
*/
}
// This delegate method is to announce in the Room that a user
// has unmuted his Video
-(void)stream:(EnxStream *)stream didRemoteStreamVideoUnMute:(NSArray *)data{
/* data is
[ {
"result":0,
"clientId":"XXX",
"msg":"user unmuted video"
},
"<null>"
]
*/
}
Error Codes / Exceptions:
| Code | Description |
|---|---|
| 5020 | Unable to process muteSelfVideo() when the user has denied Camera permission. |
| 5071 | Repeated muteSelfVideo() call made while a previous request is in process. |
| 5063 | Repeated muteSelfVideo() call made after Video has been muted already. |
| 5064 | Repeated muteSelfVideo() call made after Video has been unmuted already. |
| 5065 | When the user tries to unmute Video without muting it first. Non-Contextual Method call. |
| 5066 | Unable to unmute Video as Video hard-muted by the Moderator. |
| 5070 | Unable to unmute Video in Audio-only call mode. |
Note: In case of error, <null> is received at the first Index and Error Info at the second Index.
