{"id":4156,"date":"2021-11-09T18:14:15","date_gmt":"2021-11-09T10:14:15","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4156"},"modified":"2022-04-12T18:35:24","modified_gmt":"2022-04-12T10:35:24","slug":"participant-role-switch","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/web-toolkit\/participant-role-switch\/","title":{"rendered":"Participant Role Switch: Web SDK &#8211; Video API"},"content":{"rendered":"\n<p>The&nbsp;<code>EnxRoom.switchUserRole()<\/code>&nbsp;method allows the Moderator to promote a Participant to act as a Moderator in the ongoing Session. This newly appointed Moderator gets access to Moderator Controls and the former Moderator becomes a Participant in the Session. The new Moderator can further grant the Moderator role to another participant if so desired.<\/p>\n\n\n\n<p><strong>Method<\/strong>: <code>EnxRoom.switchUserRole(ParticipantId, Callback)<\/code><\/p>\n\n\n\n<p><strong>Parameters<\/strong>: <code>ParticipantID <\/code>&#8211; Client ID of the participant who is being designated as Moderator<\/p>\n\n\n\n<p><strong>Notification Event: <\/strong><\/p>\n\n\n\n<ul><li><code>user-role-changed<\/code> &#8211; Notification to all participants in the Room when a participant is newly appointed as the Moderator. The appointed moderator is notified with extra information required to moderate the Session.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">room.switchUserRole (participantId, function(status) { \n     if ( status.result == 0) {\n         \/\/ Succeeded\n     }\n     else {\n         \/\/ Failed message: status.msg\n     }\n });\n \n room.addEventListener('user-role-changed', function (evt) {\n      \/\/ evt JSON Structure\n      \/*\n      {\t\traisedHands: [], \/\/Raised Hand Requests\n\t\tapprovedHands: [],  \/\/ Who has floor control\n\t\tmoderator: {\n\t\t\tnew : new client_id, \/\/ New Moderartor\n\t\t\told : old clientId   \/\/ Old Moderartor\n\t\t} \n\t}\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=\"..\/session-extension-closure\/\">Extend \/ Destroy Session<\/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=\"..\/pin-user\/\">Pin User<\/a> \u2192 <\/p>\n<\/div>\n<\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The&nbsp;EnxRoom.switchUserRole()&nbsp;method allows the Moderator to promote a Participant to act as a Moderator in the ongoing Session. This newly appointed Moderator gets access to Moderator Controls and the former Moderator becomes a Participant in the Session. The new Moderator can further grant the Moderator role to another participant if so desired. Method: EnxRoom.switchUserRole(ParticipantId, Callback) Parameters: ParticipantID &#8211; Client ID of the participant who is being designated as Moderator Notification Event:&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.switchUserRole()&nbsp;method allows the Moderator to promote a Participant to act as a Moderator in the ongoing Session. This newly appointed Moderator gets access to Moderator Controls and the former Moderator becomes a Participant in the Session. The new Moderator can further grant the Moderator role to another participant if so desired. Method: EnxRoom.switchUserRole(ParticipantId, Callback) Parameters:&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4156"}],"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=4156"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4156\/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=4156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}