{"id":4289,"date":"2021-11-15T19:26:50","date_gmt":"2021-11-15T11:26:50","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4289"},"modified":"2022-04-12T18:14:38","modified_gmt":"2022-04-12T10:14:38","slug":"play-stream","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/android-toolkit\/play-stream\/","title":{"rendered":"Play Stream: Android 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<ul><li><code>public void attachRenderer( EnxPlayerView  playerView)<\/code><\/li><\/ul>\n\n\n\n<p><strong>Parameter:<\/strong> playerView &#8211; A Player View Object<\/p>\n\n\n\n<p><strong>Method:<\/strong> To stop playing Stream<\/p>\n\n\n\n<ul><li><code>public void detachRenderer()<\/code>  &#8211; No Parameter required.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">EnxPlayerView playerView = new EnxPlayerView(\n Current-Class-Context, ScalingType, mediaOverlay);\n\nstream.attachRenderer(playerView);  \/\/ Attach stream to playerview to play\nyourCustomView.addView(playerView); \/\/ Add playerView to your view \n\nstream.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=\"\/developer\/video-api\/client-api\/android-toolkit\/receiving-video-quality\/\"><\/a><a href=\"\/developer\/video-api\/client-api\/android-toolkit\/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=\"..\/local-stream\/\"><\/a><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":3740,"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\/4289"}],"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=4289"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4289\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/3740"}],"wp:attachment":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/media?parent=4289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}