I recently posted a question on Stack Overflow (http://stackoverflow.com/questions/28557218/chromecast-sender-that-knows-when-session-started-from-cast-extension) but it hasn't gotten much traction, so I thought I'd offer it up here as well to see if smarter people than I can help out. Basically, I'm interested in allowing users to trigger my Chrome sender just with the extension button (which works well for most apps). The SDK docs for building a Chromecast Sender on Chrome mention this:
"There is also a third way of getting a Cast session. A user with the Cast extension installed in their Chrome browser can mirror any Chrome tab to a Cast device. If the user lands on your site, for which you have implemented a Cast app, tab mirroring will automatically trigger a new Cast session instead of putting the browser in mirroring mode."
However, when I do this with my sender, it connects to the proper receiver app but doesn't load the media (which, when triggered via my chromecast icon, does work as there's a callback function that loads it up). So I'd like to better understand how my sender code can know when a session has been started directly via the extension; how can my app be notified? Is there a way to get it hooked into the same callback that my sender icon uses? Is there an event that's raised? Does it execute its own callback (and if so, how can we hook into that callback)?
In a similar stack overflow question, had answered indicating that it was possible, but not how to do it. Any insights would be very useful. Thanks much!