{"id":4606,"date":"2021-11-30T19:28:46","date_gmt":"2021-11-30T11:28:46","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4606"},"modified":"2022-04-08T18:50:00","modified_gmt":"2022-04-08T10:50:00","slug":"publishing-local-stream","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/react-native-toolkit\/publishing-local-stream\/","title":{"rendered":"Publishing Local Stream: React Native SDK &#8211; Video API"},"content":{"rendered":"\n<p>The local stream with audio and video needs to be initiated and published into the Room for other participants to see and hear you.  <code>Enx.publish()&nbsp;<\/code>method is used to publish a local stream to the connected Room. After the local stream is published to the Room, all participants are notified with an callback named&nbsp;&nbsp;<code>streamAdded<\/code>. <\/p>\n\n\n\n<p><strong>Method<\/strong>: <code>Enx.publish()<\/code><\/p>\n\n\n\n<p><strong>Callbacks:<\/strong><\/p>\n\n\n\n<ul><li><code>streamPublished<\/code> &#8211; To the publisher that the stream has been published <\/li><li><code>eventError<\/code> &#8211; To  the publisher to notify that publishing has failed<\/li><li><code>streamAdded<\/code> &#8211; To all participants announcing new stream in room<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">roomConnected:event=&gt;{\n\tEnx.publish();\t\/\/ Publish Stream\n}\n\nstreamPublished:event=&gt;{\n\t\/\/ To publisher - Stream has been published \n}\n\neventError : event=&gt;{\n\t\/\/ To publisher - Failed to publish\n}\n\nstreamAdded:event=&gt;{\n\t\/\/ To others - New stream is added\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=\"..\/room-connection\/\">Room Connection<\/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=\"..\/switch-camera-mic-speaker\/\">Switch Camera, Mic, Speaker<\/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 local stream with audio and video needs to be initiated and published into the Room for other participants to see and hear you. Enx.publish()&nbsp;method is used to publish a local stream to the connected Room. After the local stream is published to the Room, all participants are notified with an callback named&nbsp;&nbsp;streamAdded. Method: Enx.publish() Callbacks: streamPublished &#8211; To the publisher that the stream has been published eventError &#8211; 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":"The local stream with audio and video needs to be initiated and published into the Room for other participants to see and hear you. Enx.publish()&nbsp;method is used to publish a local stream to the connected Room. After the local stream is published to the Room, all participants are notified with an callback named&nbsp;&nbsp;streamAdded. Method: Enx.publish()&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4606"}],"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=4606"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4606\/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=4606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}