jwplayer / jwplayer-react

ISC License
28 stars 13 forks source link

window.jwplayer(...).setup is not a function #12

Open pepsipwns opened 2 years ago

pepsipwns commented 2 years ago

image

Using Nextjs and jwplayer-react.

The player most of the time is loading fine, but some times when the page loads the component itself loads before the jwplayer.js script has loaded. I had deduced that the jwplayer script will set the window.player, allowing us to use .setup(). However if the jwplayer.js script is not loaded before the component, the error is produced. I (think) I have found a workaround by loading the jwplayer in webpack, but its my understanding that this will load the library on every page, which isn't required for my site, the video component is in fact only on one page.

jwbrandon commented 1 year ago

Is this related to server side rendering? If not we will need a reproducible test case here as we cannot reproduce on our end.