shiyiya/oplayer

Chromecast plugins error

evmatic opened this issue · 3 comments

chromecast.min.js?v=1.0.12-beta.3:8 Uncaught TypeError: Cannot read properties of undefined (reading 'isIOS') at d.canPlay (chromecast.min.js?v=1.0.12-beta.3:8:1480) at d.apply (chromecast.min.js?v=1.0.12-beta.3:8:913) at e.applyPlugin (index.ui.js?v=1.2.34-beta.1:8:11238) at Array.forEach (<anonymous>) at e.create (index.ui.js?v=1.2.34-beta.1:8:9089)

The error above is seen in the latest beta in chrome browser, crashing the whole player!

check

<script src="https://cdn.jsdelivr.net/npm/@oplayer/plugins@1.0.12-beta.2/dist/chromecast.min.js"></script>

it is working

Hello,
the error occurs only on site loaded on a local network like http://192.168.0.....
The first time it works, but after reloading and getting the NO_DEVICE_AVAILABLE error, the player breaks down completely.

canPlay() { return o && !a.isIOS }

This line of code in chrome cast extension, a seems to be undefined.

Its a weird situation, hosting the chromecast extension js on the remote server instead of using the distributed cdn makes the problem goes away. Maybe, cdn server is restricting content access from origin with 192.168.0.....

This also doesn't makes much sense, as it loads normally and works for the first time even if it got loaded off from cdn, error occurs only after page reload, but the js hosted on my own server works flawlessly as it should of been!