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.
It seems that jPlayer module has an option to 'Protect audio files from direct downloads': https://www.drupal.org/project/jplayer
For those that are looking to protect their mp3 from being directly downloaded, this seems a good idea.
Or it is possible just to swap out pushtape player and use jplayer instead? how integrated is pushtape player with this distribution?
cheers,
Comments
Comment #2
zirafa CreditAttribution: zirafa as a volunteer commentedThe pushtape player script was designed to integrate easily with this distribution with minimal configuration.
However, the audio in this distribution is just a filefield, so I don't see why you wouldn't be able to turn off pushtape_player module and use the jplayer module instead. I'd recommend just trying it out and see if it works, though I won't be able to provide much support if it doesn't work out.
Note: I see a bunch of open issues regarding the jPlayer Protect feature, so you might want to test that first to see if it is stable and works on a vanilla Drupal install.
Comment #3
onejam CreditAttribution: onejam commentedThanks. I'll give it a go.
Comment #4
onejam CreditAttribution: onejam commentedOk, so jplayer protection doesn't work as it requires private directory.
However, another way is to use .htaccess file placed in the audio directory:
That seems to prevent direct access to the mp3 files in the folder (ie, sites/default/files/audio/) so users cannot download mp3 directly.
Quick question, do you see any issue in using this method?
cheers,
Comment #5
zirafa CreditAttribution: zirafa as a volunteer commentedWouldn't you want to use a private directory?
For the .htaccess method, my first thought is if the server prevents direct access to the file, the player script may also have trouble playing the file. You'd need some way to give the player script local permission to the file, while denying outside requests.
You could just try this one line in an .htaccess placed in the audio directory:
This should deny all outside requests to a file, and only grant access from the local server.
https://httpd.apache.org/docs/current/mod/mod_authz_host.html
Comment #6
onejam CreditAttribution: onejam commentedThat was what i thought too but the mp3s are working fine with pushplayer, with the htaccess directive i've shown you applied.
Thanks for the suggestion. Will also try out your suggestion as well.
Will close this issue as i think it's resolved now.
cheers,