added 30-second jumps with ctrl

This commit is contained in:
2020-10-02 20:04:23 +02:00
parent 8513e5558b
commit ef1fecbce4
2 changed files with 16 additions and 4 deletions

View File

@@ -1,3 +1,6 @@
- [ ] fix bug where the "current Module" no longer updates after you've navigated outside the bounds
of the modules' timestamps
- [ ] or (easier) require the modules' timestamps to cover the entirety of the recording
- [ ] load data from JSON or an API
- [ ] validate the data: overlaps? gaps?
- [ ] support segments from multiple videos
@@ -9,4 +12,6 @@
- [ ] related to above: don't re-render the progress bar to "done" or "empty" in current module
right before switch
- [ ] make it work decently for mobile!
- [Plyr.js](https://github.com/sampotts/plyr#api) might help with this
- [Svelte Wrapper](https://github.com/benwoodward/svelte-plyr#readme)
- [ ] either don't allow going before the first module, or fix it so that the first module isn't highlighted when watching the pre-module content (first solution is easier)

View File

@@ -44,10 +44,11 @@
}
const handleKeyDown = e => {
const { key, code } = e
if (e.ctrlKey || e.shiftKey || e.altKey || e.metaKey) {
const { key, code, ctrlKey } = e
if (e.shiftKey || e.altKey || e.metaKey) {
return
}
let amount = 5
if (["j", "ArrowDown"].includes(key)) {
e.preventDefault()
nextModule()
@@ -60,12 +61,18 @@
} else if (["l", "ArrowRight"].includes(key)) {
e.preventDefault()
clearInterval(interval)
video.jumpTo($position + 5)
if (ctrlKey) {
amount = 30
}
video.jumpTo($position + amount)
positionUpdater()
} else if (["h", "ArrowLeft"].includes(key)) {
e.preventDefault()
clearInterval(interval)
video.jumpTo($position - 5)
if (ctrlKey) {
amount = 30
}
video.jumpTo($position - amount)
positionUpdater()
}
}