From e4d6289dd9a471102984646dfd1aa2bdf8212f21 Mon Sep 17 00:00:00 2001 From: Owen Jow Date: Sun, 11 Oct 2015 22:26:50 -0700 Subject: [PATCH] Patched up the option for beat reversion --- index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index d13a042..642009f 100644 --- a/index.html +++ b/index.html @@ -47,7 +47,7 @@ // Kanyebtn.addEventListener("click", beat("Kanye")); function beat(name) { - if (audio.src !== 'rap_app_instrumentals/freestyle_rap.mp3') { + if (audio.src.indexOf('rap_app_instrumentals/freestyle_rap.mp3') == - 1) { audio.src = 'rap_app_instrumentals/freestyle_rap.mp3'; } else if (name === "Kendrick") { audio.src = 'rap_app_instrumentals/money_trees.mp3'; @@ -58,6 +58,7 @@ } else if (name === "Kanye") { audio.src = 'rap_app_instrumentals/medium.mp3'; } + if (audio.paused) { audio.play(); startbtn.innerHTML = ''