summaryrefslogtreecommitdiff
path: root/rapbot/play.js
diff options
context:
space:
mode:
Diffstat (limited to 'rapbot/play.js')
-rwxr-xr-xrapbot/play.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/rapbot/play.js b/rapbot/play.js
new file mode 100755
index 0000000..6861d31
--- /dev/null
+++ b/rapbot/play.js
@@ -0,0 +1,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();
+ });
+
+});