{"id":18011,"date":"2015-03-18T09:57:40","date_gmt":"2015-03-18T04:27:40","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=18011"},"modified":"2015-03-18T09:57:40","modified_gmt":"2015-03-18T04:27:40","slug":"google-cast-ready-to-cast-2","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/google-cast-ready-to-cast-2\/","title":{"rendered":"Google Cast &#8211; Ready to Cast"},"content":{"rendered":"<p>Google Cast is an emerging technology that enables a multi-screen experience to users. It is a screen-sharing technology that allows users to send and control content from their computing devices such as laptops, tablets and smartphones to their TVs screens.<\/p>\n<p>In this blog, we will take you through few steps to begin with the Cast session. The important point to remember is that when you are about to begin the Cast session, both the sender\u2019s and receiver\u2019s devices should be connected to the same WiFi.<\/p>\n<p><span class=\"highlight\">There are two ways users can start a Cast session:<\/span><br \/>\n<strong>1. Connect &amp; Play:<\/strong> As the name suggests, one needs to connect to the Cast receiver first before playing the content.<br \/>\n<strong>2.<\/strong> <strong>Play &amp; Connect:<\/strong> In this the content gets played first and the user connects to the Cast receiver later.<\/p>\n<p><span class=\"highlight\">Few Requirements:<\/span><br \/>\n<strong>1.<\/strong> Minimum Android SDK version that the Cast SDK supports is 9 (GingerBread)<br \/>\n<strong>2.<\/strong> Cast application development involves development of Sender and Receiver applications.<br \/>\n<strong>3.<\/strong> Package require: com.google.android.gms.cast<br \/>\n<strong>4.<\/strong> You need to register your application in order to get application ID (which will be used in both \u201csender\u201d and \u201creceiver\u201d applications).<br \/>\n<strong>5.<\/strong> Register your Google Cast device so that it may access your receiver application before you publish it.<br \/>\n<strong>6.<\/strong> It can take up to 6 hours to publish your receiver app.<\/p>\n<p><span class=\"highlight\">Developing Sender App:<\/span><br \/>\n<strong>1.<\/strong> Classes used:<\/p>\n<ul>\n<li>MediaRouter<\/li>\n<li>MediaRouteSelector<\/li>\n<li>Cast<\/li>\n<li>CastDevice<\/li>\n<li>GoogleApiClient<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong>2.<\/strong> Create empty Android application and add the following libraries as dependencies:<\/p>\n<p>[java]android-sdk\\extras\\android\\support\\v7\\appcompat<br \/>\nandroid-sdk\\extras\\android\\support\\v7\\mediarouter<br \/>\nandroid-sdk\\extras\\google\\google_play_services\\libproject\\google-play-services_lib[\/java]<\/p>\n<p><strong>3.<\/strong> meta-data element is required in Manifest:<\/p>\n<p>[java]&lt;meta-data<br \/>\nandroid:name=&quot;com.google.android.gms.version&quot;<br \/>\nandroid:value=&quot;@integer\/google_play_services_version&quot; \/&gt;[\/java]<\/p>\n<p><strong>4.<\/strong> Application\u2019s theme:<\/p>\n<p>[java]android:theme=&quot;@style\/Theme.AppCompat&quot;[\/java]<\/p>\n<p><strong>5.<\/strong> Adding the Cast Button:<\/p>\n<p>[xml]&lt;menu xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;<br \/>\nxmlns:app=&quot;http:\/\/schemas.android.com\/apk\/res-auto&quot; &gt;<br \/>\n&lt;item\u00a0\u00a0\u00a0 android:id=&quot;@+id\/media_route_menu_item&quot;<br \/>\nandroid:title=&quot;@string\/media_route_menu_title&quot;<br \/>\napp:actionProviderClass=&quot;android.support.v7.app.MediaRouteActionProvider&quot;<br \/>\napp:showAsAction=&quot;always&quot;\/&gt;<br \/>\n&lt;\/menu&gt;[\/xml]<\/p>\n<p><span class=\"highlight\">Developing Receiver App:<\/span><br \/>\nChromecast is the device which can run the special form of Web Application called \u201cReceiver\u201d<\/p>\n<p><span class=\"highlight\">Functions of Receiver Application:<\/span><br \/>\n<strong>1.<\/strong> An interface to display the app&#8217;s content is provided.<br \/>\n<strong>2.<\/strong> To control the content (messages) on the receiver device from the sender application.<br \/>\n<strong>3.<\/strong> It handles custom messages from the sender application that are application-specific<\/p>\n<p><span class=\"highlight\">Types of Receiver Application:<\/span><br \/>\n<strong>1.<\/strong> <strong>Custom Receiver:<\/strong><br \/>\nThe content such as an image gallery or game the app would require DRM, or requires support for media types. You host an HTML 5 app on your servers using the JavaScript Receiver API.<\/p>\n<p><strong>2.<\/strong> <strong>Styled Media Receiver:<\/strong><br \/>\nGoogle hosted a Pre-built receiver application which is designed for streaming audio and\u00a0\u00a0 video content.<\/p>\n<p><strong>3.<\/strong> <strong>Default Media Receiver:<\/strong><br \/>\nYou don\u2019t have to register with the Google Cast SDK Developer Console, and you cannot customise any of the UI.<\/p>\n<p><span class=\"highlight\">Default Media Reciever ID:<\/span><br \/>\nCastMediaControlIntent.DEFAULT_MEDIA_RECEIVER_APPLICATION_ID<\/p>\n<p><span class=\"highlight\">Technical Details:<\/span><br \/>\n<strong>1.<\/strong> Same WiFi network is to be used for both sender and receiver device.<br \/>\n<strong>2.<\/strong> Media Player Library supported types: PlayReady, Widevine.<br \/>\n<strong>3.<\/strong> Optimized android apps: Youtube, Netflix, Google Music, Google Movies.<br \/>\n<strong>4.<\/strong> Audio formats that support are MP3, Vorbis, Wav.<br \/>\n<strong>5.<\/strong> Streaming protocols: MP4, WebM are validated.<br \/>\n<strong>6.<\/strong> Image formats that support are BMP, GIF, JPEG, PNG, WEBP.<br \/>\n<strong>7.<\/strong> Download the Google Cast Extension for Crome browser.<\/p>\n<p><span class=\"highlight\">Limitations:<\/span><br \/>\n<strong>1.<\/strong> Cast Device is with memory, CPU and GPU limitations and it is also a low-power device so the receiver application.<br \/>\n<strong>2.<\/strong> In Receiver app we cannot create Tabs, windows or popups, and there should be nothing on the receiver device screen requiring input. All the interaction is to be done through a sender application.<br \/>\n<strong>3.<\/strong> Only one video will be active at a time.<br \/>\n<strong>4.<\/strong> Video compositing, manipulation, transformations, rotations or zooming are not supported.<\/p>\n<p>Hope this was useful to the readers.<\/p>\n<p><strong>Happy Casting !!!<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Google Cast is an emerging technology that enables a multi-screen experience to users. It is a screen-sharing technology that allows users to send and control content from their computing devices such as laptops, tablets and smartphones to their TVs screens. In this blog, we will take you through few steps to begin with the Cast [&hellip;]<\/p>\n","protected":false},"author":167,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":2},"categories":[518],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/18011"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/167"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=18011"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/18011\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=18011"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=18011"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=18011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}