googlecast/CastHelloText-chrome — pull request #3 by Scarygami (2014-02-04 10:41:20+00:00)
Title: Slight change in initialization

While not necessary for this specific sample, I think it is nicer to make clear that you always have to call the `initializeCastApi()` function. If you have some other initialization work to do in your app before initializing the Cast API `chrome.cast.isAvailable` might already be `true`, in which case the initializeCastApi function wouldn't be called in the original code.

Additional remark: is it safe to assume that the chrome Cast API will always be ready within a second? Or would it make more sense to wait for initialization like this:

```
function waitForApi() {
if (!chrome.cast || !chrome.cast.isAvailable) {
setTimeout(start, 1000);
} else {
initializeCastApi();
}
}

waitForApi();
```

In this case the timeout could also be reduced, for quicker startup time.