VideoJS Playlist

VideoJS Playlist

by Michelle Melton -
Number of replies: 3
Picture of Core developers Picture of Plugin developers

We're trying to implement a VideoJS playlist in the filter_rtmp for Moodle 3.2. I have the 2 JS files for the playlist in a $PAGE->requires->js call, but they are dependent on videojs being set up first (I'm getting the Uncaught ReferenceError: videojs is not defined error). 

Does anyone have advice on how to modify the code to make sure the Moodle core loader.js and video-lazy.js have already defined videojs before my external JS files are called?

Thanks in advance for any direction!

Average of ratings: -
In reply to Michelle Melton

Re: VideoJS Playlist

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Michelle,

Have you got an updated version of filter_rtmp for Moodle 3.2? Moodle downloads only show a version for Moodle 3.0 and below, although I do have it running on a Moodle 3.1.5+.

When trying to use filter_rtmp on Moodle 3.2.2+, with debugging set to Developer I see a couple of long debug messages and the player reports "The media could not be loaded, either because the server or network failed or because the format is not supported."

In reply to AL Rachels

Re: VideoJS Playlist

by Michelle Melton -
Picture of Core developers Picture of Plugin developers

Hi AL,

We are currently working on the updated version of the filter_rtmp for Moodle 3.2 with the use of VideoJS, which is where my question comes from. I have the filter working for single videos, and I have the working implementation set up for the playlists, however the only thing preventing it from working for playlists is the order video-lazy.js is called - it always gets called AFTER my plugin JS files, which are dependent on the VideoJS object, so I need to find a way to run my playlist JS after the Moodle core VideoJS is run. I've tried several different things with no success yet, so I am reaching out to the Moodle community for any advice!

In reply to Michelle Melton

Re: VideoJS Playlist

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Michelle,

Thanks for the explanation, and sorry, that I can't be of any help.