Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

video.js and video-youtube.js throwing "Cannot read properties of undefined (reading 'videojs')" when loading page #596

Open
Velocedge opened this issue May 7, 2022 · 0 comments

Comments

@Velocedge
Copy link

Velocedge commented May 7, 2022

I'm trying to play a Youtube video using videojs and videojs-youtube. I posted this in Stackoverflow first then I saw this page.

I've installed the latest versions with npm (videojs 7.18.1, videoojs-youtube 2.6.1). I'm loading in this order:

<script type="text/javascript" src="/node_modules/video.js/dist/video.js"></script>
<script type="module" src="/node_modules/videojs-youtube/dist/Youtube.js"></script>

When the page loads, I get the error: "Cannot read properties of undefined (reading 'videojs')" when it hits line 32:

root.Youtube = factory(root.videojs);

Upon entry to this function, "root" is undefined.

I'm not sure how to fix this or what other information you need to explain why I'm getting the error. This code is in the frame of a frameset if that makes a difference. I've changed the JavaScript example into an .asp frameset and used the same type of include files and it works fine. Could I have variable or function names that conflict... something like that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant