{"id":4029,"date":"2021-11-02T18:40:57","date_gmt":"2021-11-02T10:40:57","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4029"},"modified":"2022-04-08T14:23:25","modified_gmt":"2022-04-08T06:23:25","slug":"mute-audio-video-stream","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/web-toolkit\/mute-audio-video-stream\/","title":{"rendered":"Mute Audio-Video Stream: Web SDK &#8211; Video API"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote\"><p>In case you need to mute Audio or turn off video of your own published Media Stream, you may use APIs to do so. Similary, using API Call, you can unmute Audio or turn on Video on Media Stream again.<\/p><\/blockquote>\n\n\n\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.muteAudio()<\/code> and <code>EnxStream.unmuteAudio()<\/code> methods allow you to mute and unmute the audio track of a Local Stream.<\/p>\n\n\n\n<p><strong>Methods:<\/strong><\/p>\n\n\n\n<ul><li>To mute Audio track of Local Stream:<ul><li><code>EnxStream.muteAudio()<\/code> &#8211; No Parameter required.<\/li><\/ul><\/li><li>To unmute Audio track of Local Stream:<ul><li><code>EnxStream.unmuteAudio()<\/code> &#8211; No Parameter required. <\/li><\/ul><\/li><\/ul>\n\n\n\n<p><strong>Event Notifications:<\/strong><\/p>\n\n\n\n<ul><li> <code>user-audio-muted<\/code> &#8211; Notification to everyone in the Room when a user mutes self Audio.<\/li><li> <code>user-audio-unmuted<\/code> &#8211; Notification to everyone in the Room when a user unmutes self Audio.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">localStream.muteAudio( function(res) {   \n      \/\/ Audio muted. Handle UI here\n});\n     \nlocalStream.unmuteAudio( function(res) {    \n     \/\/ Audio unmuted. Handle UI here\n});\n\n\/\/ Notification to others when a user muted audio\nroom.addEventListener(\"user-audio-muted\", function (event) {\n     \/\/ Handle UI here\n});\n\n\/\/ Notification to others when a user muted audio\nroom.addEventListener(\"user-audio-unmuted\", function (event) {\n     \/\/ Handle UI here\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>1140<\/td><td>Repeated&nbsp;API&nbsp;call made while a previous mute request is in process.<\/td><\/tr><tr><td>1176<\/td><td>The right to control media devices by the Moderator.<\/td><\/tr><tr><td>1191<\/td><td>Stream Track has ended. User must rejoin to restore Audio.<\/td><\/tr><\/tbody><\/table><\/figure>\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.muteVideo()<\/code> and <code>EnxStream.unmuteVideo()<\/code> methods allow you to mute and unmute the video track of a Local Stream. <\/p>\n\n\n\n<p><strong>Methods:<\/strong><\/p>\n\n\n\n<ul><li> Notification to everyone in the Room when a user mutes self Video.<ul><li><code>EnxStream.muteVideo(Callback)<\/code> &#8211; No Parameter required. <\/li><\/ul><\/li><li>Notification to everyone in the Room when a user unmutes self Video. <ul><li><code>EnxStream.unmuteVideo(Callback)<\/code> &#8211; No Parameter required.<\/li><\/ul><\/li><\/ul>\n\n\n\n<p><strong>Event Notifications:<\/strong><\/p>\n\n\n\n<ul><li> <code>user-video-muted<\/code> &#8211; Notification to everyone in the Room when a user mutes self Video.<\/li><li> <code>user-video-unmuted<\/code> &#8211; Notification to everyone in the Room when a user unmutes self Video.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">localStream.muteVideo( function(res) {   \n      \/\/ Video muted. Handle UI here\n});\n     \nlocalStream.unmuteVideo( function(res) {    \n     \/\/ Video unmuted. Handle UI here\n});\n\n\/\/ Notification to others when a user muted video\nroom.addEventListener(\"user-video-muted\", function (event) {\n     \/\/ Handle UI here\n});\n\n\/\/ Notification to others when a user muted video\nroom.addEventListener(\"user-video-unmuted\", function (event) {\n     \/\/ Handle UI here\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>1140<\/td><td>Repeated&nbsp;method&nbsp;call made while a previous unmute request is in process.<\/td><\/tr><tr><td>1176<\/td><td>The right to control media devices by the Moderator.<\/td><\/tr><\/tbody><\/table><\/figure>\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=\"..\/publishing-local-stream\/\">Switch Camera, Mic &amp; 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 Streams<\/a>  \u2192 <\/p>\n<\/div>\n<\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In case you need to mute Audio or turn off video of your own published Media Stream, you may use APIs to do so. Similary, using API Call, you can unmute Audio or turn on Video on Media Stream again. Table of Contents Mute \/ Unmute Audio in a Stream Mute \/ Unmute Video in a Stream Mute \/ Unmute Audio in a Stream The EnxStream.muteAudio() and EnxStream.unmuteAudio() methods allow&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3724,"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":"In case you need to mute Audio or turn off video of your own published Media Stream, you may use APIs to do so. Similary, using API Call, you can unmute Audio or turn on Video on Media Stream again. Table of Contents Mute \/ Unmute Audio in a Stream Mute \/ Unmute Video in&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4029"}],"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=4029"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4029\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/3724"}],"wp:attachment":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/media?parent=4029"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}