{"id":4554,"date":"2021-11-29T15:29:27","date_gmt":"2021-11-29T07:29:27","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4554"},"modified":"2022-04-08T14:01:38","modified_gmt":"2022-04-08T06:01:38","slug":"mute-audio-video-stream","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/react-native-toolkit\/mute-audio-video-stream\/","title":{"rendered":"Mute \/ Unmute Audio &#038; Video Stream: React Native 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>Use <code>Enx.muteSelfAudio()<\/code> 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   <code>remoteStreamAudioMute<\/code> and&nbsp; <code>remoteStreamAudioUnmute<\/code> callbacks respectively. Listen to these events to update related UI elements.<\/p>\n\n\n\n<p><strong>Methods:<\/strong> <code>Enx.muteSelfAudio( localStreamId, muteState )<\/code> <\/p>\n\n\n\n<p>Parameters:<\/p>\n\n\n\n<ul><li><code>localStreamId <\/code>&#8211; String, Local Stream Id which is to be muted or unmuted<\/li><li><code>muteState<\/code> &#8211; Boolean, Pass to <em>true <\/em>to mute, <em>false <\/em>to unmute  <\/li><\/ul>\n\n\n\n<p> <\/p>\n\n\n\n<p><strong>Callbacks:<\/strong><\/p>\n\n\n\n<ul><li><code>remoteStreamAudioMute<\/code> &#8211; To all participants notifying user has muted audio <\/li><li><code>remoteStreamAudioUnmute<\/code>  &#8211; To all participants  notifying user has unmuted audio<\/li><li><code>audioEvent<\/code> &#8211; To self that audio is either muted or unmuted<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">Enx.muteSelfAudio(localStreamId, true);   \/\/To mute audio\nEnx.muteSelfAudio(localStreamId,false);   \/\/To unMute audio\n\n\/\/ To all participant - user muted audio \nremoteStreamAudioMute:event=&gt;{\n\t\/\/ event = { \"result\":0, \"clientId\":\"XXX\", \"msg\":\"user muted audio\" } \n}\n\n\/\/ To all participant - user unmuted audio\nremoteStreamAudioUnMute:event=&gt;{\n\t\/\/ event = { \"result\":0, \"clientId\":\"XXX\", \"msg\":\"user unmuted audio\" } \n}\n\n\/\/ To self - Audio muted \/ unmuted\naudioEvent:event=&gt;{\n\t\/\/ event = { \"msg\":\"Audio Off\", \"result\":0 } \n\t\/\/ event = { \"msg\":\"Audio On\", \"result\":0 } \n}<\/pre>\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>Use <code>Enx.muteSelfVideo()<\/code> 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  <code>remoteStreamVideoMute<\/code>&nbsp;and&nbsp;<code>remoteStreamVideoUnMute<\/code>  callbacks respectively. Listen to these events to update related UI elements. <\/p>\n\n\n\n<p><strong>Class<\/strong>: <code>EnxStream<\/code><\/p>\n\n\n\n<p><strong>Methods:<\/strong>  <code>Enx.muteSelfVideo( localStreamId, muteState )<\/code><\/p>\n\n\n\n<p><strong>Parameters:<\/strong><\/p>\n\n\n\n<ul><li><code>localStreamId <\/code>&#8211; String, Local Stream Id whose video is to be muted or unmuted<\/li><li><code>muteState<\/code> &#8211; Boolean, Pass to <em>true <\/em>to mute, <em>false <\/em>to unmute   <\/li><\/ul>\n\n\n\n<p><strong>Callbacks:<\/strong><\/p>\n\n\n\n<ul><li><code>remoteStreamVideoMute<\/code> &#8211; To all participants notifying user has muted video<\/li><li><code>remoteStreamVideoUnMute<\/code>  &#8211; To all participants  notifying user has unmuted video<\/li><li><code>videoEvent<\/code> &#8211; To self that video is either muted or unmuted <\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">Enx.muteSelfVideo(localStreamId, true);   \/\/To mute video\nEnx.muteSelfVideo(localStreamId,false);   \/\/To unMute video\n\n\/\/ To all participant - user muted video \nremoteStreamVideoMute:event=&gt;{\n\t\/\/ event = { \"result\":0, \"clientId\":\"XXX\", \"msg\":\"user muted video\" } \n}\n\n\/\/ To all participant - user unmuted video\nremoteStreamVideoUnMute:event=&gt;{\n\t\/\/ event = { \"result\":0, \"clientId\":\"XXX\", \"msg\":\"user unmuted video\" } \n}\n\n\/\/ To self - Video muted \/ unmuted\nvideoEvent:event=&gt;{\n\t\/\/ event = { \"msg\":\"Video Off\", \"result\":0 } \n\t\/\/ event = { \"msg\":\"Video On\", \"result\":0 } \n}<\/pre>\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=\"..\/advance-stream-options\/\"><\/a><a href=\"..\/advance-stream-options\/\">Use Advance Stream Options<\/a> \u2192<a href=\"\/developer\/how-to-use\/\"><\/a><\/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 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&nbsp; remoteStreamAudioUnmute callbacks respectively. Listen to these events to update related UI elements.&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3747,"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 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&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4554"}],"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=4554"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4554\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/3747"}],"wp:attachment":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/media?parent=4554"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}