Hello everyone,
Im trying to get videojs-record into a plugin. Videojs is not designed to work as AMD, and it seems the record plugin is not accesible by videojs when it is loaded asyncronously.
Everytime Im getting the error: 'Uncaught Error: plugin "record" does not exist'.
Checking the network, the plugin and all dependencies are loaded properly. This is my code:
In views.php
In start.php
In main.js (which is added in views/add with elgg_require_js)
and in dovideo.js, which is called asyncronously by main.js
If anyone has an insight about this I would be grateful.
Thank you!
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- iionly@iionly
iionly - 0 likes
- PabloAgustin@PabloAgustin
PabloAgustin - 0 likes
- rjcalifornia@rjcalifornia
rjcalifornia - 0 likes
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 1 like
- PabloAgustin@PabloAgustin
PabloAgustin - 0 likes
You must log in to post replies.With the recent versions of iZAP Videos (https://elgg.org/plugins/1913474) I made use if videojs to provide HTML5 support. It's loaded via an AMD module. I haven't made use of any additional videojs plugins so I don't know if it's maybe only the plugin itself that's not AMD capable. Please bear in mind that the iZAP Videos plugin is currently not working on Elgg 3 with the present version. I'm currently working on upgrading it but it will take a little while before I can make a release.
Thank you, I appreciate your answer.
I got the same feeling, videojs can be loaded as amd, but not its plugin (or at least not in a way that it is accesible to videojs).
My question is then how is it possible to load a mix of AMD and not AMD modules with the elgg system. Defining the modules and using shim in requirejs.config does not suffice (or perhaps I am doing something wrong).
You are better off loading videojs and its plugins inline. That's what I did for my Videolist plugin.
Here are some issues that I faced with VideoJS and RequireJS:
@PabloAgustin
We've same plugin for Elgg 2. Works very well.
Here's what we did.
1. You need to define 'global/window' and 'global/document'. You can find it from the mentioned above link.
2. For videojs.record.js you should define 'exports' param as 'VideojsRecord' not 'record'.
Also, use elgg_define_js('videojs', not 'video_js'
3. I don't know why you need main.js bcz we did all in one JS (dovideo.js in your case) and call it as elgg_require_js('script');
4. Snippet from this script is:
Thanks!! That solves the issue