Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chromebook - Fails to load - cast is not defined #35

Open
techandsoftware opened this issue Oct 22, 2020 · 2 comments
Open

Chromebook - Fails to load - cast is not defined #35

techandsoftware opened this issue Oct 22, 2020 · 2 comments

Comments

@techandsoftware
Copy link

I'm serving from localhost on Chromebook (using browsersync to serve). I get this error in Chrome

Uncaught ReferenceError: cast is not defined
    at CastPlayer.initializeCastPlayer (CastVideos.js:180)
    at window.__onGCastApiAvailable (CastVideos.js:1645)
    at chrome.cast.fa (cast_sender.js:97)

I put a debugger before castPlayer.initializeCastPlayer(); in the handler for __onGCastApiAvailable. This shows that - most of the time - the cast object is not defined even though the callback is called with isAvailable as true. See screenshot - (the watch area shows the undefined cast object). If I refresh repeatedly, cast is occasionally defined.

Screenshot 2020-10-22 at 16 07 52

@AGauna
Copy link

AGauna commented Dec 9, 2020

+1

@hiren3897
Copy link

hiren3897 commented Mar 15, 2022

Resolved:

  window['__onGCastApiAvailable'] = function (isAvailable) {
    if (isAvailable) {
      setTimeout(() => {
        castPlayer.initializeCastPlayer();
      }, 1000)
    }
  };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants