Advertisement
BrU32

HTML5/JS Audio Mp3 Player Demo SRC

May 27th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. <button onclick="PlayIt();">Play</button><button onclick="PauseIt();">Pause</button>
  2. <audio type="audio/mp3" id="aud" src="http://compulsivecoding.com/DJ%20BrU%20-%20The%20Influx.mp3" autoplay="false"><audio/>
  3. <script>
  4. function PauseIt(mp3){
  5. var aud=document.getElementById("aud");
  6. aud.playbackRate=1.0;
  7. aud.volume=1.0;
  8. aud.pause();
  9. }
  10. function PlayIt(mp3){
  11. mp3=prompt("Enter URL:");
  12. var aud=document.getElementById("aud");
  13. aud.src=mp3;
  14. aud.playbackRate=1.0;
  15. aud.volume=1.0;
  16. aud.play();
  17. }
  18. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement