{"id":4204,"date":"2021-11-11T14:50:16","date_gmt":"2021-11-11T06:50:16","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4204"},"modified":"2025-04-05T02:30:48","modified_gmt":"2025-04-04T18:30:48","slug":"bitrate-status-of-client","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/android-toolkit\/bitrate-status-of-client\/","title":{"rendered":"Bitrate Status of Client: Android SDK &#8211; Video API"},"content":{"rendered":"\n<p><strong>Availability:<\/strong> <em>Android  SDK v1.9.8+<\/em><\/p>\n\n\n\n<p>The <code>EnxRtc.clientBitrate()<\/code> method provides bitrate status of the Client. It carries out the following tests to generate a response:<\/p>\n\n\n\n<ul><li><strong>Bandwidth<\/strong><ul><li>Video bandwidth with TURN server<\/li><li>Audio bandwidth with TURN Server<\/li><\/ul><\/li><\/ul>\n\n\n\n<p>You can also build a UI to initiate the tests and generate a diagnostic report using this API.<\/p>\n\n\n\n<p><strong>Class:<\/strong> <code>EnxRtc<\/code><\/p>\n\n\n\n<p><strong>Observer:<\/strong> <code>public void setEnxClientBitrateObserver( EnxClientBitrateObserver-Object )<\/code><\/p>\n\n\n\n<p><strong>Method:<\/strong> <code>public void clientBitrate(JSONObject clientInfo)<\/code><\/p>\n\n\n\n<p><strong>Parameters:<\/strong> <\/p>\n\n\n\n<ul id=\"block-e5f9f797-a887-4336-b9d2-1bd071f28fa8\"><li><code>ClientInfo <\/code>\u2013 Optional. JSON object with Client preferences for the execution of test cases.<ul><li><code>region: <\/code>String. Region Id of ICE Server, e.g. <code>\"IN\", \"SG\", \"US\", \"DE\".<\/code> Default Region ID is &#8220;DE&#8221;.<\/li><\/ul><\/li><\/ul>\n\n\n\n<p><strong>Callbacks:<\/strong><\/p>\n\n\n\n<ul><li><code style=\"background-color: rgb(255, 255, 255);\">onClientBitrateFinished<\/code> &#8211; Notification sent when the API has completed the execution of the test case. This returns a JSON Object as the final result.<\/li><li><code>onClientBitrateStatus<\/code>  &#8211; Notification sent with the test results at the beginning and end of the test.   This returns a JSON Object as the test result. <\/li><li><code>onClientBitrateFailed<\/code> &#8211; Notification sent when the test fails.<\/li><\/ul>\n\n\n\n<p><strong>Request for diagnostics: <\/strong><\/p>\n\n\n\n<pre id=\"block-4a221594-c2ed-481b-a1da-8be8dbc78504\" class=\"wp-block-preformatted\">setEnxClientBitrateObserver( EnxClientBitrateObserver-Object );\n\n var clientInfo = {\n     region: 'IN'\n};\n\nEnxRtc.clientBitrate(clientInfo);\n \n\/\/ Called when test fails\npublic void onClientBitrateStatus(JSONObject jsonObject) {\n\t\/\/ JSON brings in error information\n}\n\n\/\/ Called when test starts and ends\npublic void onClientBitrateStatus (JSONObject jsonObject) {\n\t\/\/  JSON structure explained later in the document\n}\n\n\/\/ Called when test finishes\npublic void onClientBitrateFinished(JSONObject jsonObject) {\n\t\/\/  JSON structure explained later in the document\n}<\/pre>\n\n\n\n<p><strong>Response at the beginning and end of Test: <\/strong><code>onClientBitrateStatus<\/code> <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/Status at the start of test \n{\n  \"status\": \"started\",\n  \"test_case\": \"video_bandwidth\",\n  \"test_group\": \"bandwidth\",\n  \"test_region\": \"IN\",\n  \"test_server\": \"TURN\"\n}\n\n\/\/ Status at the end of test\n{\n  \"test_group\": \"bandwidth\",\n  \"test_case\": \"video_bandwidth\",\n  \"status\": \"finished\",\n  \"output\": {\n    \"video_bandwidth\": {\n      \"result\": \"success\",\n      \"bandwidth_bps\": 2221949,\n      \"packets_lost_percentage\": \"0.99\",\n      \"execution_time\": \"31566 ms\",\n      \"success\": [],\n      \"error\": [],\n      \"warning\": [],\n      \"info\": [],\n      \"server\": {\n        \"region\": \"IN\",\n        \"url\": \"turns:ts.enablex.io:443\"\n      }\n    }\n  },\n  \"test_region\": \"IN\",\n  \"test_server\": \"TURN\"\n}<\/pre>\n\n\n\n<p><strong>Final<\/strong> <strong>Response: <\/strong><code>onClientBitrateFinished<\/code><\/p>\n\n\n\n<pre id=\"block-a9888e28-99bd-4b09-91f6-4ce0f56653d1\" class=\"wp-block-preformatted\">{\n  \"video\": {\n    \"bitrate_bps\": 2221949,\n    \"connection\": \"stable\"\n  },\n  \"audio\": {\n    \"bitrate_bps\": 278067,\n    \"connection\": \"stable\"\n  }\n}<\/pre>\n\n\n\n<p><strong>Test Result Explanation<\/strong>:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Test Group<\/th><th>Test Case<\/th><th>Server<\/th><th>Result<\/th><th>Message<\/th><\/tr><\/thead><tbody><tr><td>Bandwidth<\/td><td>Video Bandwidth<\/td><td>TURN <\/td><td>Success<\/td><td>Video resolution: Width x Height<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><td>Failure<\/td><td>Camera failure: Width x Height. Cannot <br>test bandwidth without a working camera<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><td>Subject to quality<\/td><td>Average Video bandwidth &lt;value&gt;<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><td>Subject to quality<\/td><td>Packets lost: &lt;value&gt;<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><td>Subject to quality<\/td><td>RTT Average: &lt;value&gt;<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><td>Failure<\/td><td>getUserMedia() failed with error &lt;error&gt;<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><td>Failure<\/td><td>Frame Rate mean is 0, cannot <br>test bandwidth without a working camera<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><td>Failure<\/td><td>Only Firefox and Chrome <br>getStats() implementations are supported<\/td><\/tr><tr><td><\/td><td>Audio Bandwidth<\/td><td>TURN<\/td><td>Subject to quality<\/td><td>Average Audio bandwidth &lt;value&gt;<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><td>Subject to quality<\/td><td>Packets lost: &lt;value&gt;<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><td>Subject to quality<\/td><td>RTT Average: &lt;value&gt;<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><td>Failure<\/td><td>getUserMedia() failed with error &lt;error&gt;<\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><td>Failure<\/td><td>Only Firefox and Chrome <br>getStats() implementations are supported<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>Note: <\/strong>Currently this API is not working for Firefox and safari browser.<\/p>\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=\"..\/adjust-layout\/\"><\/a><a href=\"..\/adjust-layout\/\">Adjust Layout<\/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=\"..\/audio-only-mode\/\">Audio Only Mode<\/a> \u2192<\/p>\n<\/div>\n<\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Availability: Android SDK v1.9.8+ The EnxRtc.clientBitrate() method provides bitrate status of the Client. It carries out the following tests to generate a response: Bandwidth Video bandwidth with TURN server Audio bandwidth with TURN Server You can also build a UI to initiate the tests and generate a diagnostic report using this API. Class: EnxRtc Observer: public void setEnxClientBitrateObserver( EnxClientBitrateObserver-Object ) Method: public void clientBitrate(JSONObject clientInfo) Parameters: ClientInfo \u2013 Optional. JSON&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":"Availability: Android SDK v1.9.8+ The EnxRtc.clientBitrate() method provides bitrate status of the Client. It carries out the following tests to generate a response: Bandwidth Video bandwidth with TURN server Audio bandwidth with TURN Server You can also build a UI to initiate the tests and generate a diagnostic report using this API. Class: EnxRtc Observer:&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4204"}],"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=4204"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4204\/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=4204"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}