{"id":4486,"date":"2021-11-24T13:16:50","date_gmt":"2021-11-24T05:16:50","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4486"},"modified":"2025-04-05T02:56:25","modified_gmt":"2025-04-04T18:56:25","slug":"recording","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/ios-toolkit\/recording\/","title":{"rendered":"Recording: iOS SDK &#8211; Video API"},"content":{"rendered":"\n<p>You can record an RTC session as individual streams and also get it transcoded through a post-session service to create a single composite video file that can be retrieved and replayed using any Video Player. You can configure the Room for auto-recording or invoke APIs to start recording when required. <\/p>\n\n\n\n<p>For details on fetching recorded sessions, refer to <strong><a href=\"\/developer\/video-api\/server-api\/archive-route\/\">How to fetch Recordings?<\/a><\/strong><\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h4>Table of Contents<\/h4>\n\n\n\n<ul><li><a href=\"#auto-recording\">Auto Recording<\/a><\/li><li><a href=\"#on-demand-recording\">On-Demand Recording<\/a><\/li><li><a href=\"#live-recording\">New Way to Record Live with an UI<\/a><ul><li><a href=\"#auto-live-recording\">Auto Live Recording<\/a><\/li><li><a href=\"#on-demand-live-recording\">On-Demand Live Recording<\/a><\/li><li><a href=\"#error-codes\">Error Codes<\/a><\/li><\/ul><\/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 can configure a Room with <code>{ settings: { auto_recording: true }}<\/code> during <a href=\"\/developer\/video-api\/server-api\/rooms-route\/#create-room\" target=\"_blank\" rel=\"noreferrer noopener\">Room Creation<\/a> to automatically start recording the RTC session taking place in the Room. The Moderator can still stop recording in a Room with Auto-Recording by utilizing the <a href=\"\/developer\/video-api\/client-api\/android-toolkit\/recording\/#on-demand-recording\"><code>stopRecord()<\/code><\/a> method given below.<\/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>The <code>EnxRoom.startRecord() <\/code>method allows the Moderator to start recording the session and <code>EnxRoom.stopRecord()<\/code> method is used to stop recording. You might need to provide these options on UI for the Moderator to access them. <\/p>\n\n\n\n<p>There is no limit to the number of times a Moderator can start\/stop recording.<\/p>\n\n\n\n<p><strong>Class: <\/strong><code>EnxRoom<\/code><\/p>\n\n\n\n<p><strong>Methods:<\/strong><\/p>\n\n\n\n<ul><li><code>- (void)startRecord<\/code> &#8211; No parameter required. <\/li><li><code>- (void)stopRecord<\/code> &#8211; No parameter required. <\/li><\/ul>\n\n\n\n<p><strong>Delegate Methods:<\/strong><\/p>\n\n\n\n<ul><li> <code>- startRecordingEvent<\/code> &#8211; Acknowledgment to the Moderator when recording starts.<\/li><li> <code>- stopRecoedingEvent<\/code> &#8211; Acknowledgment to the Moderator when recording stops.<\/li><li> <code>- roomRecordOn<\/code> &#8211; Notification to all the participants when the recording is turned on.<\/li><li> <code>- roomRecordOff<\/code> &#8211; Notification to all the participants when the recording is turned off.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">[room startRecord]; \/\/ To start recording\n\n\/\/ To all participants that recording has started\n-(void)roomRecordOn:(NSArray*)Data{\n\t\/* Data is \n\t[\t{\n\t\t\t\"msg\":\"Room Recording On\",\n\t\t\t\"result\":\"0\"\n\t\t},\n\t\t\"&lt;null&gt;\"\n\t]\n\t*\/\n}\n\n\/\/ To acknowledge the moderator that recording has started\n-(void)startRecordingEvent:(NSArray *)response{\n\t\/* response is \n\t[\t{\n\t\t\t\"result\":0,\n\t\t\t\"msg\":\"Success\"\n\t\t},\n\t\t\"&lt;null&gt;\"\n\t]\n\t*\/\n}\n\n\n[room stopRecord]; \/\/ To stop recording\n\n\/\/ To all participants that recording has stopped\n -(void)roomRecordOff:(NSArray*)Data{\n\t\/*Data is \n\t[\t{\n\t\t\t\"msg\":\"Room Recording Off\",\n\t\t\t\"result\":\"0\"\n\t\t},\n\t\t\"&lt;null&gt;\"\n\t]\n\t*\/\n}\n\n\/\/ To acknowledge the moderator that recording has stopped\n-(void)stopRecordingEvent:(NSArray *)response{\n\t\/* response is \n\t[\t{\n\t\t\t\"result\":0,\n\t\t\t\"msg\":\"Success\"\n\t\t},\n\t\t\"&lt;null&gt;\"\n\t]\n\t*\/\n}<\/pre>\n\n\n\n<p><strong>Error Codes &amp; 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>5007<\/td><td>Unauthorized Access. When a participant tries to invoke <code>startRecord()<\/code>.<\/td><\/tr><tr><td>5008<\/td><td>Unauthorized Access. When a participant tries to invoke <code>stopRecord()<\/code>.<\/td><\/tr><tr><td>5033<\/td><td>Repeated <code>startRecord()<\/code> call while the previous request is in process.<\/td><\/tr><tr><td>5034<\/td><td>Repeated <code>startRecord()<\/code> call while the recording has already started.<\/td><\/tr><tr><td>5035<\/td><td>Repeated <code>stopRecord()<\/code> call while the previous request is in process.<\/td><\/tr><tr><td>5036<\/td><td><code>stopRecord()<\/code> call without starting to record. Non-Contextual method call.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>Note:<\/strong> In case of error, &lt;null&gt; is received at 1st Index, and Error Info at 2nd Index.  <\/p>\n\n\n\n<a name=\"live-recording\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2>New Way to Record Live with an UI<\/h2>\n\n\n\n<p><strong>Availabiity:<\/strong> v2.1.2+<\/p>\n\n\n\n<p>Recording Live refers to a new process of creating a transcoded file in a live session with a custom layout without having to record individual streams. So, using Live Recording has double advantage:<\/p>\n\n\n\n<ul><li>You get a transcoded file within minutes post session. Not to wait longer alike previous transcoding process.<\/li><li>You have an option to define your own layout for the live recording process unlike previous transcoding process that creates in a predefined layout.<\/li><\/ul>\n\n\n\n<a name=\"auto-live-recording\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3>Auto Live Recording<\/h3>\n\n\n\n<p>You can configure a Room with to start Live Recording automatically as soon as the first person joing the Room. This may be done while creating a Room with the following settings:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\"settings\": { \n\t\"live_recording\": {\n\t\t\"auto_recording: true, \n\t\t\"url\": \"https:\/\/your-custom-view-url\"\n\t}\n}<\/pre>\n\n\n\n<ul><li>Know more about <a href=\"\/developer\/video-api\/server-api\/rooms-route\/#create-room\">Room Creation Payload<\/a> using our Video API. <\/li><li>Know how to <a href=\"#\">create Custom View for Live Recording<\/a>. Its the same way as we create View for Live Streaming. <\/li><\/ul>\n\n\n\n<p>Moderator can still stop live recording in a Room  by using  the&nbsp;<a rel=\"noreferrer noopener\" href=\"#on-demand-recording\" target=\"_blank\"><code>stopRecord()<\/code><\/a>&nbsp;method.<\/p>\n\n\n\n<a name=\"on-demand-live-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 Live Recording<\/h3>\n\n\n\n<p>Using SDK methods, a Moderator can start \/ stop live recording any time as he demands. The&nbsp;<code>EnxRoom.startLiveRecording()&nbsp;<\/code>method allows the Moderator to start live recording the session  and <code>EnxRoom.stopLiveRecording()<\/code> stops it. <\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h4>Start Live Recording<\/h4>\n\n\n\n<p><strong>Class:<\/strong>&nbsp;<code>EnxRoom<\/code><\/p>\n\n\n\n<p><strong>Method<\/strong>:&nbsp;<code>-(void)startLiveRecording:(NSDictionary *_Nonnull)streamingConfig;<\/code><\/p>\n\n\n\n<p><strong>Parameter:<\/strong><\/p>\n\n\n\n<p><code>streamingConfig<\/code>: Streaming configuration. <\/p>\n\n\n\n<p><strong><strong>Callback<\/strong>:<\/strong><\/p>\n\n\n\n<ul><li><code>didACKStartLiveRecording<\/code> &#8211; Acknowledgment callback to the Moderator when the Live Recording starts.<\/li><li><code>didRoomLiveRecordingOn<\/code> &#8211; Notification to all users  in the conference that the Live Recording has started.<\/li><li><code>didRoomLiveRecordingFailed<\/code>&#8211; Notification to the users that recording failed to start or failed later after getting started.<\/li><li><code>didRoomLiveRecordingUpdated<\/code> &#8211; Intermediate Notifications  to all users with updates on the Live-Recording start request.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">[enxRoom startLiveRecording: streamingConfig]; \n\n\n-(void)room:(EnxRoom* _Nullable)room didACKStartLiveRecording:(NSArray *_Nullable)data {\n \/\/ To the Moderator - Live Recording has started\n}\n\n-(void)room:(EnxRoom* _Nullable)room didRoomLiveRecordingOn:(NSArray *_Nullable)data {\n \/\/ To all the participants - Live Recording started\n}\n\n-(void)room:(EnxRoom* _Nullable)room didRoomliverecordingFailed:(NSArray*_Nullable)data {\n \/\/ To the executor of Method - Live Recording failed to start\n}\n\n-(void)room:(EnxRoom* _Nullable)room didRoomliverecordingUpdated:(NSArray*_Nullable)data {\n \/\/ To the executor of Method - Intermediate updates on the start recording progress\n}\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>5086<\/td><td>Endpoint application is not connected to the Room.<\/td><\/tr><tr><td>5097<\/td><td>Start Live Recording methods are not available in the Chat-Only Room.<\/td><\/tr><tr><td>5138<\/td><td>Failed to Start Live Recording with invalid configuration parameter.<\/td><\/tr><tr><td>5122<\/td><td>Start Live Recording is in progress. Retrying to Start Live Recording is illegible.<\/td><\/tr><tr><td>5139<\/td><td>Live Recording is already running. Retrying to Start Live Recording is illegible.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<a name=\"stop-live-recording\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3>Stop Live Recording<\/h3>\n\n\n\n<p>The&nbsp;<code>EnxRoom.stopLiveRecording()<\/code>&nbsp;method is used to stop live recording.<\/p>\n\n\n\n<p><strong>Class:<\/strong> <code>EnxRoom<\/code><\/p>\n\n\n\n<p><strong>Method<\/strong>:&nbsp;<\/p>\n\n\n\n<ul><li>For iOS SDK v2.1.2 &#8211; <code>-(void)stopLiveRecording:(NSDictionary *_Nonnull)streamingConfig;<\/code><\/li><\/ul>\n\n\n\n<p><strong>Parameter:<\/strong><\/p>\n\n\n\n<p><code>streamingConfig<\/code>: Optional. Streaming configuration. <\/p>\n\n\n\n<ul><li>For iOS SDK v2.1.3+ &#8211; <code>-(void)stopLiveRecording;<\/code><\/li><\/ul>\n\n\n\n<p><strong><strong>Callback<\/strong>:<\/strong><\/p>\n\n\n\n<ul><li><code>didACKStopLiveRecording<\/code> \u2013 Acknowledgment callback to the Moderator when the Live Recording stops.<\/li><li><code><code><code>didRoomLiveRecordingOff<\/code> <\/code><\/code>&#8211; Notification to all the participants in the conference that the Live Recording has stopped.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">[enxRoom stopLiveRecording:streamingConfig];         \/\/ For v2.1.2\n[enxRoom stopLiveRecording];                         \/\/ For v2.1.3+\n\n\n-(void)room:(EnxRoom* _Nullable)room didACKStopLiveRecording:(NSArray *_Nullable)data {\n \/\/ To the Moderator - Live Recording has stopped\n}\n\n-(void)room:(EnxRoom* _Nullable)room didRoomliverecordingOff:(NSArray*_Nullable)data {\n \/\/ To all the participants - Live Recording stopped\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>5086<\/td><td>Endpoint application is not connected to the Room.<\/td><\/tr><tr><td>5097<\/td><td>Start Live Recording methods are not available in the Chat-Only Room.<\/td><\/tr><tr><td>5138<\/td><td>Failed to Start Live Recording with invalid configuration parameter passed.<\/td><\/tr><tr><td>5122<\/td><td>Start Live Recording is in progress. Retrying to Start Live Recording is illegible.<\/td><\/tr><tr><td>5140<\/td><td>Live Recording is not running in the room. To Stop Live Recording is illegible.<\/td><\/tr><tr><td>5141<\/td><td>Stop Live Recording is in progress. Retrying to Stop Live Recording is illegible.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<a name=\"error-codes\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h4>Error Codes<\/h4>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Live Recording <strong><strong>Waiting Queue<\/strong><\/strong> <\/strong> <\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Error<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>7039<\/td><td>Live recording request was in waiting, successfully removed the request from waiting<\/td><\/tr><tr><td>7046<\/td><td>Streaming request was in waiting, successfully removed the request from waiting<\/td><\/tr><tr><td>7080<\/td><td>Live recording\/streaming request in waiting queue failed to start<\/td><\/tr><tr><td>7081<\/td><td>Live recording\/streaming request in waiting queue failed to start<\/td><\/tr><tr><td>7104 <\/td><td>Streaming request is in waiting, will be started soon <\/td><\/tr><tr><td>7105 <\/td><td>Last streaming request is in waiting <\/td><\/tr><tr><td>7207<\/td><td>Live Recording request is in waiting, will be started soon<\/td><\/tr><tr><td>7208<\/td><td>Last live Recording request is in waiting<\/td><\/tr><\/tbody><\/table><\/figure>\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 Video Server, please note that those files are password protected. The 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 the 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\">let headerString = \u201cUSERNAME:PASSWORD\u201d \nlet videoFileURL = \"URL\"\n\nlet data = headerString.data(using: .utf8)\nlet basicAuth = \u201cBasic\u201d + date!.base64EncodedString(\n\toptions: NSData.Base64EncodingOptions(rawValue: 0))\nlet headers = {\u201cAuthorization\u201d : basicAuth }\n\nlet asset = AVURLAsset(\n\turl: videoFileURL, \n\toptions: {\n\t\t\"AVURLAssetHTTPHeaderFieldsKey\" : headers\n\t}\n)\n\nlet playerItem = AVPlayerItem(asset: asset)\nplayer = AVPlayer(playerItem: item)<\/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 the 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\/\">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>You can record an RTC session as individual streams and also get it transcoded through a post-session service to create a single composite video file that can be retrieved and replayed using any Video Player. You can configure the Room for auto-recording or invoke APIs to start recording when required. For details on fetching recorded sessions, refer to How to fetch Recordings? Table of Contents Auto Recording On-Demand Recording New&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":"You can record an RTC session as individual streams and also get it transcoded through a post-session service to create a single composite video file that can be retrieved and replayed using any Video Player. You can configure the Room for auto-recording or invoke APIs to start recording when required. For details on fetching recorded&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4486"}],"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=4486"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4486\/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=4486"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}