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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kenheim’s picture

Subscribe. 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.

kenheim’s picture

In 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.

marioangulo’s picture

Issue summary: View changes
FileSize
1.46 KB

I 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.

Juc1’s picture

@ marioangulo or anyone - marioangulo's patch does not seem to work for me. any ideas please?

patch

marioangulo’s picture

@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

Juc1’s picture

@ marioangulo thanks but I get the same hunk failed message =

hunk

Re https://www.drupal.org/node/417866 I am not using Apache but I think there is some equivalent for Nginx eg here

Thanks...

garamani’s picture

Why don't you use the File Force Download?

dovran’s picture

#3 Work for me. Thanks

jnettik’s picture

Version: 7.x-1.2 » 8.x-1.x-dev

This isn't something I'd consider for the 7.x branch. But I'm open to patches against 8.x for this feature.

dtarc’s picture

This is a reroll of patch in #3 against latest MediaElement module 1.3.

  • dtarc authored 16a6222 on 7.x-1.x
    Issue #1540746 by marioangulo, dtarc, Juc1: Make download link download...
jnettik’s picture

Thank you. Committed. Needs port for D8