summaryrefslogtreecommitdiff
path: root/static/audio.js
blob: b575fc151a3a9ca6d78b98a86944f101ee4c3b05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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();
	}
}