{"id":4173,"date":"2021-11-10T15:00:58","date_gmt":"2021-11-10T07:00:58","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4173"},"modified":"2022-04-11T18:18:49","modified_gmt":"2022-04-11T10:18:49","slug":"bitrate-status-of-client","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/web-toolkit\/bitrate-status-of-client\/","title":{"rendered":"Bitrate Status of Client: Web SDK &#8211; Video API"},"content":{"rendered":"\n<p><strong>Availability:<\/strong>&nbsp;<em>Web SDK v1.9.8+<\/em><\/p>\n\n\n\n<p>The&nbsp;<code>EnxRtc.clientBitrate()<\/code>&nbsp;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>&nbsp;<code>EnxRtc<\/code><\/p>\n\n\n\n<p><strong>Method:<\/strong>&nbsp;<code>EnxRtc.clientBitrate(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&nbsp;<\/code>\u2013 Optional. JSON object with Client preferences for the execution of test cases.<ul><li><code>region&nbsp;<\/code>\u2013 String. Region Id of ICE Server, e.g.&nbsp;<code>\"IN\", \"SG\", \"US\", \"DE\".<\/code>&nbsp;Default Region ID is \u201cDE\u201d.<\/li><\/ul><\/li><\/ul>\n\n\n\n<p><strong>Event Notifications:<\/strong><\/p>\n\n\n\n<ul><li><code>client-bitrate-finished<\/code>&nbsp;\u2013 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>client-bitrate-status<\/code>&nbsp;\u2013 Notification sent with the test results at the beginning and end of the test. This returns a JSON Object as the test result.<\/li><\/ul>\n\n\n\n<p><strong>Request for diagnostics:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">var clientInfo = {\n     region: 'IN'\n};\n\nlet client = EnxRtc.clientBitrate(clientInfo);\nclient.addEventListener(\"client-bitrate-status\", function(response) {\n     \/\/ handle info message from response.message\n});\n\nclient.addEventListener(\"client-bitrate-finished\", function(response) {\n     \/\/ handle json from response.message\n});<\/pre>\n\n\n\n<p><strong>Response at the beginning and end of Test:&nbsp;<\/strong><code>client-bitrate-status<\/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>&nbsp;<strong>Response:&nbsp;<\/strong><code>client-bitrate-finished<\/code><\/p>\n\n\n\n<pre 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:&nbsp;<\/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=\"..\/pre-call-test\/\"><\/a><a href=\"..\/pre-call-test\/\">Pre-Call Test<\/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=\"..\/take-image-snapshot\/\">Take Snapshot<\/a> \u2192 <\/p>\n<\/div>\n<\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Availability:&nbsp;Web SDK v1.9.8+ The&nbsp;EnxRtc.clientBitrate()&nbsp;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:&nbsp;EnxRtc Method:&nbsp;EnxRtc.clientBitrate(clientInfo) Parameters: clientInfo&nbsp;\u2013 Optional. JSON object with Client preferences for the execution of test cases. region&nbsp;\u2013 String. Region Id of&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":"Availability:&nbsp;Web SDK v1.9.8+ The&nbsp;EnxRtc.clientBitrate()&nbsp;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:&nbsp;EnxRtc Method:&nbsp;EnxRtc.clientBitrate(clientInfo) Parameters: clientInfo&nbsp;\u2013 Optional. JSON&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4173"}],"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=4173"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4173\/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=4173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}