{"id":4436,"date":"2021-11-22T19:52:53","date_gmt":"2021-11-22T11:52:53","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4436"},"modified":"2022-04-08T18:57:54","modified_gmt":"2022-04-08T10:57:54","slug":"play-stream","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/ios-toolkit\/play-stream\/","title":{"rendered":"Play Stream: iOS SDK &#8211; Video API"},"content":{"rendered":"\n<p>You can play a local stream and all subscribed remote streams including screen-share, canvas streams within <code>EnxPlayerView <\/code>Object. Therefore,  you need to create an Object of  <code>EnxPlayerView <\/code>  Class and then attach the Stream to Player View using <code>EnxStream.attachRenderer()<\/code> method. <\/p>\n\n\n\n<p>To stop playing a Stream, detach the Stream from PlayerView using <code>EnxStream.detachRenderer()<\/code>.<\/p>\n\n\n\n<p><strong>Class<\/strong>: <\/p>\n\n\n\n<ul><li><code>EnxPlayerView<\/code> &#8211; To initiate a Player View object.<\/li><li><code>EnxStream <\/code>&#8211; To attach the Stream to the Player View<\/li><\/ul>\n\n\n\n<p><strong>Method:<\/strong> To play Stream<\/p>\n\n\n\n<p><code>- (void)attachRenderer :(EnxPlayerView*)ObjEnxPlayerView;<\/code><\/p>\n\n\n\n<p><strong>Parameter:<\/strong>  <code>ObjEnxPlayerView <\/code>&#8211; A Player View Object<\/p>\n\n\n\n<p><strong>Method<\/strong>: To stop playing Stream <\/p>\n\n\n\n<p><code>- (void)detachRenderer;<\/code>  <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ To Initialize Local Stream Player View Object \nEnxPlayerView *playerView = [[EnxPlayerView alloc] initLocalView:(CGRect)];\n\n\/\/ To Initialize Remote Stream Player View Object \n\/\/ EnxPlayerView *playerView  = [[EnxPlayerView alloc] initRemoteView:(CGRect)];\n \n[stream attachRenderer:PlayerView]; \/\/ Attach stream to playerview to play\n[yourCustomView addSubview:PlayerView]; \/\/ Add playerView to your view\n\n[stream detachRenderer]; \/\/ Detach Renderer to stop playing<\/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=\"..\/receiving-video-quality\/\">Set Desired Video Quality<\/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=\"..\/stream-information\/\">Know Your Stream<\/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 play a local stream and all subscribed remote streams including screen-share, canvas streams within EnxPlayerView Object. Therefore, you need to create an Object of EnxPlayerView Class and then attach the Stream to Player View using EnxStream.attachRenderer() method. To stop playing a Stream, detach the Stream from PlayerView using EnxStream.detachRenderer(). Class: EnxPlayerView &#8211; To initiate a Player View object. EnxStream &#8211; To attach the Stream to the Player View&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 play a local stream and all subscribed remote streams including screen-share, canvas streams within EnxPlayerView Object. Therefore, you need to create an Object of EnxPlayerView Class and then attach the Stream to Player View using EnxStream.attachRenderer() method. To stop playing a Stream, detach the Stream from PlayerView using EnxStream.detachRenderer(). Class: EnxPlayerView &#8211; To&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4436"}],"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=4436"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4436\/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=4436"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}