javascript - HTML5 audio tag in which Download possible? - Stack Overflow

I used audio tag of HTML5 and put 1 button for download that can any functionality provide by audio tag

I used audio tag of HTML5 and put 1 button for download that can any functionality provide by audio tag that we directly download as mp3 file.

<audio id="range" src="audio/1.mp3" type="audio/mp3" controls="controls">
  <a href='audio/1.mp3'>DownloadButton</a> 
</audio>
//used .play() , .volume() , .pause()  working proper

Above functionality i tried but not working which i want. I want just click on button and direct downloaded that audio file. Please tell me if any one know proper way than guide me.!

The Chrome browser is used.

I used audio tag of HTML5 and put 1 button for download that can any functionality provide by audio tag that we directly download as mp3 file.

<audio id="range" src="audio/1.mp3" type="audio/mp3" controls="controls">
  <a href='audio/1.mp3'>DownloadButton</a> 
</audio>
//used .play() , .volume() , .pause()  working proper

Above functionality i tried but not working which i want. I want just click on button and direct downloaded that audio file. Please tell me if any one know proper way than guide me.!

The Chrome browser is used.

Share Improve this question edited Feb 27, 2015 at 8:37 Johan Karlsson 1,1371 gold badge14 silver badges39 bronze badges asked Feb 27, 2015 at 7:29 Gunjan PatelGunjan Patel 2,3724 gold badges26 silver badges51 bronze badges 2
  • Please elaborate on what you have tried. What browser is also interesting. Different browser might behave different. – Johan Karlsson Commented Feb 27, 2015 at 7:41
  • @JohanKarlsson chrome browser – Gunjan Patel Commented Feb 27, 2015 at 7:55
Add a ment  | 

1 Answer 1

Reset to default 4

If you're just going to download the file, you don't need <audio> tags, which are for playing the file, not downloading, you can of course use both, but the anchor has nothing to do with the audio tag

<audio id="range" src="audio/1.mp3" type="audio/mp3" controls="controls"></audio>

<a href="audio/1.mp3" download="filename.mp3">DownloadButton</a> 

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742396640a4436080.html

相关推荐

  • javascript - HTML5 audio tag in which Download possible? - Stack Overflow

    I used audio tag of HTML5 and put 1 button for download that can any functionality provide by audio tag

    4小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信