You are here:

DHTML/Hyperlinks control

Advertisement


Question
Hi, I have a webpage that has a hyperlink to an mp3 file, when clicked it starts playing the mp3 file. However I want it to start downloading the file. Also a link sometimes starts downloading when you want it to play the file.Is there some way of controlling it? Thanks!!

Answer
I'm by no means an experts on web audio, but this link seemed very informative:
http://www.transom.org/tools/webaudio/200403.mp3_streaming.html

There's a test link at the bottom of that page that is an .m3u file that prompts a user to download before it starts playing.  That seems to accomplish the control you were after.  Complete instructions exist therein.

Good luck,
Andrew

DHTML

All Answers


Answers by Expert:


Ask Experts

Volunteer


Andrew Hoffman

Expertise

Ask me about JavaScript, CSS, HTML5/XHTML, or PHP. Chances are I'll be able to help you. I know the economy is in the tank, but if you like my answer, please consider donating a few bucks. It's like tipping your barista, if your barista served fresh code instead of coffee.

Experience

I started doing this when boy bands were still cool.

Education/Credentials
I read a lot of nerdy books to get here.

©2012 About.com, a part of The New York Times Company. All rights reserved.