Skip to content

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

@pepsipwns

Description

@pepsipwns

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions