-
-
Notifications
You must be signed in to change notification settings - Fork 315
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
feature(register): function for register plugin #607
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please provide a pull request description? and revert changes to package-lock.json?
Done! :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got an error (plugin record not found) when i import videojs and then import videojs-record.
are you using any frameworks? what error/stacktrace specifically?
React (CRA) with craco. |
Hi! @PhilipeGatis did you found a solution in your case? Facing the same troubles with vue.js, so decided to import it through cdn for now |
I bumped into exactly the same thing using webpack, my debugging lead me to the same conclusion, as long as we are using a different videojs version from the one that is a dependency of the package the plugin will be applied to it's own videojs version and both versions will be imported If one forces the plugin in to use the current version as our platform for example https://github.com/7Ds7/videojs-record/blob/master/package.json#L77 only that version is imported and the plugin is applied correctly. This PR fixes that problem, furthermore i was inspecting old videojs plugin generators and when they build the final package they usually have this sort of check which
|
This feature provides a plugin register function. I follow this strategy.
Why?
I got an error (plugin record not found) when i import videojs and then import videojs-record. I discover the plugin auto register occurs in another instance of videojs. In this function, I pass my imported instance to the plugin register.
example of use: