With Google releasing the Chromecast SDK I finally ordered one and sat down to solve the primary desire for such a device: streaming local content from your computer (running Ubuntu) to the Chromecast to play it on your TV. Starting with this sample project that Google kindly provided for developers I was able to create a python application that reads files from a specified folder and then creates a website (served by uwsgi and nginx) that can be used to select media and then cast/stream it to the Chromecast. I was able to get high quality content playing perfectly over the WiFi at approximately 650 kbps.
This solution does NOT require any hacking of the Chromecast, writing a new Chromecast application (it uses the default media receiver) or registering anything with the Google backend.
I have only been able to get mp3 and mp4 files to play. Specifically avi files do not play, probably because no browser supports avi in HTML5 video tags.
In Ubuntu simply clone the project and use the Makefile to install and deploy the solution:
and then to open the website navigate to http://localhost:3435 or simply issue make run.Code:git clone email@example.com:abid-mujtaba/local-chromecast.git cd local-chromecast sudo make install sudo make start
I modified the sample index.html to become a Jinja2 template and I wrote a simple python application script (intended to be served by uwsgi) to read the media sub-folder and use the Jinja2 template to place the media information in both the html and script sections. A socket is used to wrap nginx around the uwsgi and voila the pieces all come together.
Finally I wrote a makefile to automate the process of installing, configuring and deploying the servers (nginx and uwsgi) making it (pun intended) a relatively painless process to deploy.