{"id":5019,"date":"2021-12-21T19:14:51","date_gmt":"2021-12-21T11:14:51","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=5019"},"modified":"2022-04-12T18:34:13","modified_gmt":"2022-04-12T10:34:13","slug":"room-mode-switch","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/react-native-toolkit\/room-mode-switch\/","title":{"rendered":"Room Mode Switch: React Native SDK &#8211; Video API"},"content":{"rendered":"\n<p>A Room defined with either <code>group<\/code> or <code>lecture<\/code> mode, may be switched to the other mode at runtime, i.e. in an ongoing session. <code>Enx.switchRoomMode()<\/code> method is executed by moderator to switch to other mode instantly. <\/p>\n\n\n\n<p>When a room is switched from <code>group <\/code>to <code>lecture <\/code>mode:<\/p>\n\n\n\n<ul><li>All participant&#8217;s audio\/video streams are dropped from the room with a notification to each participants. <\/li><li>All the features of Lecture mode such as&nbsp;<a href=\"..\/floor-access-control\/\" target=\"_blank\" rel=\"noreferrer noopener\">Floor Access Control<\/a>&nbsp;are activated.<\/li><li>All active&nbsp;<a href=\"..\/break-out-room\/\" target=\"_blank\" rel=\"noreferrer noopener\">Break-Out Rooms<\/a>&nbsp;get terminated.<\/li><\/ul>\n\n\n\n<p>On the other hand, when a room is switched from <code>lecture <\/code>to <code>group<\/code> mode:<\/p>\n\n\n\n<ul><li>A notification is sent to each participant and allows them to publish own audio\/video streams into the room. <\/li><li>Due to privacy concern, SDK doesn&#8217;t automatically starts publishing audio\/video stream in such case, but Developers needs to take decision whether to publish automatically or to prompt participants to publish.<\/li><\/ul>\n\n\n\n<p><strong>Class:<\/strong> <code>Enx<\/code><\/p>\n\n\n\n<p><strong>Methods:<\/strong> <code>Enx.switchRoomMode(roomMode)<\/code><\/p>\n\n\n\n<p><strong>Parameters: <\/strong><\/p>\n\n\n\n<ul><li><code>roomMode<\/code> &#8211; String. Enumerated values <code>lecture<\/code>, <code>group<\/code>. Use the mode to switch into. <\/li><\/ul>\n\n\n\n<p><strong>Callbacks:<\/strong><\/p>\n\n\n\n<ul><li><code>ackSwitchedRoom<\/code> \u2013 Acknowledgment to the Moderator with status of the request.<\/li><li><code>roomModeSwitched<\/code> &#8211;&nbsp;Notification to everyone in the Room that the switch has been switch to the other mode.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">Enx.switchRoomMode(roomMode). \/\/To switch to group mode, mode=group\/lecture\n\nackSwitchedRoom:event=&gt;{\n \/\/ Moderator is acknowledged\n \n              }\nRoomModeSwitched:event=&gt;{\n \/\/ Everyone is notified\n \n              }<\/pre>\n\n\n\n<p><strong>Error Codes &amp; 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>5003<\/td><td>Unauthorized Access. When a user with <code>participant<\/code> role invokes <code>switchRoomMode()<\/code><\/td><\/tr><tr><td>5126<\/td><td>Invalid Room Mode<\/td><\/tr><tr><td>5086<\/td><td>Room is not connected<\/td><\/tr><tr><td>5136<\/td><td>Non-Contextual Method Call<\/td><\/tr><tr><td>1716 <\/td><td> Room is in <code>lecture <\/code>mode. Trying to switch to <code>lecture <\/code>mode being in <code>lecture <\/code>mode.  <\/td><\/tr><tr><td>1717<\/td><td>Room is in <code>group <\/code>mode. Trying to switch to <code>group <\/code>mode being in  <code>group <\/code> mode. <\/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=\"..\/spotlight-user\/\"><\/a><a href=\"..\/spotlight-user\/\">Spotlight<\/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=\"..\/floor-access-control\/\">Lecture Mode<\/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 Room defined with either group or lecture mode, may be switched to the other mode at runtime, i.e. in an ongoing session. Enx.switchRoomMode() method is executed by moderator to switch to other mode instantly. When a room is switched from group to lecture mode: All participant&#8217;s audio\/video streams are dropped from the room with a notification to each participants. All the features of Lecture mode such as&nbsp;Floor Access Control&nbsp;are&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 Room defined with either group or lecture mode, may be switched to the other mode at runtime, i.e. in an ongoing session. Enx.switchRoomMode() method is executed by moderator to switch to other mode instantly. When a room is switched from group to lecture mode: All participant&#8217;s audio\/video streams are dropped from the room with&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/5019"}],"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=5019"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/5019\/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=5019"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}