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.
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.