{"id":4163,"date":"2021-11-09T19:40:48","date_gmt":"2021-11-09T11:40:48","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4163"},"modified":"2025-04-11T20:37:31","modified_gmt":"2025-04-11T12:37:31","slug":"pin-user","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/web-toolkit\/pin-user\/","title":{"rendered":"Pin User: Web SDK &#8211; Video API"},"content":{"rendered":"\n<p>The\u00a0<code>EnxRoom.pinUsers()<\/code>\u00a0method allows the Moderator to pin a user(s) to the\u00a0<a rel=\"noreferrer noopener\" href=\"..\/active-talkers\/\" target=\"_blank\">Active Talker List<\/a>\u00a0irrespective of the user\u2019s activity level. A pinned user\u2019s Stream is always published in the Room even if they are not talking. The inactive pinned users are placed in the Active Talker List after the actively talking users in a descending order based on the activity level with the most active talker on top. The total number of pinned users in a Room is restricted to (<code>max_active_talkers<\/code>\u00a0\u2013 1) based on the\u00a0<a href=\"\/developer\/video-api\/server-api\/rooms-route\/#create-room\" target=\"_blank\" rel=\"noreferrer noopener\">Room configuration<\/a>.<\/p>\n\n\n\n<p>On joining a Room, the user is notified via\u00a0<code><code>room-connected<\/code><\/code>\u00a0event with\u00a0<a href=\"\/developer\/video-api\/client-api\/appendix\/#room-meta\" target=\"_blank\" rel=\"noreferrer noopener\">Room Meta Information<\/a>, which contains the list of pinned users as\u00a0<code>\"pinnedUsers\": [ \/*client-ids*\/ ]<\/code>.<\/p>\n\n\n\n<p>The&nbsp;<code>EnxRoom.unpinUsers()<\/code>&nbsp;method is used to unpin the user(s).<\/p>\n\n\n\n<p><strong>Methods:<\/strong><\/p>\n\n\n\n<ul><li><code>EnxRoom.pinUsers(clientIds[], callback)<\/code>&nbsp;<\/li><li><code>EnxRoom.unpinUsers(clientIds[], callback)<\/code>&nbsp;&nbsp;<\/li><\/ul>\n\n\n\n<p><strong>Parameters: <\/strong><\/p>\n\n\n\n<ul><li><code>clientIds<\/code> &#8211; Array of Client IDs of users whose streams need to be pinned or unpinned.<\/li><li><code>callback<\/code> &#8211; Returns response information of the pin or unpin requests in JSON Payload <code>{ result : Number, clients[] }<\/code><ul><li><code>result<\/code> &#8211; 0 if success. An error-code in case of an error.<\/li><li><code>clientIds<\/code> &#8211; Array of Client IDs passed to pin or unpin along with respective result code. <\/li><\/ul><\/li><\/ul>\n\n\n\n<p><strong>Event Notifications:<\/strong><\/p>\n\n\n\n<ul><li><code>updated-pinned-users<\/code> &#8211;&nbsp;Notification to everyone in the Room with an updated list of pinned users in a JSON format: <code>{ \"moderator_id\": String, clientIds: [] }<\/code><ul><li><code>moderator_id<\/code> &#8211; Moderator responsible for updating the pinned user list.<\/li><li><code>clientI<\/code>ds &#8211; Array of Client_ids of users who are pinned.<\/li><\/ul><\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ To pin users\nroom.pinUsers(clientIDs, function(resp) {\n\t\/\/ resp json { \"result\": Number, \"clients\": [] }\n})\n\n\/\/ To unpin users\nroom.unpinUsers(clientIDs, function(resp) {\n\t\/\/ resp json { \"result\": Number, \"clientIds\": [] }\n})\n\n\/\/ Everyone is notified with updated pinned user list\nroom.addEventListener('updated-pinned-users', function(event) {\n\t \/\/ event json { \"moderator_id\": String, \"clientIds\": [] }\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=\"..\/participant-role-switch\/\">Participant Role Switch<\/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=\"..\/spotlight-user\/\">Spotlight User<\/a> \u2192 <\/p>\n<\/div>\n<\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The\u00a0EnxRoom.pinUsers()\u00a0method allows the Moderator to pin a user(s) to the\u00a0Active Talker List\u00a0irrespective of the user\u2019s activity level. A pinned user\u2019s Stream is always published in the Room even if they are not talking. The inactive pinned users are placed in the Active Talker List after the actively talking users in a descending order based on the activity level with the most active talker on top. The total number of pinned&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\u00a0EnxRoom.pinUsers()\u00a0method allows the Moderator to pin a user(s) to the\u00a0Active Talker List\u00a0irrespective of the user\u2019s activity level. A pinned user\u2019s Stream is always published in the Room even if they are not talking. The inactive pinned users are placed in the Active Talker List after the actively talking users in a descending order based on&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4163"}],"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=4163"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4163\/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=4163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}