{"id":4599,"date":"2021-11-30T15:59:23","date_gmt":"2021-11-30T07:59:23","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4599"},"modified":"2025-02-21T14:22:52","modified_gmt":"2025-02-21T06:22:52","slug":"active-talkers","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/react-native-toolkit\/active-talkers\/","title":{"rendered":"Active Talkers: React Native SDK &#8211; Video API"},"content":{"rendered":"\n<h4>Table of Contents<\/h4>\n\n\n\n<ul><li><a href=\"#active-talkers\">Handle Active Talkers<\/a> <ul><li><a href=\"#get-max-talkers\">Get maximum permissible Talker Count<\/a><\/li><li><a href=\"#get-talker-count\">Get Talker Count<\/a><\/li><li><a href=\"#set-talker-count\">Set Talker Count<\/a><\/li><\/ul><\/li><\/ul>\n\n\n\n<a name=\"active-talkers\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2>Handle Active Talkers<\/h2>\n\n\n\n<p>During a multi-party video conference, more server and Client-End-Point resources are consumed. Therefore, the portal sends only 6 streams of users actively talking (generating sound) in the <em>Room<\/em> to each end-point. Additionally, it sends 2 streams, viz. Screen Share (Stream# 11) and Canvas Stream (Stream# 21). <\/p>\n\n\n\n<p>On getting connected to Room, your Client End Point will also receive <code>streamAdded <\/code>Callback for all these 6+2 streams available in the Room.  You need to subscribe to each of these streams.<\/p>\n\n\n\n<p>Subsequently, whenever there is change in Talkers List, The portal sends out an updated Active Talkers List to each End Point. The list of Active-Talkers is available in JSON format and sent  through <code>activeTalkerList<\/code> callback.  The list of Active Talkers comprises a list of talkers in ascending order i.e. latest talker will be listed first. Therefore, you can expect to receive the event frequently in a noisy room.<\/p>\n\n\n\n<p><strong>Callback:<\/strong>   <code>activeTalkerList<\/code> &#8211; Comes with JSON given below:<\/p>\n\n\n\n<p><strong>Active Talkers List JSON<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">{    \"active\" : true,\n      \"activeList\": [\n           {   \"clientId\" : \"String\", \n               \"mediatype\" : \"audiovideo\", \/\/ Enum: audiovideo, audioonly\n               \"name\" : \"String\",\n               \"reason\" : \"user\",\n               \"streamId\" : Number,\n               \"videoaspectratio\" : \"16:9\", \n               \"videomuted\" : Boolean\n           }\n       ]\n   }<\/pre>\n\n\n\n<p>This Active Talkers JSON is used for managing the UI and to play audio and video streams from remote users. To play a specific stream, you need the Remote Stream object related to the&nbsp;<code>streamId<\/code>&nbsp;of a Talker. Please remember before you can play any stream from the Active Talkers list, you should have subscribed to all \u201cdummy\u201d streams  received through Callback <code>streamAdded<\/code>. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">activeTalkerList: event =&gt; {\n\tvar tempArray = [];\n        tempArray = event;\n   \tif (tempArray.length &gt; 0) {\n\t\tthis.setState({activeTalkerStreams: tempArray});\n        }\n\treturn (\n\t      &lt;View&gt;\n\t\t{this.state.activeTalkerStreams.map(function(element, index) {\n\t\t    return (\n\t\t      &lt;EnxPlayerView key={String(element.streamId)}\n\t\t\tstreamId={String(element.streamId)}\n\t\t\tstyle={{ width: width, height: height }}\/&gt;\n\t\t    );\n\t\t})}\n\t      &lt;\/View&gt;\n\t);\n}\n<\/pre>\n\n\n\n<p><strong>Note:<\/strong>  The local Stream will not &nbsp;be included in the Active Talkers JSON list sent to an End-Point even if the End Point is talking. Hence the Active Talker JSON list sent to different End Points varies. In case you need to play own stream, please use the local stream. <\/p>\n\n\n\n<a name=\"get-max-talkers\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3>Get maximum permissible Talker Count<\/h3>\n\n\n\n<p>To know maximum permissible Active Talkers that you may receive and you can set, you may use <code>Enx.getMaxTalkers()<\/code> method. <\/p>\n\n\n\n<p><strong>Method<\/strong>:  <code>Enx.getMaxTalkers()<\/code>  &#8211; without parameter <\/p>\n\n\n\n<p><strong>Callback<\/strong>:    <code>getMaxTalkersResponse <\/code><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Enx.getMaxTalkers();\n\ngetMaxTalkersResponse : event{\n     \/\/ event: { \"result\": 0, \"numTalkers\": 6 } \n}<\/pre>\n\n\n\n<a name=\"get-talker-count\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3>Get Talker Count<\/h3>\n\n\n\n<p>It may be necessary to know how many talkers are expected to receive with&nbsp;  <code>activeTalkerList<\/code>   Callback, i.e. to know either the preset value of talkers or any custom value in effect which is either by the Application Developer or opted by End-Point User.<\/p>\n\n\n\n<p><strong>Method<\/strong>:  <code>Enx.getTalkerCount()<\/code>  &#8211; without parameter<\/p>\n\n\n\n<p><strong>Callback<\/strong>:   <code>getTalkerCountResponse<\/code>  <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Enx.getTalkerCount();\n\ngetTalkerCountResponse : event{\n     \/\/ event: { \"result\": 0, \"numTalkers\": 6 } \n}<\/pre>\n\n\n\n<a name=\"set-talker-count\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3>Set Talker Count<\/h3>\n\n\n\n<p>The Portal sets a maximum of 6 active talkers in the active talker-list with\u00a0  <code>activeTalkerList<\/code>  Callback. However, you may opt to receive less talkers at a Client End Point if you so require. This may either be a predefined value, or this value may be set at run-time in a connected session. If required you can create UI for the connected user to opt for number of active-talkers the user wants to receive.<\/p>\n\n\n\n<p><strong>Method<\/strong>:   <code>Enx.setTalkerCount(numTalkers)<\/code>  <\/p>\n\n\n\n<p><strong>Parameters<\/strong>:&nbsp;<code>numTalkers&nbsp;<\/code>\u2013 No. of talkers you want to receive. Range 0-6<\/p>\n\n\n\n<ul><li>If you set&nbsp;<code>numTalkers&nbsp;<\/code>to any value from 1 to 6 \u2013 you will receive those many talkers in the list.<\/li><li>If you set&nbsp;<code>numTalkers&nbsp;<\/code>to 0 (zero), then list doesn\u2019t become empty. Rather, you would start receiving 3 audio streams only. Video Streams will not be carried.<\/li><\/ul>\n\n\n\n<p><strong>Callback<\/strong>:  <code>setTalkerCountResponse<\/code><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Enx.setTalkerCount(4);\n\nsetTalkerCountResponse : event{\n     \/\/ event: { \"result\": 0, \"numTalkers\": 4 } \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=\"..\/subscribing-remote-streams\/\"><\/a><a href=\"..\/subscribing-remote-streams\/\">Subscribe Remote Streams<\/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=\"..\/play-stream\/\">Play Stream<\/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>Table of Contents Handle Active Talkers Get maximum permissible Talker Count Get Talker Count Set Talker Count Handle Active Talkers During a multi-party video conference, more server and Client-End-Point resources are consumed. Therefore, the portal sends only 6 streams of users actively talking (generating sound) in the Room to each end-point. Additionally, it sends 2 streams, viz. Screen Share (Stream# 11) and Canvas Stream (Stream# 21). On getting connected to&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":"Table of Contents Handle Active Talkers Get maximum permissible Talker Count Get Talker Count Set Talker Count Handle Active Talkers During a multi-party video conference, more server and Client-End-Point resources are consumed. Therefore, the portal sends only 6 streams of users actively talking (generating sound) in the Room to each end-point. Additionally, it sends 2&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4599"}],"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=4599"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4599\/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=4599"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}