Please visit the site for complete tutorials and more resources for Chromecast programming!
Note: This is part of a multi-part series on developing web applications that integrate Google's Chromecast SDK. I am working on making a complete resource for web development with the Chromecast, so consider this a pre-release version and please comment if you see any issues or have recommendations on how to improve the tutorial.
Part 1 - Introduction
Part 2 - Getting Started
Part 3 - Hello World
Part 4 - Your Own First App
On July 24th, 2013, Google released a small, thumb-drive sized HDMI device that quickly leapt to the top-seller charts on Amazon and many other shopping sites. The device, a $35 piece of hardware, was designed to bring the world of online streaming media to the television. The Chromecast solved the issue of using an HDMI cable from a laptop connected to a television simply to watch YouTube and other videos.
At first, the device was relatively limited, only supporting playback via Netflix as well as various Google properties such as YouTube and Google Play Music. Support for “casting” a tab through Chrome, as well as the entire desktop through a plugin, was added, but many users reported poor performance. This stemmed from the fact that, when a supported site (such as YouTube) was cast, the Chromecast played the file directly; yet when the tab itself was cast, the user’s computer acted as a web server, streaming the content to the device.
Despite working natively with YouTube, Netflix, and a small handful of other sites, the Chromecast did not work easily with other sites with video. This often led to sluggish performance as users attempted to cast a Flash video playing on a website to the Chromecast via the “Cast Tab” feature. A number of Android apps were developed that attempted to fix casting issues, but none were supported by Google and they broke often as the underlying APIs changed.
After several months, Google finally released an officially supported API to allow developers to integrate casting into their websites directly. Now, users of the site could cast the content directly to the device, bypassing the “Cast Tab” requirements. Additionally, Android and iOS SDKs were released to allow developers the ability to integrate Chromecast support directly into their applications.
Google has released a web, Android, and iOS SDK to allow direct communication with the Chromecast. This guide focuses solely on web development for the Chromecast. I do not have enough Android or iOS development experience to make a practical guide for those platforms, but hopefully some of the techniques provided here can be used interchangeably.