Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
bojanz CreditAttribution: bojanz commentedCommerce 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.
Comment #2
bojanz CreditAttribution: bojanz commentedThis 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).