{"id":4469,"date":"2021-11-23T20:00:18","date_gmt":"2021-11-23T12:00:18","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4469"},"modified":"2025-04-04T21:49:45","modified_gmt":"2025-04-04T13:49:45","slug":"local-stream","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/ios-toolkit\/local-stream\/","title":{"rendered":"Local Stream: iOS SDK &#8211; Video API"},"content":{"rendered":"\n<p>The&nbsp;<code>EnxRoom.getLocalStream()<\/code>&nbsp;method is used to initialize a local stream at the Client endpoint before it can be published to the Room. The initialization process comprises specifying media tracks, adding custom attributes, etc. in the form of a JSON object passed as a parameter to the method.<\/p>\n\n\n\n<p><strong>Class<\/strong>:&nbsp;<code>EnxRoom<\/code><\/p>\n\n\n\n<p><strong>Method<\/strong>:&nbsp;&#8211;<code>(EnxStream *)getlocalStream:(NSDictionary *)publishStreamInfo;<\/code><\/p>\n\n\n\n<p><strong>Parameters<\/strong>:\u00a0 <code>publishStreamInfo<\/code> \u2013 A JSON object with <a href=\"..\/..\/appendix\/#stream-options\">Local Stream Options<\/a> as given below:<\/p>\n\n\n\n<a name=\"publishStreamInfo\"><\/a>\n\n\n\n<pre class=\"wp-block-preformatted\">{\n     \"audio\": true,          \/\/ Whether to add Audio to stream\n     \"video\": true,          \/\/ Whether to add Video to stream\n     \"data\": true,           \/\/ Whether to add Data to stream\n     \"videoSize\":  {         \/\/ Video Frame Size - Deprecated in iOS SDK v2.0.1+\n           \"minWidth\": number, \n           \"minHeight\": number,  \n           \"maxWidth\": number,\n           \"maxHeight\": number\n       ), \n     \"audioMuted\": true,     \/\/ Audio muted on entry to room  \n     \"videoMuted\": true,     \/\/ Video muted on entry to room  \n     \"attributes\": {         \/\/ Object to carry custom data  \n         \"custom1\": \"\"\n      },\n      \"maxVideoBW\": number,  \/\/ Max Bandwidth - Deprecated in iOS SDK v2.0.1+\n      \"minVideoBW\": number   \/\/ Min Bandwidth - Deprecated in iOS SDK v2.0.1+\n } <\/pre>\n\n\n\n<p><strong>Error Codes \/ Exceptions:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Code<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>5015<\/td><td>Failed to initialize a Stream without Audio, Video, and Data track.<\/td><\/tr><tr><td>5016<\/td><td>Failed to initialize the Stream due to incorrect values of JSON Keys in <code>publishStreamInfo<\/code>.<\/td><\/tr><tr><td>5017<\/td><td>Unable to create Stream due to failure to access Camera and Microphone.<\/td><\/tr><tr><td>5018<\/td><td>Unable to create Video Stream due to failure to access Camera. Only Audio Stream created.<\/td><\/tr><tr><td>5019<\/td><td>Unable to create Stream due to failure to access Microphone.<\/td><\/tr><tr><td>5084<\/td><td>Invalid Video Layer. Max allowed Video Layers: 3.<\/td><\/tr><tr><td>5088<\/td><td>Invalid Frame Rate. Max allowed Frame Rate: 30.<\/td><\/tr><\/tbody><\/table><\/figure>\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=\"..\/get-devices\/\">Get Media Devices<\/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=\"..\/room-connection\/\"><\/a><a href=\"..\/room-connection\/\">Handle Room Connection<\/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>The&nbsp;EnxRoom.getLocalStream()&nbsp;method is used to initialize a local stream at the Client endpoint before it can be published to the Room. The initialization process comprises specifying media tracks, adding custom attributes, etc. in the form of a JSON object passed as a parameter to the method. Class:&nbsp;EnxRoom Method:&nbsp;&#8211;(EnxStream *)getlocalStream:(NSDictionary *)publishStreamInfo; Parameters:\u00a0 publishStreamInfo \u2013 A JSON object with Local Stream Options as given below: { &#8220;audio&#8221;: true, \/\/ Whether to add Audio&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3732,"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":"The&nbsp;EnxRoom.getLocalStream()&nbsp;method is used to initialize a local stream at the Client endpoint before it can be published to the Room. The initialization process comprises specifying media tracks, adding custom attributes, etc. in the form of a JSON object passed as a parameter to the method. Class:&nbsp;EnxRoom Method:&nbsp;&#8211;(EnxStream *)getlocalStream:(NSDictionary *)publishStreamInfo; Parameters:\u00a0 publishStreamInfo \u2013 A JSON object&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4469"}],"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=4469"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4469\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/3732"}],"wp:attachment":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/media?parent=4469"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}