Skip to content

Commit

Permalink
Patched up the option for beat reversion
Browse files Browse the repository at this point in the history
  • Loading branch information
ohjay committed Oct 12, 2015
1 parent b91001b commit e4d6289
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -58,6 +58,7 @@
} else if (name === "Kanye") {
audio.src = 'rap_app_instrumentals/medium.mp3';
}

if (audio.paused) {
audio.play();
startbtn.innerHTML = '<button type="button">Stop</button>'
Expand Down

0 comments on commit e4d6289

Please sign in to comment.