{"id":4783,"date":"2021-12-07T20:57:40","date_gmt":"2021-12-07T12:57:40","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4783"},"modified":"2022-04-11T18:58:38","modified_gmt":"2022-04-11T10:58:38","slug":"mute-audio-video-stream","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/cordova-toolkit\/mute-audio-video-stream\/","title":{"rendered":"Mute \/ Unmute Audio &#038; Video Stream: Cordova\/Ionic 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:40px\" 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>window.EnxRtc.muteSelfAudio()<\/code> method to mute and unmute audio from Local Stream. When a user mutes or unmutes audio from her own Published Stream, Self user notifies with event <code>onAudioEvent <\/code>and all other connected users of the room are notified with event listeners <code>onRemoteStreamAudioMute <\/code>and <code>onRemoteStreamAudioUnMute <\/code>callbacks respectively. Listen to these events to update related UI elements.<\/p>\n\n\n\n<p><strong>Methods:<\/strong> <code>muteSelfAudio(audio)<\/code> <\/p>\n\n\n\n<p><strong>Parameters:<\/strong> <code>@param {Boolean} audio<\/code> &#8211;&nbsp; Pass <code>true<\/code> to mute, false to <code>unmute<\/code> audio<\/p>\n\n\n\n<p><strong>Event Listeners:<\/strong><\/p>\n\n\n\n<ul><li> <code>onRemoteStreamAudioMute<\/code>&#8211; to all participants notifying user has muted audio <\/li><li> <code>onRemoteStreamAudioUnMute<\/code> &#8211; to all participants notifying user has unmuted audio<\/li><li><code>onAudioEvent<\/code>&#8211; to self that audio is either muted or unmuted<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ To mute audio\nwindow.EnxRtc.muteSelfAudio(true);\n\/\/ To unmute audio\nwindow.EnxRtc.muteSelfAudio(false);\n\/\/ Add event listeners\n\/\/ To self. Audio is muted\/unmuted.\nwindow.EnxRtc.addEventListner(\"onAudioEvent\", function (data)\n{\nconsole.log(JSON.stringify(data.data));\n});\n\/\/ To all. Audio muted by Remote user\nwindow.EnxRtc.addEventListner(\"onRemoteStreamAudioMute\", function (data)\n{\nconsole.log(JSON.stringify(data.data));\n});\n\/\/ To all. Audio unmuted by Remote user\nwindow.EnxRtc.addEventListner(\"onRemoteStreamAudioUnMute\", function\n(data)\n{\nconsole.log(JSON.stringify(data.data));});<\/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>window.EnxRtc.muteSelfVideo()<\/code> method to mute and unmute video from Local Stream. When a user mutes or unmutes video from own Published Stream, self user notifies with event <code>onVideoEvent<\/code> and all other connected users of the room are notified with <code>onRemoteStreamVideoMute <\/code>and <code>onRemoteStreamVideoUnMute<\/code> callbacks respectively.<\/p>\n\n\n\n<p><strong>Methods:<\/strong>  <code>muteSelfVideo(video)<\/code><\/p>\n\n\n\n<p><strong>Parameters: <\/strong><code>@param {Boolean} video <\/code>&#8211;&nbsp; Pass <code>true<\/code> to mute, false to <code>unmute<\/code> video<\/p>\n\n\n\n<p><strong>Event Listeners:<\/strong><\/p>\n\n\n\n<ul><li><code>onRemoteStreamVideoMute<\/code> &#8211; to all participants notifying user has muted video<\/li><li><code>onRemoteStreamVideoUnMute<\/code> &#8211; to all participants notifying user has unmuted video<\/li><li><code>onVideoEvent<\/code> &#8211; to self that video is either muted or unmuted <\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ To mute video\nwindow.EnxRtc.muteSelfVideo(true);\n\/\/ To unmute video\nwindow.EnxRtc.muteSelfVideo(false);\n\/\/Add event listeners\/\/ To self. Video is muted\/unmuted.\nwindow.EnxRtc.addEventListner(\"onVideoEvent\", function (data)\n{\nconsole.log(JSON.stringify(data.data));\n});\n\/\/ To all. Video muted by Remote user\nwindow.EnxRtc.addEventListner(\"onRemoteStreamVideoMute\", function (data)\n{\nconsole.log(JSON.stringify(data.data));\n});\n\/\/ To all. Video unmuted by Remote user\nwindow.EnxRtc.addEventListner(\"onRemoteStreamVideoUnMute\", function\n(data)\n{\nconsole.log(JSON.stringify(data.data));\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=\"..\/update-stream-configuration\/\"><\/a><a href=\"..\/update-stream-configuration\/\">Update Stream Configuration<\/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 window.EnxRtc.muteSelfAudio() method to mute and unmute audio from Local Stream. When a user mutes or unmutes audio from her own Published Stream, Self user notifies with event onAudioEvent and all other connected users of the room are notified with event listeners onRemoteStreamAudioMute and onRemoteStreamAudioUnMute callbacks&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3719,"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 window.EnxRtc.muteSelfAudio() method to mute and unmute audio from Local Stream. When a user mutes or unmutes audio from her own Published Stream, Self user notifies with event onAudioEvent and all&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4783"}],"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=4783"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4783\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/3719"}],"wp:attachment":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/media?parent=4783"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}