Where are uploaded videos stored?

I'm running H5P as a Moodle 3.6.1 plugin, inside a VM I downloaded from Bitnami, to test it out. While H5P is great, because it lets me let students change the playback speed for videos (unlike the default video display), I'm wondering where the videos are stored, because the VM has limited storage. And I sshed into the VM and didn't see any file with my uploaded file name...so I'm wondering whether it's uploaded to your server instead of the Moodle VM?


Related question is that the video I was testing with is an MP4. When I upload it, it works. But when I point H5P at the same video just served from a local server (e.g., it first shows the type as MP4, but then when I go to try to view it, it says unsupported format. I wouldn't be concerned about video upload storage constraints if I knew H5P was pointing at my own local server instead.


I'd be greatful for any help on these two related issues.

I suppose I should say that my http server is running on port 8080 instead of just 80, incase that's what's confusing the plugin.

icc's picture


Port 8080 should be fine.

The files you upload(including video) is by default stored in your moodle's data directory which resides inside the VM. You may not find them due to how moodle renames files that are uploaded.

Hosting your video's on a different server isn't an unusual choice, however, in order for that to work, you must enable what's called CORS headers in the server configuration. If you're running Apache this could be as simple as creating a .htaccess file in the same folder as your video files and add the following:

Header set Access-Control-Allow-Origin "yourdomain.com"

If you're not running Apache do a quick search for your web server and CORS.

This is a sort of protection which allows you to specify which sites can embed your videos. I believe you can use * if you want anyone to be able to use the videos.

I used the following setting to enable CORS on nginx: https://enable-cors.org/server_nginx.html

I thought it wasn't working because it was working on the system that served the videos themselves, but not on another external system, where H5P was saying "video format not supported". But it turned out that it was my firewall settings on the server, so it's all good now.

BV52's picture

Hi robrobrobertson3,

I'm glad it is working now if you have additional questions feel free to post in the forums.