groupon / greenscreen

BSD 3-Clause "New" or "Revised" License
1.2k stars 149 forks source link

Developer documentation #20

Open sirket opened 9 years ago

sirket commented 9 years ago

Brilliant application- one way or another I'm going to jump into the code and see what I can figure out.

Before I bury myself in code- are there any developers docs, connectivity diagrams, or high level overviews to help folks wrap their head around how this system operates? Who talks to what, when, and how?

Are there any good Chromecast developer docs one should reference while working on the code?

chrisjpowers commented 9 years ago

Hey @sirket, I would certainly suggest familiarizing yourself with the Google Cast documentation so that you understand how that device works with the code.

I don't have any connectivity diagrams put together, but it's pretty simple. When you want to add a Chromecast to Greenscreen, you need to be using Chrome with the Cast extension, on the same network as the Chromecast device. If you do, the "Add Chromecast" button will be available. When you click it, the Web app will use the 'cast' API provided by the Cast browser extension to talk to the Chromecast over the network and tell it to go to the Greenscreen application you have set up.

From that point on, all communication happens between the Chromecast and the server over Web Sockets. When the client Web app changes server state (ex. makes a change to a channel), then that change is pushed down from the server to the Chromecast device via web sockets.

sirket commented 9 years ago

@chrisjpowers thanks for the response!

I've read through the Google Cast documentation and understand how it works with the code. I've also been testing with the castv2 module to eliminate the need to use the Chrome extension.

As for the rest of the connectivity/documentation- I was more referring to the Greenscreen app itself- which parts of the code accomplish what. Client/Server in the src directory, which parts of the public folder is used by the server versus downloaded by the Chromecast- that sort of thing. Mapping the JS functions used by the Chromecast to the code generated by Angular is tripping me (though that's probably a lack of familiarity with Angular more than anything else).