{"id":4638,"date":"2021-12-01T18:38:53","date_gmt":"2021-12-01T10:38:53","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4638"},"modified":"2022-04-08T18:42:52","modified_gmt":"2022-04-08T10:42:52","slug":"participant-role-switch","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/react-native-toolkit\/participant-role-switch\/","title":{"rendered":"Participant Role Switch: React Native SDK &#8211; Video API"},"content":{"rendered":"\n<p>A Moderator can designate a connected Participant to act as a Moderator during the session. Doing so, the promoted Participant would get access to all the rights of the Moderator, i.e. accesses all features listed under Moderator Controls; and the old Moderator becomes a Participant. Similarly, the new Moderator can further grant Moderator Role to other participant if needed. <\/p>\n\n\n\n<p><strong>Method<\/strong>:&nbsp;<code>Enx.switchUserRole(clientId)<\/code> <\/p>\n\n\n\n<p><strong>Parameter<\/strong>:&nbsp;<code>clientId&nbsp;<\/code>\u2013 Client ID of the participant who is being designated as Moderator<\/p>\n\n\n\n<p><strong>Callbacks:<\/strong><\/p>\n\n\n\n<ul><li><code>acknowledgeSwitchUserRole<\/code>\u2013 Moderator is acknowledged that he has requested for Switch User Role<\/li><li><code>userRoleChanged<\/code>\u2013 All participants are notified with a message that a new user has been appointed as moderator. Also, the newly appointed moderator is notified with extra information<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">Enx.switchUserRole(clientId); \/\/ Role Change Request from Moderator\n\nacknowledgeSwitchUserRole: event =&gt; {\n\t\/\/ Moderator is acknowledged\n}\n\nuserRoleChanged: event =&gt; {\n\t\/\/ All Participants are notified - event jsonObject\n\t\/*\n\t{\t\"moderator\": false, \/\/ You are not a moderator\n\t\t\"clientId\": \"XXX\"   \/\/ New Moderator's Client ID\n\t}\n\t*\/\n    \n\t\/\/ New Moderator is notified  - jsonObject\n\t\/*\n\t{   \"moderator\": true,  \/\/ You are a moderator\n\t\t\"clientId\": \"XXX\",  \/\/ New Moderator's Client ID i.e. You\n\t\t\"raisedHands\":[],   \/\/ List of Client IDs requested Floor Access\n\t\t\"approvedHands\":[]  \/\/ List of Client IDs with Floor Access\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=\"..\/destroy-session\/\"><\/a><a href=\"..\/destroy-session\/\">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<a href=\"\/developer\/how-to-use\/\"><\/a><\/p>\n<\/div>\n<\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A Moderator can designate a connected Participant to act as a Moderator during the session. Doing so, the promoted Participant would get access to all the rights of the Moderator, i.e. accesses all features listed under Moderator Controls; and the old Moderator becomes a Participant. Similarly, the new Moderator can further grant Moderator Role to other participant if needed. Method:&nbsp;Enx.switchUserRole(clientId) Parameter:&nbsp;clientId&nbsp;\u2013 Client ID of the participant who is being designated&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3747,"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":"A Moderator can designate a connected Participant to act as a Moderator during the session. Doing so, the promoted Participant would get access to all the rights of the Moderator, i.e. accesses all features listed under Moderator Controls; and the old Moderator becomes a Participant. Similarly, the new Moderator can further grant Moderator Role to&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4638"}],"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=4638"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4638\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/3747"}],"wp:attachment":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/media?parent=4638"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}