loading video.js plugins

1 post / 0 new
kaspar128
kaspar128's picture
loading video.js plugins

Hello everyone.
tactic is running great in our (+/- 40 animators) studio :-) 
For reviewing our scenes I use the latest video.js that is run from the widget: VideoWdg.py(had to dig up an old version from git, to make it work btw)
Now I want to expand the player's options with some plugins but I can't seem to include/load the javascripts.
 
for example: I want to add a replaybutton (videojs-replay.js)
For this I edited the 'VideoWdg.py' and in the javascriptcode (added with 'top.add_behavior()' -function) I add:
spt.dom.load_js(["video/videojs-replay.js"])  (of course the script is added in the '..tactic/src/context/spt-js/video/'-folder)
 
I tried the use of 'spt.dom.load_js' in many ways but I cannot make it work. At best it gives an error in the console:

"Uncaught TypeError: Cannot read property 'plugin' of undefined
    at Object.<anonymous> (videojs-replay.js:7)
    at Object.t.1 (videojs-replay.js:7)
    at i (videojs-replay.js:7)
    at e (videojs-replay.js:7)
    at videojs-replay.js:7
    at videojs-replay.js:7
    at videojs-replay.js:7

.. this is when I init the player with:

spt.video.init_player = function(video_id, events) {
 
    if (spt.video.loaded) {
        var player = videojs(video_id, {"nativeControlsForTouch": false}, function() {
            spt.video._add_events(this, events);
        });
    }
    else {
 
        spt.dom.load_js(["video/video.js"], function() {
            var player = videojs(video_id, {"nativeControlsForTouch": false}, function() {
    
                spt.video._add_events(this, events);
            } );
            spt.video.loaded = true;
            spt.video.player = player;
            spt.video.players[video_id] = player;
           
        } );
        spt.dom.load_js(["video/videojs-replay.js"]);
    }
}
 
 
If anyone knows a solution that would be great! :-D