yocontra / nodecast

Node interface to DIAL/RAMP/ChromeCast
MIT License
163 stars 23 forks source link

Support launching Chromecast SDK 2.0 apps. #13

Open matbee-eth opened 10 years ago

matbee-eth commented 10 years ago

I can't see this documented, how would we launch an app on the Chromecast w/ the new SDK?

yocontra commented 10 years ago

@acidhax Got link to a docs for the new SDK? I haven't heard about it

matbee-eth commented 10 years ago

https://developers.google.com/cast/docs/chrome_sender var sessionRequest = new chrome.cast.SessionRequest(chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID); // Here I would put my App ID

vincentbernat commented 10 years ago

Looking at the Tic Tac Toe example, I see that the application is able to launch on the ChromeCast without using port 8008. Everything seems to happen on port 8009. Using the ID (BFEBD3F1) instead of the name leads to 404.

Moreover, when the application is running, querying /apps/ gives a 204 instead of a 200 (and hence no content).

vincentbernat commented 10 years ago

It seems that Google changed the protocol with its 2.0 SDK: https://plus.google.com/+SebastianMauer/posts/83hTniKEDwN

vincentbernat commented 10 years ago

After digging a bit around, I didn't find any documentation about this new protocol. Here is what I discovered so far:

  1. The protocol is wrapped into TLSv1.1.
  2. The protocol is protobuf based. The definition can be found in Chromium source code in browser/extensions/api/cast_channel/cast_channel.proto
  3. It starts with an auth challenge. Hopefully for us, the auth challenge is here to authenticate the device, not us.
  4. Messages are then JSON message and the protocol can be observed by simply using the Chrome client and looking for debug messages in the developer tools.
vincentbernat commented 10 years ago

I have made some progress and put an experimental implementation in https://github.com/vincentbernat/nodecastor. This code only handles mDNS and the protobuf protocol. I don't intend to implement SSDP/DIAL. I would welcome an integration in nodecast.

matbee-eth commented 10 years ago

Good to hear! I'll check it out :)

yocontra commented 6 years ago

@vincentbernat Does your library still work with the latest chromecasts? I'll replace our chromecast handling with your stuff if so.

vincentbernat commented 6 years ago

I can't say, I don't have any chromecast anymore. Nobody told me otherwise.

yocontra commented 6 years ago

@vincentbernat Cool, will give it a shot then - thx