I have a shop, where users can buy videos. When they buy a video, they can download it form /user/[UID]/my-files.

Now I want to play the files within a media player (mediaelement.js). How do I access the files? When I use /system/files/[filename] , I get an access denied.

Any help would be appreciated.

Comments

bojanz’s picture

Commerce File was built to allow you to download the purchased file. Streaming from a player will require additional exploration and patching the module.
So the only thing I can unfortunately say is "patches welcome".

EDIT, additional thoughts:
The system/ callback doesn't work for a licensable file because it wouldn't work with S3, and it wouldn't register the download for later limitation (though that could be fixed). I think having a file/%file/stream callback might make the most sense, since it would probably require custom headers for the player.

bojanz’s picture

Category: support » bug
Status: Active » Closed (duplicate)

This is actually the same issue as #2079349: Can't stream licensed files or create their image derivatives.
When I fixed that bug, mediaelement started streaming the file correctly (after the streaming is done, a download gets logged for limitation purposes, etc).