I am trying to understand networking details of chromecast. Consider this case, there is youtube-server (S), Hand-device(H) and Chromecast(C). Following are the steps, i would do.
1) Initially, would pair both H & C either automatically or explicitly.
2) Would play say youtube video on my hand-held-device(H). H will form a TCP session with the Server-S
3) Now, i play this video on my TV. So,
Questions
A) Is there a separate TCP session between the server and Chromecast or the hand-held-device mirror whatever it gets from server
B) Surprisingly, even after switching-off handle held device, Chromecast kept streaming until completion. So, expecting some kind of TCP state between Server and Chromecast. If so, who initiates this connection ?
D) How does Hand-held-device know about the current streaming state ?
Thanks
A) If you initiated a casting session with the cast button in the app, then yes -- there is a separate session between the server and the Chromecast. Your hand-held-device tells the chromecast how to discover the server, how to request the videos, etc., but the Chromecast sends the requests for the media assets directly to their source. There is no mirroring going on. (keep in mind that Android CAN mirror to the Chromecast, as can Chrome with tab-casting, but this is different than using the cast button)
B) As stated above, the hand-held device provides instructions to the Chromecast (usually in the form of an app ID that the chromecast resolves by looking to Google's servers to see where the web app is houses), and also with the URLs of the media. But once media playback starts, if you want to turn off the sender device, the playback can continue (and this is one of the big benefits of the Chromecast. In fact, this allows for you to come along with a different device and connect to the session if desired).
D) The Chromecast and hand held device also maintain their connection, so that the Chromecast can send back the status of playback, and so that the user can initiate playback control instructions that tell the Chromecast to pause/skip/etc. etc. the media session.