I am able to play pause and stop audio files through the keyboard, but when I am seeking back and forth, I am using left and right arrow keys, and it is being seeking 15 sec. I need to do it for 5 or 10 seconds, instead. Below is the java script that i used
<script>
var audio = $("audio")[0];
$(document).keydown(function (e) {
var unicode = e.charCode ? e.charCode : e.keyCode;
console.log(unicode);
// right arrow
if (unicode == 39) {
audio.currentTime += 5;
// back arrow
} else if (unicode == 37) {
audio.currentTime -= 5;
// spacebar
} else if (unicode == 32) {
if (audio.paused) {
audio.play();
}
else {
audio.pause()
}
}
});
</script>