function Audio() { this.audio = document.getElementById('audio'); this.set_src = function(src) { this.audio.setAttribute('src', src); var audio_src_url = document.getElementById('audio-src-url'); audio_src_url.innerHTML = 'Playing: ' + src.replace('&', '&'); } this.play = function() { this.audio.play(); } this.pause = function() { this.audio.pause(); } this.stop = function() { this.audio.stop(); } }