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

Problem with requirejs - Uncaught ReferenceError: videojs is not defined #5343

Closed
MatheusMoura17 opened this issue Jul 25, 2018 · 4 comments
Closed
Labels
outdated Things closed automatically by stalebot

Comments

@MatheusMoura17
Copy link

MatheusMoura17 commented Jul 25, 2018

Hi, I'm trying to integrate videojs into a Moodle environment. That has dependency require.js.
I'm getting the error:

I believe it's something related to the loader of require.js
I saw that the problem was mentioned earlier at #2724

Reduced test case in this feddle.

@welcome
Copy link

welcome bot commented Jul 25, 2018

👋 Thanks for opening your first issue here! 👋

If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.

@DoomTay
Copy link
Contributor

DoomTay commented Jul 27, 2018

If it weren't for the fact that your use case has no plugins loaded, I would think that it may or may not be related to videojs/generator-videojs-plugin#193

@ony19161
Copy link

I am using requireJs with Backbone, for me it worked after amdfying videojs as following

Create a new file named videoJsAmd, and inside the file added the following code
define(['libs/videojs/video.min'], function(videojs){
return videojs;
});
Referenced the videoJsAmd in require.confg as following
require.config({
baseUrl: "/ClientCode/Scripts/",
shim: {
"libs/backbone/backbone": {
deps: ["libs/underscore/underscore", "libs/jquery/jquery.min"],
exports: "Backbone"
},
"libs/jquery.tmpl/jquery.tmpl.min": ["libs/jquery/jquery.min"]
},
paths: {
jqueryAMD: 'libs/jquery/jquery.amd',
underscoreAMD: 'libs/underscore/underscore.amd',
backboneAMD: 'libs/backbone/backbone.amd',
videoJsAMD: 'libs/videoJsAmd'
}
});

@stale
Copy link

stale bot commented Nov 20, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the outdated Things closed automatically by stalebot label Nov 20, 2018
@stale stale bot closed this as completed Nov 27, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated Things closed automatically by stalebot
Projects
None yet
Development

No branches or pull requests

3 participants