You can use the <audio> (HTML5), and you can control it when files are uploaded.
It is supported in most browsers such as Google Chrome, Firefox, Opera ...
It has two ways to set the link:
Method 1
<audio src="YOUR FILE LINK HERE"> <embed> </embed> </audio>
Way 2
<audio> <source src="YOUR FILE LINK HERE (MP3)" type="audio/ogg" /> <source src="YOUR OTHER FILE LINK HERE (OGG)" type="audio/mp3" /> <embed> </embed> </audio>
Attributes
- Put
controls="controls" if you want it to display an audio player. - Put
loop="loop" if you want it to encode audio. - Put
autoplay="autoplay" if you want it to play sound by itself. - Put
preload="preload" if you want to preload it.
Javascript control
You can also control it using JavaScript.
To play it: document.getElementById("YOUR AUDIO TAG") .play()
To pause it: document.getElementById("YOUR AUDIO TAG") .pause()
More details
source share