HTML5 音频标签在哪个下载可能? [英] HTML5 audio tag in which Download possible?

查看:45
本文介绍了HTML5 音频标签在哪个下载可能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了 HTML5 的音频标签,并放置了 1 个下载按钮,可以通过音频标签提供任何功能,我们直接下载为 mp3 文件.

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

使用 Chrome 浏览器.

The Chrome browser is used.

推荐答案

如果只是下载文件,则不需要 标签,用于播放文件,不下载,当然可以两个都用,但是anchor跟audio标签没有关系

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> 

这篇关于HTML5 音频标签在哪个下载可能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆