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.

I'm serving from localhost on Chromebook (using browsersync to serve). I get this error in Chrome
I put a
debuggerbeforecastPlayer.initializeCastPlayer();in the handler for__onGCastApiAvailable. This shows that - most of the time - thecastobject is not defined even though the callback is called withisAvailableas true. See screenshot - (the watch area shows the undefined cast object). If I refresh repeatedly,castis occasionally defined.