{"id":4342,"date":"2021-11-17T19:50:00","date_gmt":"2021-11-17T11:50:00","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4342"},"modified":"2022-04-11T20:55:37","modified_gmt":"2022-04-11T12:55:37","slug":"mute-audio-video-stream","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/ios-toolkit\/mute-audio-video-stream\/","title":{"rendered":"Mute \/ Unmute Audio &#038; Video Stream: iOS SDK &#8211; Video API"},"content":{"rendered":"\n<h4>Table of Contents<\/h4>\n\n\n\n<ul><li><a href=\"#mute-unmute-audio\">Mute \/ Unmute Audio in a Stream<\/a><\/li><li><a href=\"#mute-unmute-video\">Mute \/ Unmute Video in a Stream<\/a> <\/li><\/ul>\n\n\n\n<a name=\"mute-unmute-audio\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2>Mute \/ Unmute Audio in a Stream<\/h2>\n\n\n\n<p>The <code>EnxStream.muteSelfAudio()<\/code> method is used to mute\/unmute Audio of the Local Stream.<\/p>\n\n\n\n<p><strong>Class<\/strong>: <code>EnxStream<\/code><\/p>\n\n\n\n<p><strong>Methods:<\/strong> <code>- (void) muteSelfAudio:(BOOL)isMuted;<\/code>  <\/p>\n\n\n\n<p><strong>Parameter:<\/strong> <code>isMuted<\/code> &#8211; BOOL. Pass <em>true <\/em>to mute, <em>false <\/em>to unmute Audio.<\/p>\n\n\n\n<p><strong>Callbacks:<\/strong><\/p>\n\n\n\n<ul><li><code>- didRemoteStreamAudioMute:<\/code> &#8211; Notification to everyone in the Room when a user mutes self Audio.<\/li><li><code>- didRemoteStreamAudioUnMute:<\/code> &#8211; Notification to everyone in the Room when a user unmutes self Audio.<\/li><li><code>- didAudioEvent:<\/code><strong> <\/strong>&#8211; Acknowledgment to the user when self Audio is muted\/unmuted.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">[localStream muteSelfAudio:true]; \/\/ To mute audio of local stream\n[localStream muteSelfAudio:false]; \/\/ To unmute audio of local stream\n\n\/\/ This delegate method to self that Audio is muted\/unmuted.\n-(void)didAudioEvent:(NSDictionary *)data{\n \/\/data is { \"msg\":\"Audio On\", \"result\":0 }\n}\n\n\/\/ This delegate method is to announce in the Room that a user\n\/\/ has muted his Audio\n-(void)stream:(EnxStream *)stream didRemoteStreamAudioMute:(NSArray *)data{\n \/* data is \n [ {\n  \"result\":0,\n  \"clientId\":\"XXX\",\n  \"msg\":\"user muted audio\"\n  },\n  \"&lt;null&gt;\"\n ]\n *\/\n}\n\n\/\/ This delegate method is to announce in the Room that a user\n\/\/ has unmuted his Audio\n-(void)stream:(EnxStream *)stream didRemoteStreamAudioUnMute:(NSArray *)data{\n \/* data is \n [ {\n  \"result\":0,\n  \"clientId\":\"XXX\",\n  \"msg\":\"user unmuted audio\"\n  },\n  \"&lt;null&gt;\"\n ]\n *\/\n}<\/pre>\n\n\n\n<p><strong>Error Codes \/ Exceptions<\/strong>:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Code<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>5058<\/td><td>Repeated <code>muteSelfAudio()<\/code> call made while a previous mute request is in process.<\/td><\/tr><tr><td>5059<\/td><td>Repeated <code>muteSelfAudio()<\/code> call made while a previous unmute request is in process.<\/td><\/tr><tr><td>5060<\/td><td>Repeated <code>muteSelfAudio()<\/code> call made after Audio has been muted already.<\/td><\/tr><tr><td>5061<\/td><td>Trying to unmute Audio without muting it first.<\/td><\/tr><tr><td>5062<\/td><td>Unable to unmute Audio as Audio hard-muted by the Moderator.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>Note:&nbsp;<\/strong>In case of error, &lt;null&gt; is received at the first Index and Error Info at the second Index.<\/p>\n\n\n\n<a name=\"mute-unmute-video\"><\/a>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2>Mute \/ Unmute Video in a Stream<\/h2>\n\n\n\n<p>The <code>EnxStream.muteSelfVideo()<\/code> method is used to mute\/unmute Video of the Local Stream.<\/p>\n\n\n\n<p><strong>Class<\/strong>: <code>EnxStream<\/code><\/p>\n\n\n\n<p><strong>Methods:<\/strong> <code>- (void) muteSelfVideo:(BOOL)isMuted;<\/code> <\/p>\n\n\n\n<p><strong>Parameter:<\/strong> <code>isMute<\/code>d &#8211; BOOL. <em>true<\/em> to mute, <em>false<\/em> to unmute Video.<\/p>\n\n\n\n<p><strong>Callbacks:<\/strong><\/p>\n\n\n\n<ul><li><code>- didRemoteStreamVideoMute:<\/code> &#8211; Notification to everyone in the Room when a user mutes self Video.<\/li><li><code>- didRemoteStreamVideoUnMute:<\/code> &#8211; Notification to everyone in the Room when a user unmutes self Video.<\/li><li><code>- didVideoEvent:<\/code><strong> <\/strong>&#8211; Acknowledgment to the user when self Video is muted\/unmuted.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">[localStream muteSelfVideo:true]; \/\/ To mute video of local stream.\n[localStream muteSelfVideo:false]; \/\/ To unmute video of local stream.\n\n\/\/ This delegate method to self. Video is muted\/unmuted.\n-(void)didVideoEvent:(NSDictionary *)data{\n \/\/data is { \"msg\":\"Video On\", \"result\":0 }\n}\n\n\/\/ This delegate method is to announce in the Room that a user\n\/\/ has muted his Video\n-(void)stream:(EnxStream *)stream didRemoteStreamVideoMute:(NSArray *)data{\n \/* data is \n [ {\n  \"result\":0,\n  \"clientId\":\"XXX\",\n  \"msg\":\"user muted video\"\n  },\n  \"&lt;null&gt;\"\n ]\n *\/\n}\n\n\/\/ This delegate method is to announce in the Room that a user\n\/\/ has unmuted his Video\n-(void)stream:(EnxStream *)stream didRemoteStreamVideoUnMute:(NSArray *)data{\n \/* data is \n [ {\n  \"result\":0,\n  \"clientId\":\"XXX\",\n  \"msg\":\"user unmuted video\"\n  },\n  \"&lt;null&gt;\"\n ]\n *\/\n}<\/pre>\n\n\n\n<p><strong>Error Codes \/ Exceptions:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Code<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>5020<\/td><td>Unable to process muteSelfVideo() when the user has denied Camera permission.<\/td><\/tr><tr><td>5071<\/td><td>Repeated <code>muteSelfVideo()<\/code> call made while a previous request is in process.<\/td><\/tr><tr><td>5063<\/td><td>Repeated <code>muteSelfVideo()<\/code> call made after Video has been muted already.<\/td><\/tr><tr><td>5064<\/td><td>Repeated <code>muteSelfVideo()<\/code> call made after Video has been unmuted already.<\/td><\/tr><tr><td>5065<\/td><td>When the user tries to unmute Video without muting it first. Non-Contextual Method call.<\/td><\/tr><tr><td>5066<\/td><td>Unable to unmute Video as Video hard-muted by the Moderator.<\/td><\/tr><tr><td>5070<\/td><td>Unable to unmute Video in Audio-only call mode.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>Note:&nbsp;<\/strong>In case of error, &lt;null&gt; is received at the first Index and Error Info at the second Index.<\/p>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column\">\n<p>\u2190 <a href=\"..\/switch-camera-mic-speaker\/\">Switch Camera, Mic, Speaker<\/a><\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<p class=\"has-text-align-center\"><a href=\"..\/\">Index<\/a><\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<p class=\"has-text-align-right\"><a href=\"..\/subscribing-remote-streams\/\">Subscribe Remote Stream<\/a> \u2192<\/p>\n<\/div>\n<\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Table of Contents Mute \/ Unmute Audio in a Stream Mute \/ Unmute Video in a Stream Mute \/ Unmute Audio in a Stream The EnxStream.muteSelfAudio() method is used to mute\/unmute Audio of the Local Stream. Class: EnxStream Methods: &#8211; (void) muteSelfAudio:(BOOL)isMuted; Parameter: isMuted &#8211; BOOL. Pass true to mute, false to unmute Audio. Callbacks: &#8211; didRemoteStreamAudioMute: &#8211; Notification to everyone in the Room when a user mutes self Audio.&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3732,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"ub_ctt_via":""},"featured_image_src":null,"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"featured":false,"featured-large":false},"uagb_author_info":{"display_name":"vcxdevwpadmin","author_link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/author\/vcxdevwpadmin\/"},"uagb_comment_info":0,"uagb_excerpt":"Table of Contents Mute \/ Unmute Audio in a Stream Mute \/ Unmute Video in a Stream 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 &#8211; BOOL. Pass true to mute, false to unmute Audio. Callbacks:&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4342"}],"collection":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/comments?post=4342"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4342\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/3732"}],"wp:attachment":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/media?parent=4342"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}