{"id":4755,"date":"2021-12-06T21:12:48","date_gmt":"2021-12-06T13:12:48","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4755"},"modified":"2022-04-11T19:15:12","modified_gmt":"2022-04-11T11:15:12","slug":"floor-access-control","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/flutter-toolkit\/floor-access-control\/","title":{"rendered":"Floor Access Control: Flutter SDK &#8211; Video API"},"content":{"rendered":"\n<p>In Lecture Mode, only the Moderator publishes a stream to the room whereas all other participants subscribe to see and listen to the Moderator. If participants have questions to ask during the session, the Moderator can grant the floor to the participant to publish his stream.<\/p>\n\n\n\n<h4>Table of Contents<\/h4>\n\n\n\n<ul><li><a href=\"#request-floor-access\">Request Floor Access<\/a><\/li><li><a href=\"#cancel-floor-access\">Cancel Requested Floor Access<\/a><\/li><li><a href=\"#deny-floor-access\">Deny Floor Access <\/a><\/li><li><a href=\"#grant-floor-access\">Grant Floor Access<\/a><\/li><li><a href=\"#finish-floor-access\">Finish Granted Floor Access<\/a> <\/li><li><a href=\"#release-floor-access\">Release granted Floor Access<\/a><\/li><\/ul>\n\n\n\n<p>The following steps to deploy Control Floor Access by moderator:<\/p>\n\n\n\n<a name=\"request-floor-access\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3> Request Floor Access <\/h3>\n\n\n\n<p>A participant requests for Floor access is forwarded to the Moderator using a notification event.<\/p>\n\n\n\n<p><strong>Method:<\/strong> <code>static Future&lt;void&gt; requestFloor()<\/code> &#8211; No parameter needed. Participant requests floor access<\/p>\n\n\n\n<p><strong>Event Listners:<\/strong> <\/p>\n\n\n\n<ul><li><code>onFloorRequestReceived<\/code>&#8211; The Moderator receives requests from Participant<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">EnxRtc.requestFloor(); \/\/ Request Floor Access\n\nEnxRtc.onFloorRequestReceived= (Map&lt;dynamic, dynamic&gt; map) {\n\t \/\/ Moderator receives floor access request \n\t\/\/ map is { \"clientId\": \"XXXX\", \"name\": \"iOS\" }\n};<\/pre>\n\n\n\n<a name=\"cancel-floor-access\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3>Cancel Requested Floor Access<\/h3>\n\n\n\n<p>A participant may cancel his request for Floor access which is pending at Moderator Side.<\/p>\n\n\n\n<p><strong>Method:<\/strong>&nbsp;<code>static Future&lt;void&gt; cancelFloor() - <\/code>Participant cancels request floor access<\/p>\n\n\n\n<p><strong>Event Listeners<\/strong>:&nbsp;<\/p>\n\n\n\n<ul><li><code>onCancelledFloorRequest: <\/code> Moderator receives cancellation notification for already posted Floor Access Request from Participant<\/li><li><code>onFloorCancelled:<\/code> Participant receives acknowledgement that his request for Floor Request has been cancelled.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">EnxRtc.cancelFloor(); \/\/ Request Floor Cancellation\n\nEnxRtc.onCancelledFloorRequest= (Map&lt;dynamic, dynamic&gt; map) {\n\t\/\/ Moderators are notified about Request Cancellation\n};\n\nEnxRtc.onFloorCancelled= (Map&lt;dynamic, dynamic&gt; map) {\n\t\/\/ Participant is notified about cancelled request\n};<\/pre>\n\n\n\n<a name=\"deny-floor-access\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3>Deny Floor Access<\/h3>\n\n\n\n<p>The Moderator may also deny a request for floor access to a participant.<\/p>\n\n\n\n<p><strong>Class<\/strong>:&nbsp;<code>EnxRoom<\/code><\/p>\n\n\n\n<p><strong>Method:&nbsp;<\/strong><code>static Future&lt;void&gt; denyFloor(String clientId)<\/code>&nbsp;\u2013 Moderator denies floor access to a Participant<\/p>\n\n\n\n<p><strong>Parameters<\/strong>:&nbsp;<code> <\/code><\/p>\n\n\n\n<ul><li><code>@param String clientId<\/code> &#8211; Client id to deny floor.<\/li><\/ul>\n\n\n\n<p><strong>Event Listeners:<\/strong><\/p>\n\n\n\n<ul><li><code>onDeniedFloorRequest<\/code> \u2013 Participant is notified that he has been denied floor access<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">EnxRtc. denyFloor(\u2018clientId\u2019); \/\/ To deny floor request to CLientId\n\nEnxRtc.onDeniedFloorRequest= (Map&lt;dynamic, dynamic&gt; map) {\n\t\/\/ Notification to the User that he floor access request is denied\n\t\/\/ map = { \"result\":4117,\"msg\":\"Floor Request Denied\",\"clientId\":\"XXX\" }\n};\n<\/pre>\n\n\n\n<a name=\"grant-floor-access\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3>Grant Floor Access <\/h3>\n\n\n\n<p>Moderator might grant floor access to one or many users  one by one. Note that at any given point of time, only one person may be   granted floor access. To grant access to others, moderator must  release  floor access from the participant who is currently granted floor  access.  Once granted floor access, the designated participant will be  notified  using an event and he can publish his stream.  <\/p>\n\n\n\n<p><strong>Method: <\/strong><code>static Future&lt;void&gt; grantFloor(String clientId)<\/code> &#8211; moderator grants floor access to participant <\/p>\n\n\n\n<p><strong>Parameters:<\/strong><\/p>\n\n\n\n<ul><li><code>@param String clientId<\/code> &#8211; Client ID of the User whom Floor Access is being granted.<\/li><\/ul>\n\n\n\n<p><strong>Event Listeners:<\/strong> <\/p>\n\n\n\n<ul><li><code>onGrantFloorRequest<\/code> &#8211; Participant receives floor access<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">EnxRtc.grantFloor(\u2018clientId\u2019); \/\/ To grant floor access to ClientId\n\nEnxRtc.onGrantedFloorRequest= (Map&lt;dynamic, dynamic&gt; map) {\n   \/\/ Participant is notified that Floor Access is granted\n   \/\/ map =  { \"result\":1708,\"msg\":\"Floor Granted\",\"clientId\":\"XXX\" }\n};\n\n<\/pre>\n\n\n\n<a name=\"finish-floor-access\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3>Finish Granted Floor Access<\/h3>\n\n\n\n<p>The Participant can finish floor access granted to him by Moderator.<\/p>\n\n\n\n<p><strong>Class<\/strong>:&nbsp;<code>EnxRoom<\/code><\/p>\n\n\n\n<p><strong>Method:&nbsp;<\/strong><code>static Future&lt;void&gt; finishFloor()&nbsp;<\/code>\u2013 Participant finishes his granted Floor Access<\/p>\n\n\n\n<p><strong>Event Listeners: <\/strong><\/p>\n\n\n\n<ul><li><code>onFinishedFloorRequest:&nbsp;<\/code>Moderator receives notification that participant has finish granted Floor Access himself.<\/li><li><code>onFloorFinished:&nbsp;<\/code>Participant receives acknowledgement that he finished granted Floor Access.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">EnxRtc.finishFloor(); \/\/ To finish floor request\n\nEnxRtc.onFinishedFloorRequest= (Map&lt;dynamic, dynamic&gt; map) { \n\t\/\/ Moderator is notified that participant has\n\t\/\/ finished Floor Access himself\n\t\/* map is {\n\t\tmsg = Success;\n\t\trequest =     {\n\t\t    id = processFloorRequest;\n\t\t    params =         {\n\t\t\taction = finishFloor;\n\t\t\tclientId = \"ClentID\";\n\t\t    };\n\t\t};\n\t\tresult = 0;\n\t    }\n\t  *\/\n};\n\nEnxRtc. onFloorFinished= (Map&lt;dynamic, dynamic&gt; map) {\n\t\/\/ Participant is notified that floor access is finished\n};\n<\/pre>\n\n\n\n<a name=\"release-floor-access\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3>Release Floor Access <\/h3>\n\n\n\n<p>Moderator may terminate floor access granted to some participant. Upon termination, the user\u2019s stream(s) is unpublished. It is necessary to terminate floor access of a participant before giving out floor access to another participant.<\/p>\n\n\n\n<p><strong>Method: <\/strong><code>static Future&lt;void&gt; releaseFloor(String clientId)<\/code> \u2013 Moderator asks participant to release floor<\/p>\n\n\n\n<p><strong>Parameters<\/strong>: <\/p>\n\n\n\n<ul><li><code>@param String clientId<\/code> &#8211; Client id white floor access is being  released. <\/li><\/ul>\n\n\n\n<p><strong>Event Listners:<\/strong><\/p>\n\n\n\n<ul><li><code>onReleasedFloorRequest  <\/code>&#8211; Participant i notified that floor access has been revoked. His stream is automatically unpublished.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">EnxRtc.releaseFloor(\u2018clientId\u2019); \/\/ Floor is released from clientId\n\nEnxRtc.onReleasedFloorRequest = (Map&lt;dynamic, dynamic&gt; map) {\n\t\/\/ To notify participant that Floor Access is released\n\t\/\/ map = { \"result\":1712,\"msg\":\"Floor released\",\"clientId\":\"XXX\" }\n};\n<\/pre>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3> Restore Moderator Session <\/h3>\n\n\n\n<p>In case the Moderator is disconnected during a session, the list of received floor requests and participant currently with floor access can be retrieved when connection is restored to the room in the Room-Meta-Data viz.<\/p>\n\n\n\n<p><strong>Structured Data JSON<\/strong><\/p>\n\n\n\n<ul><li><code>room.getRoomMetaData().getJSONArray(\"raisedHands\")<\/code><em>\u2013 An Array of Client Information who requested floor-access<\/em><\/li><li><code>room.getRoomMetaData().getJSONArray(\"approvedHands\") <\/code> \u2013 <em>An Array of Client-Information who currently has floor access<\/em> <\/li><\/ul>\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\/\">Session Extension &amp; Closure<\/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=\"..\/live-media-statistics\/\"><\/a><a href=\"..\/live-media-statistics\/\">Get Live Media Statistics<\/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>In Lecture Mode, only the Moderator publishes a stream to the room whereas all other participants subscribe to see and listen to the Moderator. If participants have questions to ask during the session, the Moderator can grant the floor to the participant to publish his stream. Table of Contents Request Floor Access Cancel Requested Floor Access Deny Floor Access Grant Floor Access Finish Granted Floor Access Release granted Floor Access&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3755,"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":"In Lecture Mode, only the Moderator publishes a stream to the room whereas all other participants subscribe to see and listen to the Moderator. If participants have questions to ask during the session, the Moderator can grant the floor to the participant to publish his stream. Table of Contents Request Floor Access Cancel Requested Floor&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4755"}],"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=4755"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4755\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/3755"}],"wp:attachment":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/media?parent=4755"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}