Guest User

Untitled

a guest
Jan 21st, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. window.addEventListener('keypress', function (evt) {
  2. if (video.paused) { //or you can force it to pause here
  3. if (evt.keyCode === 37) { //left arrow
  4. //one frame back
  5. video.currentTime = Math.max(0, video.currentTime - frameTime);
  6. } else if (evt.keyCode === 39) { //right arrow
  7. //one frame forward
  8. //Don't go past the end, otherwise you may get an error
  9. video.currentTime = Math.min(video.duration, video.currentTime + frameTime);
  10. }
  11. }
  12. });
Add Comment
Please, Sign In to add comment