{"id":4327,"date":"2021-11-16T21:09:00","date_gmt":"2021-11-16T13:09:00","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4327"},"modified":"2022-04-12T18:10:20","modified_gmt":"2022-04-12T10:10:20","slug":"room-mode-switch","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/android-toolkit\/room-mode-switch\/","title":{"rendered":"Room Mode Switch: Android 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>EnxRoom.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=\"\/developer\/video-api\/client-api\/android-toolkit\/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>EnxRoom<\/code><\/p>\n\n\n\n<p><strong>Observer: <\/strong><code>EnxSwitchRoomObserver&nbsp;<\/code><\/p>\n\n\n\n<p><strong>Methods:<\/strong><code> <\/code><code>public void switchRoomMode(String 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>onAckSwitchedRoom<\/code>&nbsp;\u2013 Acknowledgment to the Moderator with status of the request.<\/li><li><code>onRoomModeSwitched <\/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\">enxRoom.setEnxSwitchRoomObserver(this); \n \nenxRoom.switchRoomMode(\"group\");\t\/\/ To switch to group mode\n\n\/\/ Moderator is acknowledged\npublic void onAckSwitchedRoom(JSONObject jsonobject){ \n\n\t\/* JSONObject example: \n\t{\n\t  \"result\": 1715,\n\t  \"moderator\": \"String\",\n\t  \"msg\": \"Room switched to lecture mode\",\n\t  \"mode\": \"lecture\"\n\t}\n\t*\/\n}\n\n\/\/ Everyone is notified\npublic void onRoomModeSwitched(JSONObject jsonObject){ \n\n\t\/* JSONObject example: \n\t{\n\t  \"result\": 1715,\n\t  \"moderator\": \"String\",\n\t  \"msg\": \"Room switched to lecture mode\",\n\t  \"mode\": \"lecture\"\n\t}\n\t*\/\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\/\">Spotlight User<\/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=\"..\/break-out-room\/\"><\/a><a href=\"..\/break-out-room\/\">Break-Out Room<\/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. EnxRoom.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":3740,"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. EnxRoom.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\/4327"}],"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=4327"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4327\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/3740"}],"wp:attachment":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/media?parent=4327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}