aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/shared
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/assets/player/shared')
-rw-r--r--client/src/assets/player/shared/hotkeys/peertube-hotkeys-plugin.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/client/src/assets/player/shared/hotkeys/peertube-hotkeys-plugin.ts b/client/src/assets/player/shared/hotkeys/peertube-hotkeys-plugin.ts
index 8255245b5..ec1e1038b 100644
--- a/client/src/assets/player/shared/hotkeys/peertube-hotkeys-plugin.ts
+++ b/client/src/assets/player/shared/hotkeys/peertube-hotkeys-plugin.ts
@@ -160,7 +160,7 @@ class PeerTubeHotkeysPlugin extends Plugin {
160 // 0-9 key handlers 160 // 0-9 key handlers
161 for (let i = 0; i < 10; i++) { 161 for (let i = 0; i < 10; i++) {
162 handlers.push({ 162 handlers.push({
163 accept: e => e.key === i + '' && !e.ctrlKey, // If using ctrl key, it's a web browser hotkey 163 accept: e => this.isNakedOrShift(e, i + ''),
164 cb: e => { 164 cb: e => {
165 e.preventDefault() 165 e.preventDefault()
166 166
@@ -190,6 +190,10 @@ class PeerTubeHotkeysPlugin extends Plugin {
190 private isNaked (event: KeyboardEvent, key: string) { 190 private isNaked (event: KeyboardEvent, key: string) {
191 return (!event.ctrlKey && !event.altKey && !event.metaKey && !event.shiftKey && event.key === key) 191 return (!event.ctrlKey && !event.altKey && !event.metaKey && !event.shiftKey && event.key === key)
192 } 192 }
193
194 private isNakedOrShift (event: KeyboardEvent, key: string) {
195 return (!event.ctrlKey && !event.altKey && !event.metaKey && event.key === key)
196 }
193} 197}
194 198
195videojs.registerPlugin('peerTubeHotkeysPlugin', PeerTubeHotkeysPlugin) 199videojs.registerPlugin('peerTubeHotkeysPlugin', PeerTubeHotkeysPlugin)