Search code examples
chromecast

Chromecast new Cast.Api()


I just started using Chromecast SDK today and got bit confused with its APIs and samples given in the web.

What I am trying to do is to send some messages to the Chromecast so it will display them on the big screen. I am going to use Chrome API with HTML5/JS/CSS.

Most examples (https://github.com/pjjanak/chromecast-hello-world/blob/master/sender/index.html , http://nerdwin15.com/2013/10/chromecast-development-part-one-chrome-sender/) in the web uses new Cast.Api() in the sender and uses an Activity in doing so. But I could not find a reference to a Cast.Api in the Chrome API. Most Google references deal with Media and I am not sure whether I have to use them. So to sum up, following are the questions I have (Sorry! I did read the API and developer guide but I am still clueless).

  1. Do I have to write a custom receiver to show text on TV screen. Can't I survive default receiver, chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID
  2. Is handling multimedia files different from displaying text on the Chromecast or can I set the mime type to text/html and send a text stream (doesn't work for me at the moment)
  3. Are those examples on the web uses a deprecated way of sending data to chromecast?

Thanks in advance, Ish


Solution

  • Ok I think I found the answer from following documents,

    https://developers.google.com/cast/docs/receiver_apps

    https://github.com/googlecast/CastHelloText-chrome/blob/master/chromehellotext.html

    Will try them and let you all know!

    Following example page is very useful for anyone who try writing chromecast apps

    https://github.com/googlecast