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:
https://github.com/videojs/video.js/issues/5680
@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:
define(['jquery', 'elgg', 'global/window', 'videojs', 'VideojsRecord', 'elgg/ready'], function ($, elgg, window, videojs) {
window.videojs = videojs;
var player = videojs('myvideo', {
controls: true,
width: 640,
height: 480,
....
plugins: {
record: {
audio: true,
video: true,
....
}
}
});
....
Thanks!! That solves the issue
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.