Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Hi,
Great module. However :o) - it would be nice if the download link would force-download the media file.
I serve MP3 files (sermons etc.), and I have to write something like "Right-click, and select Save As to save the file" in the download link text.
If I could check off a "Force Download" option in the mediaelement settings instead, that would be great! I've tried mucking about with .htaccess to set a header, but I can't get it to work.
Comment | File | Size | Author |
---|---|---|---|
#10 | mediaelement-download_automatically-1540746-10.patch | 1.36 KB | dtarc |
#6 | mediaelement-patch-hunk-failed-2.jpg | 74.55 KB | Juc1 |
#4 | mediaelement-patch-hunk-failed.jpg | 264.43 KB | Juc1 |
#3 | download_automatically-1540746-3.patch | 1.46 KB | marioangulo |
Comments
Comment #1
kenheim CreditAttribution: kenheim commentedSubscribe. I agree, this is a great module, but it would be nice for download to actually download. When a user clicks download, they expect a download, not a different player in a different window.
Comment #2
kenheim CreditAttribution: kenheim commentedIn the meantime you can use the file force module http://drupal.org/project/file_force. In D7 you have to use the regular file type for your file field and you have to use private file upload. Then using views you can have your file field twice; once using mediaelement formatter and another using file force formatter.
This works in any views display, but it doesn't help with the node display if you want both the ability to play on the site and download, since you can't have the file field twice in your node display. Therefore, the superior solution would be to have the mediaelement download link force the download.
Comment #3
marioangulo CreditAttribution: marioangulo commentedI created a patch which automatically downloads the file. The change is done on the a tag where you just put an attribute "download" to force the download on click.
Comment #4
Juc1 CreditAttribution: Juc1 commented@ marioangulo or anyone - marioangulo's patch does not seem to work for me. any ideas please?
Comment #5
marioangulo CreditAttribution: marioangulo commented@Juc1
Try patching this way patch -p1 < path/file.patch
You have to be in the directory where the module is located before you run this command. Also you might want to look at setting up certain files to be downloadable (instead of viewed through the browser) by doing the following:
https://www.drupal.org/node/417866
Comment #6
Juc1 CreditAttribution: Juc1 commented@ marioangulo thanks but I get the same hunk failed message =
Re https://www.drupal.org/node/417866 I am not using Apache but I think there is some equivalent for Nginx eg here
Thanks...
Comment #7
garamani CreditAttribution: garamani commentedWhy don't you use the File Force Download?
Comment #8
dovran CreditAttribution: dovran as a volunteer and commented#3 Work for me. Thanks
Comment #9
jnettikThis isn't something I'd consider for the 7.x branch. But I'm open to patches against 8.x for this feature.
Comment #10
dtarc CreditAttribution: dtarc at Affinity Bridge commentedThis is a reroll of patch in #3 against latest MediaElement module 1.3.
Comment #12
jnettikThank you. Committed. Needs port for D8