{"id":4351,"date":"2021-11-17T20:55:50","date_gmt":"2021-11-17T12:55:50","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4351"},"modified":"2025-04-05T02:44:57","modified_gmt":"2025-04-04T18:44:57","slug":"screen-share","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/ios-toolkit\/screen-share\/","title":{"rendered":"Screen Share: iOS SDK &#8211; Video API"},"content":{"rendered":"\n<h3>Table of Contents<\/h3>\n\n\n\n<ul><li><a href=\"#start-share\">Start Screen Share<\/a><\/li><li><a href=\"#stop-share\">Stop Screen Share<\/a><\/li><li><a href=\"#exit-screen-share\">Exit Screen Sharing<\/a><\/li><li><a href=\"#force-stop-share\">Force Stop other\u2019s Screen Share<\/a><\/li><\/ul>\n\n\n\n<p>To support Screen-Sharing in the Room, you need to enable Screen-Sharing during <a href=\"\/developer\/video-api\/server-api\/rooms-route\/#create-room\" target=\"_blank\" rel=\"noreferrer noopener\">Room Creation<\/a> by setting: <code>{ \"screen_share\": true; })<\/code> in the JSON Payload. To receive Shared Screen, you need to subscribe to the Screen-Share Stream ID# 101 and play it on the Video Player.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<a name=\"start-share\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3>Start Screen Sharing<\/h3>\n\n\n\n<p>The&nbsp;<code>EnxRoom.startScreenShare()<\/code>&nbsp;method is used to create a Screen-Sharing Stream @ 6fps to publish in the Room.&nbsp;Screen Sharing continues even when the Application runs in the background.<\/p>\n\n\n\n<p><strong>Class<\/strong>: EnxRoom<\/p>\n\n\n\n<p><strong>Methods<\/strong>: <code> - (void) startScreenShare<\/code> &#8211; To start Share<\/p>\n\n\n\n<p><strong>Delegate Methods: <\/strong><\/p>\n\n\n\n<ul><li><code>-didStartBroadCast<\/code>:  Broadcast extension class receives this callback method when publishing the Screen Stream<\/li><li><code>-didStartScreenShareACK<\/code>: This is acknowledgement to the end point whern screen stream starts.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">[enxRoom startScreenShare];\n\n\/\/ Broadcast extension class receives this callback \n\/\/ method when publishing the Screen Stream\n\n-(void)didStartBroadCast:(NSArray *)data {\n\n}\n\n\/\/ Acknowledgement to the end point whern screen stream starts.\n\n-(void)room:(EnxRoom *)room didStartScreenShareACK:(NSArray *)Data {\n\n}<\/pre>\n\n\n\n<p> [<a href=\"\/developer\/video\/solutions\/ios-share-share\/\">Know more&#8230;<\/a>] <\/p>\n\n\n\n<a name=\"stop-share\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3>Stop Screen Sharing<\/h3>\n\n\n\n<p>The <code>EnxRoom.stopScreenShare()<\/code>&nbsp;method is used to stop the ongoing Screen-Sharing. <\/p>\n\n\n\n<p><strong>Class:<\/strong> EnxRoom<\/p>\n\n\n\n<p><strong>Methods<\/strong>: <code> -(void) stopScreenShare<\/code> &#8211; To stop Share<\/p>\n\n\n\n<p><strong>Delegate Methods: <\/strong><\/p>\n\n\n\n<ul><li><code>-didStoppedBroadCast<\/code>:  Broadcast extension class receives this callback method when unpublishing the Screen Stream<\/li><li><code>-didStopScreenShareACK<\/code>: This is acknowledgement to the end point whern screen stream stops.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">[enxRoom stopScreenShare ];\n\n\/\/ Broadcast extension class receives this callback \n\/\/ method when unpublishing the Screen Stream\n\n-(void) didStoppedBroadCast:(NSArray *)data {\n\n}\n\n\/\/ Acknowledgement to the end point whern screen stream stops\n\n-(void)room:(EnxRoom *)room didStopScreenShareACK:(NSArray *)Data {\n\n}\n <\/pre>\n\n\n\n<p> [<a href=\"\/developer\/video\/solutions\/ios-share-share\/\">Know more&#8230;<\/a>] <\/p>\n\n\n\n<a name=\"exit-screen-share\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3>Exit Screen Sharing<\/h3>\n\n\n\n<p>The <code>EnxRoom.exitScreenShare()<\/code>&nbsp;method is used to notify the Screen Share Broadcast Extension to exit from the ongoing Session. This is required to be called as Broadcast Extension is a different target from the main target.<\/p>\n\n\n\n<p><strong>Class:<\/strong> EnxRoom<\/p>\n\n\n\n<p><strong>Method:<\/strong> <code>-(void)exitScreenShare<\/code><\/p>\n\n\n\n<p><strong>Delegate Methods:<\/strong><\/p>\n\n\n\n<ul id=\"block-5e7c0dbc-1b1c-4e11-9259-7d28d09f7022\"><li><code>-didExitScreenShareACK: <\/code>Acknowledgment callback at the parent end point executed the method.<\/li><li>&#8211; <code>didRequestedExitRoom:<\/code> Notification received by the child client (screen share client). As the screen share client receives this callback, they initiate to stop the broadcast and disconnect from the room.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">[enxRoom exitScreenShare];\n\n\/\/ Notification received by the child client (screen share client)\n\n-(void)didRequestedExitRoom:(NSArray *_Nullable)Data {\n\n}\n\n\/\/ Acknowledgment callback for the parent client\n\n-(void)room:(EnxRoom *_Nullable)room didExitScreenShareACK:(NSArray *_Nullable)Data {\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>5137<\/td><td>Screen Share is not running in conference<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>[<a href=\"\/developer\/video\/solutions\/ios-share-share\/\">Know more&#8230;<\/a>]<\/p>\n\n\n\n<a name=\"force-stop-share\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3>Force Stop other&#8217;s Screen Sharing<\/h3>\n\n\n\n<p><strong>Availability:<\/strong> iOS SDK 2.1.2+ <\/p>\n\n\n\n<p>If moderator wishes to force stop any ongoing Screen Share by other user in the Room, he can do so by using <code>EnxRoom.stopAllSharing()<\/code> method. Note, this is Moderator exclusive feature, can&#8217;t be executed from Participant&#8217;s end point.<\/p>\n\n\n\n<p>This method also force stops any ongoing Canvas Streaming.<\/p>\n\n\n\n<p><strong>Class:<\/strong> <code>EnxRoom<\/code><\/p>\n\n\n\n<p><strong>Observer<\/strong>: <code>ACK CallBack<\/code><\/p>\n\n\n\n<p><strong>Method:<\/strong> <code>-(void)stopAllSharing<\/code> <\/p>\n\n\n\n<p><strong>Callbacks:<\/strong><\/p>\n\n\n\n<ul><li>&#8211; <code>didACKStopAllSharing<\/code> &#8211; Notification to everyone in the Room when Screen-Sharing stops.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">[enxRoom stopAllSharing];\n\n-(void)room:(EnxRoom *_Nullable)room didStopAllSharingACK:(NSArray *_Nullable)data {\n\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=\"..\/file-share\/\">File Sharing<\/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=\"..\/canvas-streaming\/\">Canvas Streaming<\/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>Table of Contents Start Screen Share Stop Screen Share Exit Screen Sharing Force Stop other\u2019s Screen Share To support Screen-Sharing in the Room, you need to enable Screen-Sharing during Room Creation by setting: { &#8220;screen_share&#8221;: true; }) in the JSON Payload. To receive Shared Screen, you need to subscribe to the Screen-Share Stream ID# 101 and play it on the Video Player. Start Screen Sharing The&nbsp;EnxRoom.startScreenShare()&nbsp;method is used to create&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":"Table of Contents Start Screen Share Stop Screen Share Exit Screen Sharing Force Stop other\u2019s Screen Share To support Screen-Sharing in the Room, you need to enable Screen-Sharing during Room Creation by setting: { \"screen_share\": true; }) in the JSON Payload. To receive Shared Screen, you need to subscribe to the Screen-Share Stream ID# 101&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4351"}],"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=4351"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4351\/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=4351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}