summaryrefslogtreecommitdiff
path: root/rapbot/play.js
blob: 6861d31a64df2eb067eed6e087769c1804af713c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
$(document).ready(function() {
	
	var allAudio = $('audio');
	
	function pauseAllAudio() {
		allAudio.each(function() {
			var a = $(this).get(0);
			a.pause();
			a.currentTime = 0;
		});
	};
	
	$(".play").click(function() {
		var tune = $(".current").attr("id");
		var realtune = $("#"+tune)[0];
		realtune.play();
	});
	
	$(".next").click(function() {
		pauseAllAudio();
	});
	
	$(".prev").click(function() {
		pauseAllAudio();
	});
	
});