roykolak/chromecast-away — pull request #9 by ehzhang (2014-07-29 17:46:15+00:00)
Title: Add polling to guarantee chromecast initialization

Sometimes the window['__onGCastApiAvailable'] callback is fired before castaway has a chance to initialize.

The chrome sender docs suggest having a timeout to address the loading of the API.
https://developers.google.com/cast/docs/chrome_sender

Polling for initialization guarantees that the initialization occurs.