mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-20 14:37:43 +01:00
Fix keyboard navigation conflicting while pausing playback.
This commit is contained in:
parent
e92e2146ed
commit
d980545375
1 changed files with 11 additions and 4 deletions
|
@ -118,10 +118,17 @@ export function KeyboardEvents() {
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
if (keyL === "f") dataRef.current.display?.toggleFullscreen();
|
if (keyL === "f") dataRef.current.display?.toggleFullscreen();
|
||||||
if (k === " " || keyL === "k")
|
if (k === " " || keyL === "k") {
|
||||||
dataRef.current.display?.[
|
if (
|
||||||
dataRef.current.mediaPlaying.isPaused ? "play" : "pause"
|
evt.target &&
|
||||||
]();
|
(evt.target as HTMLInputElement).nodeName === "BUTTON"
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const action = dataRef.current.mediaPlaying.isPaused ? "play" : "pause";
|
||||||
|
dataRef.current.display?.[action]();
|
||||||
|
}
|
||||||
if (k === "Escape") dataRef.current.router.close();
|
if (k === "Escape") dataRef.current.router.close();
|
||||||
|
|
||||||
// captions
|
// captions
|
||||||
|
|
Loading…
Reference in a new issue