function AudioTagSample() { // initialize audio player this.audio = new Audio(); this.isPlaying = false; window.addEventListener('load', this.onload.bind(this), false); } AudioTagSample.prototype.onload = function() { // Create the audio nodes. this.source = context.createMediaElementSource(this.audio); this.source.connect(context.destination); }; AudioTagSample.prototype.click = function(link) { var was_inactive = this.audio.paused var was_the_same = this.audio.src == link.href var controls = document.querySelectorAll('.controls'); for (i=0;i