Skip to content

Instantly share code, notes, and snippets.

@kandros
Last active January 5, 2020 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kandros/d40df1885ddd0cb3f7b9a96e900ed732 to your computer and use it in GitHub Desktop.
Save kandros/d40df1885ddd0cb3f7b9a96e900ed732 to your computer and use it in GitHub Desktop.
document.addEventListener("keydown", e => {
if (e.key === "f") {
const btn = document.querySelector(
"#vjs_video_3 > div.playlist-arrow-button.hover-button"
);
btn.click();
} else if (e.code === "Space") {
e.preventDefault();
const video = document.querySelector("#vjs_video_3_html5_api");
if (video.paused) {
video.play();
} else {
video.pause();
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment