{"id":4624,"date":"2021-12-01T13:14:49","date_gmt":"2021-12-01T05:14:49","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4624"},"modified":"2025-02-21T13:41:15","modified_gmt":"2025-02-21T05:41:15","slug":"recording","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/react-native-toolkit\/recording\/","title":{"rendered":"Recording: React Native SDK &#8211; Video API"},"content":{"rendered":"\n<p>Using the portal you may get a RTC session recorded as individual streams and later be transcoded through a post-session service to create a single video file which can be retrieved and re-played using any Video Player. Recording can be started in 2 ways, viz. <\/p>\n\n\n\n<h4>Table of Contents<\/h4>\n\n\n\n<ul id=\"block-4d22c9e4-39ea-4986-bbda-aa6ecb672831\"><li><a href=\"#auto-recording\">Auto Recording<\/a><\/li><li><a href=\"#on-demand-recording\">On-Demand Recording<\/a><\/li><li><a href=\"#play\">Play Recorded File<\/a><\/li><\/ul>\n\n\n\n<a name=\"auto-recording\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3>Auto-Recording<\/h3>\n\n\n\n<p>You may define a room to start  recording automatically as and when a session starts in the room. You  may pass <code>{ settings: { auto_recording:  true }}<\/code> in the JSON Payload while  creating a room to ensure a session  is recorded automatically.  <\/p>\n\n\n\n<a name=\"on-demand-recording\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3>On-Demand Recording<\/h3>\n\n\n\n<p>Client API call helps you start and stop recording as and when needed. The available methods are accessible to Moderator only. Therefore, on the Moderator End-Point, you may require to create UI to use the methods to start or stop recording a session. <\/p>\n\n\n\n<p>To start session recording on demand you may use  <code>Enx.startRecord() <\/code>method, and to stop may use <code>Enx.stopRecord()<\/code> method. On successful initiation of recording and stopping of recording the moderator will be notified using  <code>startRecordingEvent<\/code>  and  <code>stopRecordingEvent<\/code>  callbacks; also, all other participant swill be notified using   <code>roomRecordingOn<\/code> and  <code>roomRecordingOff<\/code> Callbacks respectively.  <\/p>\n\n\n\n<p><strong>Methods:<\/strong><\/p>\n\n\n\n<ul><li><code>Enx.startRecord()<\/code> &#8211; No parameter needed. To start recording<\/li><li><code>Enx.stopRecord()<\/code> &#8211; No parameter needed. To stop recording <\/li><\/ul>\n\n\n\n<p><strong>Callbacks:<\/strong><\/p>\n\n\n\n<ul><li> <code>startRecordingEvent<\/code> &#8211; To moderator to notify that recording has started<\/li><li> <code>stopRecordingEvent<\/code> &#8211; To moderaor to notify that recording has stopped<\/li><li> <code>roomRecordingOn<\/code>  &#8211; To all participant to notify recording is on<\/li><li> <code>roomRecordingOff<\/code>  &#8211; To all participant to notify recording is off  <\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">Enx.startRecord(); \/\/ Start Recording\n\n\/\/ To moderator: Recording started\nstartRecordingEvent : event=&gt;{\n\t\/\/ event = { result: 0, msg: \u201csuccess\u201d}\n}\n\n\/\/ To participants: Recording started\nroomRecordingOn :event =&gt;{\n\t\/\/ event = { result: 0, msg: \"Room recording On\"}\n}\n\nEnx.stopRecord(); \/\/ Stop Recording\n\n\/\/ To moderator: Recording stopped\nstopRecordingEvent : event=&gt;{\n\t\/\/ event = { result : 0, msg : \u201csuccess\u201d}\n}\n\n\/\/ To participants: Recording stopped\nroomRecordingOff :event =&gt;{\n\t\/\/ event = { result: 0, msg: \"Room recording Off\"}\n}<\/pre>\n\n\n\n<p><strong>Note:<\/strong><\/p>\n\n\n\n<ul><li>Moderator can start\/stop recording any number of time during a session as he wishes.  <\/li><li>Moderator can stop recording in a room defined with auto-recording feature.    <\/li><\/ul>\n\n\n\n<p><strong>Refer<\/strong>: <strong><a href=\"\/developer\/video-api\/server-api\/archive-route\/\">How to fetch Recordings? <\/a><\/strong> <\/p>\n\n\n\n<a name=\"play\"><\/a>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3>Play a Recorded File<\/h3>\n\n\n\n<p>In case you want to play Recorded File directly from the video Server, please note that those files are password protected. Portal Implemented HTTP Basic Authentication to secure recorded file storage.<\/p>\n\n\n\n<p>Therefore, any Video Player, may not use the file-paths only to play them from Video Server. Player must provide access credentials to pass through the authentication process to play the file. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">npm install --save react-native-video\n\nvar username = 'Username';\nvar password = 'Password';\nvar videoFilePath = 'URL';\n\nvar basicAuth = ='Basic' + binaryToBase64(\n\tutf8.encode(username + ':' + password)\n);\n\n&lt;Video source={{\n\turi: videoFilePath,\n\theaders: {\n\t\t'Authorization': basicAuth\n\t}\n}}\n\nref={(ref) =&gt; {\n\tthis.player = ref\n}}\n\nonBuffer={this.onBuffer}                \nonError={this.videoError}\/&gt;<\/pre>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Note: <\/strong><\/p>\n\n\n\n<ul><li>There is an alternate way. You should download the files from Video Server to your Server and play from there without or with any security measure you may like to deploy. <\/li><li>Files from the portal Storage gets deleted after 72 hours. So, accessing them from Video Server to play is not guaranteed beyond 72 hours. <\/li><\/ul>\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=\"..\/annotation\/\"><\/a><a href=\"..\/annotation\/\">Annotation<\/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=\"..\/hard-muting\/\">Hard Muting<\/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>Using the portal you may get a RTC session recorded as individual streams and later be transcoded through a post-session service to create a single video file which can be retrieved and re-played using any Video Player. Recording can be started in 2 ways, viz. Table of Contents Auto Recording On-Demand Recording Play Recorded File Auto-Recording You may define a room to start recording automatically as and when a session&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":"Using the portal you may get a RTC session recorded as individual streams and later be transcoded through a post-session service to create a single video file which can be retrieved and re-played using any Video Player. Recording can be started in 2 ways, viz. Table of Contents Auto Recording On-Demand Recording Play Recorded File&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4624"}],"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=4624"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4624\/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=4624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}