{"id":4867,"date":"2021-12-10T18:28:11","date_gmt":"2021-12-10T10:28:11","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4867"},"modified":"2022-04-11T18:30:46","modified_gmt":"2022-04-11T10:30:46","slug":"floor-access-control","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/cordova-toolkit\/floor-access-control\/","title":{"rendered":"Floor Access Control: Cordova\/Ionic 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 are used to implement Floor Access Control 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&#8217;s request for floor access is forwarded to the Moderator using a notification event.<\/p>\n\n\n\n<p><strong>Method:<\/strong> <code>requestFloor()<\/code> &#8211; No parameter is needed. <\/p>\n\n\n\n<p><strong>Event Listeners:<\/strong> <\/p>\n\n\n\n<ul><li><code>onFloorRequested<\/code> &#8211; Acknowledgement sent to the requesting participant that her request has been received by Moderator<\/li><li><code>onFloorRequestReceived<\/code>&#8211; The Moderator receives requests from the participant<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ To request floor access\nwindow.EnxRtc.requestFloor();\n\n\/\/ Add Event Listeners\n\/\/ Your Request is received by Moderator.\nwindow.EnxRtc.addEventListner(\"onFloorRequested\",\nfunction\n(data)\n{\nconsole.log(JSON.stringify(data.data));\n});\n\n\/\/ Moderator receives floor access request\nwindow.EnxRtc.addEventListner(\"onFloorRequestReceived\",\n(data)\n{\nconsole.log(JSON.stringify(data.data));\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 the Moderator&#8217;s end.<\/p>\n\n\n\n<p><strong>Method:<\/strong>&nbsp;<code>cancelFloor() - <\/code>No Parameter is required<\/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 a previously posted Floor access request from the participant<\/li><li><code>onFloorCancelled<\/code> &#8211; Participant receives an acknowledgment that her request for Floor Request has been canceled.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ TO cancel request floor\nwindow.EnxRtc.cancelFloor();\n\n\/\/ Add Event Listeners\n\/\/ Participant is acknowledged that floor request is cancelled.\nwindow.EnxRtc.addEventListner(\"onFloorCancelled\",\nfunction\n(data)\n{\nconsole.log(JSON.stringify(data.data));\n});\n\n\/\/ Moderator receives cancellation floor request.\nwindow.EnxRtc.addEventListner(\"onCancelledFloorRequest\",\n(data)\n{\nconsole.log(JSON.stringify(data.data));\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>denyFloor( clientID )<\/code>&nbsp;<\/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 of the participant who has been denied floor access<\/li><\/ul>\n\n\n\n<p><strong>Event Listeners:<\/strong><\/p>\n\n\n\n<ul><li><code>onProcessFloorRequested<\/code> &#8211; Moderator is notified that she denied floor access to a Participant<\/li><li><code>onDeniedFloorRequest<\/code> \u2013 Participant is notified that she has been denied floor access<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ To deny floor access to a client id\nwindow.EnxRtc.denyFloor(clientID);\n\n\/\/ Add Event Listeners\n\/\/ Moderator notified when he denied floor access.\nwindow.EnxRtc.addEventListner(\"onProcessFloorRequested\",\n(data)\nfunction\n{\nconsole.log(JSON.stringify(data.data));\n});\n\n\/\/ Participant is notified that moderator is granted floor access.\nwindow.EnxRtc.addEventListner(\"onDeniedFloorRequest\",\n{\nfunction (data)console.log(JSON.stringify(data.data));\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>grantFloor( clientID )<\/code> <\/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>onProcessFloorRequested<\/code> &#8211; Moderator is acknowledged that Participant has been granted floor access<\/li><li><code>onGrantedFloorRequest<\/code> &#8211; Participant receives floor access<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ To grant floor access to a client id\nwindow.EnxRtc.grantFloor(clientID);\n\n\/\/ Add Event Listeners\n\/\/ Moderator granted floor access to a participant.\nwindow.EnxRtc.addEventListner(\"onProcessFloorRequested\",\n(data)\nfunction\n{\nconsole.log(JSON.stringify(data.data));\n});\n\n\/\/ Participant is notified that he is granted floor access.\nwindow.EnxRtc.addEventListner(\"onGrantedFloorRequest\",\n(data)\n{\nconsole.log(JSON.stringify(data.data));\nfunction});<\/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 end floor access granted to him by Moderator.<\/p>\n\n\n\n<p><strong>Method:&nbsp;<\/strong><code>finishFloor()&nbsp;<\/code>\u2013 Participant ends 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 ended floor access<\/li><li><code>onFloorFinished:&nbsp;<\/code>Participant receives acknowledgement that she ended floor access<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ To grant floor access to a client id\nwindow.EnxRtc.finishFloor();\n\n\/\/ Add Event Listeners\n\/\/ Participant receive acknowledgement that he ended floor access\nwindow.EnxRtc.addEventListner(\"onFloorFinished\",\nfunction (data)\nconsole.log(JSON.stringify(data.data));\n});\n\n\/\/ Moderator notified that granted floor access to a participant has ended.\n{window.EnxRtc.addEventListner(\"onFinishedFloorRequest\",\n(data)\nfunction\n{\nconsole.log(JSON.stringify(data.data));\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>releaseFloor( clientId )<\/code> <\/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 participant whose floor access is being released. <\/li><\/ul>\n\n\n\n<p><strong>Event Listeners:<\/strong><\/p>\n\n\n\n<ul><li><code>onProcessFloorRequested<\/code> &#8211;  Moderator is acknowledged that the floor is being released<\/li><li><code>onReleasedFloorRequest<\/code> &#8211; Participant is notified that floor access has been revoked. His stream is automatically unpublished.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ To release floor access to a client id\nwindow.EnxRtc.releaseFloor(clientID);\n\n\/\/ Add Event Listeners\n\/\/ Moderator notified when he released floor access.\nwindow.EnxRtc.addEventListner(\"onProcessFloorRequested\",\n(data)\n{\nconsole.log(JSON.stringify(data.data));\n});\nfunction\n\n\/\/ Participant is notified that moderator is released floor access.\nwindow.EnxRtc.addEventListner(\"onReleasedFloorRequest\", (data)\nfunction\n{\nconsole.log(JSON.stringify(data.data));\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=\"..\/configure-view\/\"><\/a><a href=\"..\/configure-view\/\">Configure View<\/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":3719,"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\/4867"}],"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=4867"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4867\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/3719"}],"wp:attachment":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/media?parent=4867"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}