Skip to content

Commit

Permalink
feat(client): added capture of down and up arrows to ease scrolling w…
Browse files Browse the repository at this point in the history
…hen page is not focused
  • Loading branch information
Will Moss committed Sep 9, 2024
1 parent 1f2600c commit 1c7466d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/VideoFeed/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,10 @@ const VideoFeed = ({
const handleKeyboardSeeking = (e) => {
if (e.code === "ArrowRight") seekVideoForward();
else if (e.code === "ArrowLeft") seekVideoBackward();

return;
else if (e.code === "ArrowDown")
feedRef.current.scrollBy({ top: 1, left: 0, behavior: "smooth" });
else if (e.code === "ArrowUp")
feedRef.current.scrollBy({ top: -1, left: 0, behavior: "smooth" });
};
const seekVideoForward = () => {
currentVideoElement.current.currentTime += 5;
Expand Down

0 comments on commit 1c7466d

Please sign in to comment.