Page 1 of 1

Download or play options for mp3 files

Posted: 04 Oct 2012, 04:16
by johndavid
I would like to give visitors to my website the option of either downloading an mp3 file or playing the file. Does the Download plugin support this requirement? What would the code look like?

Re: Download or play options for mp3 files

Posted: 04 Oct 2012, 06:00
by Benno
Hi,
see the demo page: https://www.phoca.cz/joomlademo/phoca-download-plugin

Kind regards,
Benno

Re: Download or play options for mp3 files

Posted: 05 Oct 2012, 04:53
by johndavid
I have gone over the demo page quite carefully. Let me explain a little more what I am trying to do. I have an mp3 and would like to allow visitors to download the file so they can put it into iTunes, onto their ipods etc.. The File (Direct download) example uses a file test.zip. I would prefer not to have to zip the file. I assume this is done because otherwise the mp3 will play automatically and not give you the option to save the file. I realize that most people can handle unzipping a file but it is an extra step. Thanks for your reply. I was hoping for a solution where you would click to play and right-click to save... or something that simple.

Re: Download or play options for mp3 files

Posted: 05 Oct 2012, 17:13
by Benno
Hi,
I'm not sure if I understood you well.
Why don't you use two instances of the Phoca Download Plugin?

The first to play the file phocadownload view=fileplay|id=1|playerwidth=328|playerheight=200|playerheightmp3=30 ({ and } is missing!)
The second to download the mp3 file (not zipped) phocadownload view=file|id=1|text=MP3 Test|target=s ({ and } is missing!)

See:
Image

Kind regrds,
Benno

Re: Download or play options for mp3 files

Posted: 06 Oct 2012, 05:24
by johndavid
Thanks for your suggestion. When I use "phocadownload view=file|id=2|text=MP3 test|target=s" I get the icon and "MP3 Test" text. If I right click on the text I have an option to "Save Link As" and I can save the MP3 to my hard drive. A left click on the text opens up a window and the MP3 plays. So I actually have what I was looking for. Thanks again.

Re: Download or play options for mp3 files

Posted: 06 Oct 2012, 06:51
by Benno
Ok.

Kind regards,
Benno