{"id":4137,"date":"2021-11-09T15:02:35","date_gmt":"2021-11-09T07:02:35","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4137"},"modified":"2022-04-12T18:35:01","modified_gmt":"2022-04-12T10:35:01","slug":"disconnect-user","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/web-toolkit\/disconnect-user\/","title":{"rendered":"Disconnect User: Web SDK &#8211; Video API"},"content":{"rendered":"\n<p>The&nbsp;<code>EnxRoom.dropUser()<\/code>&nbsp;method allows the Moderator to disconnect \/ force-drop one or more participant(s) from the Session.<\/p>\n\n\n\n<p><strong>Class:<\/strong> EnxRoom<\/p>\n\n\n\n<p><strong>Method:<\/strong>&nbsp;<code>EnxRoom.dropUser(ClientIds, Callback)<\/code><\/p>\n\n\n\n<p><strong>Parameters: <\/strong><\/p>\n\n\n\n<ul><li><code>ClientId<\/code> &#8211; Required. Array of Client Ids to be disconnected. You can also pass an empty array \u201c[]\u201d to disconnect all the users.<\/li><li><code>Callback<\/code> &#8211; A JSON received with status of API call.  <\/li><\/ul>\n\n\n\n<p><strong>Event Notification:<\/strong>&nbsp;<\/p>\n\n\n\n<p><code>room-disconnected<\/code>&nbsp;&#8211; Notification to the affected user with the reason to be disconnected from the Room.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ To disconnect specified user\nroom.dropUser([ClientId], function(res) {\n    if (res.result == 0) {\n        \/\/ Request processed \n    }\n});\n\n\/\/ To disconnect all usuers. pass empty Array\nroom.dropUser([], function(res) {\n    if (res.result == 0) {\n        \/\/ Request processed \n    }\n});\n\n\/\/ All users are notified disconnection with reason\nroom.addEventListener(\"room-disconnected\", function(event) {\n\t\/\/ Event may be processed to know reason\n\tif (event.message.cause.msg === 'disconnected-by-moderator')\t{\n\t\t\/\/ Show message to user\n\t}\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=\"..\/room-entry-restriction\/\">Room Entry Restriction<\/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=\"..\/session-extension-closure\/\">Extend \/ Destroy Session<\/a> \u2192 <\/p>\n<\/div>\n<\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The&nbsp;EnxRoom.dropUser()&nbsp;method allows the Moderator to disconnect \/ force-drop one or more participant(s) from the Session. Class: EnxRoom Method:&nbsp;EnxRoom.dropUser(ClientIds, Callback) Parameters: ClientId &#8211; Required. Array of Client Ids to be disconnected. You can also pass an empty array \u201c[]\u201d to disconnect all the users. Callback &#8211; A JSON received with status of API call. Event Notification:&nbsp; room-disconnected&nbsp;&#8211; Notification to the affected user with the reason to be disconnected from the Room.&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":"The&nbsp;EnxRoom.dropUser()&nbsp;method allows the Moderator to disconnect \/ force-drop one or more participant(s) from the Session. Class: EnxRoom Method:&nbsp;EnxRoom.dropUser(ClientIds, Callback) Parameters: ClientId &#8211; Required. Array of Client Ids to be disconnected. You can also pass an empty array \u201c[]\u201d to disconnect all the users. Callback &#8211; A JSON received with status of API call. Event Notification:&nbsp;&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4137"}],"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=4137"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4137\/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=4137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}