Programming the ChromeCast with Xamarin

ChromeCast Notes

I guess I got under the wire with the Netflix deal, so the net cost of the thing was \\(11. Even at \\)35, it's a no-brainer for a developer to pick up and see if they can target.


Very good OOBE: plug it in to HDMI port, power via USB, and… yeah, that works. Setup via iOS didn't work for me (hung), so I set it up via Chrome on laptop: fine.

Add extension to Chrome, can "cast" any single tab. Works great with Comedians in Cars Getting Coffee. Integrated is better, though: very easy to watch Netflix and cue up next issue of "Breaking Bad, Season 5" (they've just released, dontcha' know). YouTube app was a little confusing.

Local files cast from Chrome

Mixed bag. Worked well with raw GoPro MP4s, but not my QuickTime output Content On This Page Is Not Supported. Some MKVs played fine, others didn't have sound (DTS not supported?).

Photos cast perfectly, but obviously would benefit from a native app.


The one that jumps out is, of course, "DLNA -> Cast." This would presumably require setting up an auto-transcode to supported formats. Would be best with an XPlat mobile controller: use iOS, Android, or Computer to select files on DLNA server. ? Is there a barebones DLNA library / app that could be hacked?

"It's not a slide projector, it's a time machine…" Photo browser.

Video logger: Watch raw footage on TV, hit "in/out", make notes, triage.

Imperfect information turn-based games (e.g., card games, Eurogames): TV is public, devices are private. Better than "pass-and-play" for, e.g., "Ticket to Ride". Poker.

Party photos: QR code on screen specifies photos taken in next N hours with device are shown / shared with others with same guid. (How to make work with different photosite / storage options?)


Beta SDK available and simple apps at Github.

I downloaded the iOS SDK and used Objective Sharpie to create Xamarion.iOS C# bindings. Very straightforward; tool did 95% of work. Needed to massage some stuff (some things improperly changed to fields, needed to change FieldAttribute.

"Hello world" Sender app easy-peasy lemon-squeezie:

var gckContext = new GCKContext("net.knowing.xamcast");
    var deviceManager = new GCKDeviceManager(gckContext);
    var dmListener = new DeviceManagerListener();
    dmListener.CameOnline += (s,e) => CreateSession(gckContext, e.Device);


BUT… No generic media-receiver app? Can't just write Sender app and send "GET endpoint to supported format"?

That means all dev requires going through "whitelisting" phase, which takes at least 48 hours. Just figured this out this AM, so guess limited dev this weekend.


It's a beta SDK, so I'm not going to invest much effort in "C#"-ifying the bindings yet. Eventually, I'd like to make it available as a free component on the Xamarin Component Store, but initially I'll probably just put it up on Github. I've already put up the silly Hello XamCast!.