Skip to content

Commit

Permalink
static: automatic time skip for YT player
Browse files Browse the repository at this point in the history
  • Loading branch information
destevae committed Mar 22, 2024
1 parent c08a0bc commit 20d476b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions static/roomday.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,17 @@ document.addEventListener("DOMContentLoaded", function()
}
});

// Automatic time skip for Youtube player
var player = document.querySelector("#player");
player.focus();
document.addEventListener('keydown', function(e) {
if (e.key == "ArrowLeft") {
player.seekTo(player.getCurrentTime() - 10, true);
} else if (e.key == "ArrowRight") {
player.seekTo(player.getCurrentTime() + 10, true);
}
});

function getVid() {
return document.querySelector("#player").dataset.vid;
}
Expand Down

0 comments on commit 20d476b

Please sign in to comment.