'use strict';
var playingnow = false;
document.addEventListener('keypress', (event) => {
const keyName = event.key;
if(keyName == " " && playingnow == false){
$(audioElement).trigger('play');
$(currentlyPlaying).html(songs[current]).fadeIn(fadeDuriation);
playingnow = true;
}else if(keyName == " " && playingnow == true){
$(audioElement).trigger('pause');
$(currentlyPlaying).fadeOut(fadeDuriation);
playingnow = false;
}
if(keyName == "."){
next();
}
if(keyName == ","){
back();
}
});
I have added this code to the mm-music player.js and it now accepts key presses