roykolak / chromecast-away

A friendly, nonjudgemental js library for chromecasting
http://roykolak.github.io/chromecast-away/
MIT License
23 stars 6 forks source link

Add polling to guarantee chromecast initialization #9

Closed ehzhang closed 10 years ago

ehzhang commented 10 years ago

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.

roykolak commented 10 years ago

Thanks for adding support for this! Traveling at the moment, but will take a look Wednesday/Thursday

chrisjpowers commented 10 years ago

+1

tomkersten commented 10 years ago

+1

roykolak commented 10 years ago

Great stuff! Sorry about the delay, wanted to pull it down and run through the examples; has been a while since I worked on this.