...
This commit is contained in:
@@ -41,6 +41,14 @@
|
|||||||
|
|
||||||
onMount(() => positionUpdater())
|
onMount(() => positionUpdater())
|
||||||
|
|
||||||
|
const toggle = video => {
|
||||||
|
if (video.paused()) {
|
||||||
|
video.play()
|
||||||
|
} else {
|
||||||
|
video.pause()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const handleKeyDown = e => {
|
const handleKeyDown = e => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
const { key, code } = e
|
const { key, code } = e
|
||||||
@@ -49,7 +57,7 @@
|
|||||||
} else if (["k", "ArrowUp"].includes(key)) {
|
} else if (["k", "ArrowUp"].includes(key)) {
|
||||||
prevModule()
|
prevModule()
|
||||||
} else if ([32, "Space"].includes(code)) {
|
} else if ([32, "Space"].includes(code)) {
|
||||||
video.toggle()
|
toggle(video)
|
||||||
} else if (["l", "ArrowRight"].includes(key)) {
|
} else if (["l", "ArrowRight"].includes(key)) {
|
||||||
clearInterval(interval)
|
clearInterval(interval)
|
||||||
video.jumpTo($position + 5)
|
video.jumpTo($position + 5)
|
||||||
|
|||||||
Reference in New Issue
Block a user