{"id":4169,"date":"2021-11-09T20:05:10","date_gmt":"2021-11-09T12:05:10","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4169"},"modified":"2022-04-11T13:31:32","modified_gmt":"2022-04-11T05:31:32","slug":"room-mode-switch","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/web-toolkit\/room-mode-switch\/","title":{"rendered":"Room Mode Switch: Web 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=\"..\/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>Method:<\/strong> <code>EnxRoom.switchRoomMode(<code>roomMode<\/code>, callback)<\/code><\/p>\n\n\n\n<p><strong>Parameter:<\/strong><\/p>\n\n\n\n<ul><li><code><code>roomMode<\/code> - String. Enumerated values <code>lecture<\/code>, <code>group<\/code>. Use the mode to switch into.<\/code><\/li><\/ul>\n\n\n\n<p><strong>Event Notification:<\/strong><\/p>\n\n\n\n<ul><li><code>room-mode-switched<\/code> &#8211; Notification to everyone in the Room when the Room&#8217;s mode of operation is switched to the desired mode. <\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ To switch to group mode\nroom.room.switchRoomMode(\"group\", function (resp) {\n\tif (resp.result == 0) {\t\n\t\t\/\/ Success\n\t}\n});\n \n\/\/ Notification to all\nroom.addEventListener(\"room-mode-switched\", function (evt) {\n\t\/\/ evt is JSON, e.g.\n\t\/*\n\t{\n\t\t\"type\": \"room-mode-switched\",\n\t\t\"message\": {\n\t\t\t\"mode\": \"group\" \n\t\t}\n\t}\n\t*\/\n});\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=\"..\/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\/\">Break-Out Room<\/a> \u2192 <\/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":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":"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\/4169"}],"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=4169"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4169\/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=4169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}