From f1f45551f42ab0101d75b648a9706a9e0a784420 Mon Sep 17 00:00:00 2001 From: metzgegu <31687635+metzgegu@users.noreply.github.com> Date: Tue, 16 Nov 2021 15:04:29 +0100 Subject: [PATCH] Add hotkey to enable captions with "c" (#627) Co-authored-by: metzgegu --- src/components/Player.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Player.vue b/src/components/Player.vue index 9b424378..425e2e01 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -81,7 +81,7 @@ export default { .then(hotkeys => { this.hotkeys = hotkeys; var self = this; - hotkeys("f,m,j,k,l,space,up,down,left,right", function(e, handler) { + hotkeys("f,m,j,k,l,c,space,up,down,left,right", function(e, handler) { const videoEl = self.$refs.videoEl; switch (handler.key) { case "f": @@ -100,6 +100,10 @@ export default { videoEl.currentTime = videoEl.currentTime + 15; e.preventDefault(); break; + case "c": + self.$player.setTextTrackVisibility(!self.$player.isTextTrackVisible()); + e.preventDefault(); + break; case "k": case "space": if (videoEl.paused) videoEl.play();