aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/assets')
-rw-r--r--client/src/assets/player/peertube-player.ts30
1 files changed, 30 insertions, 0 deletions
diff --git a/client/src/assets/player/peertube-player.ts b/client/src/assets/player/peertube-player.ts
index 2c16c87ec..1bf6c9267 100644
--- a/client/src/assets/player/peertube-player.ts
+++ b/client/src/assets/player/peertube-player.ts
@@ -70,6 +70,25 @@ function getVideojsOptions (options: {
70 hotkeys: { 70 hotkeys: {
71 enableVolumeScroll: false, 71 enableVolumeScroll: false,
72 enableModifiersForNumbers: false, 72 enableModifiersForNumbers: false,
73
74 fullscreenKey: function (event) {
75 // fullscreen with the f key or Ctrl+Enter
76 return event.key === 'f' || (event.ctrlKey && event.key === 'Enter')
77 },
78
79 seekStep: function (event) {
80 // mimic VLC seek behavior, and default to 5 (original value is 5).
81 if (event.ctrlKey && event.altKey) {
82 return 5 * 60
83 } else if (event.ctrlKey) {
84 return 60
85 } else if (event.altKey) {
86 return 10
87 } else {
88 return 5
89 }
90 },
91
73 customKeys: { 92 customKeys: {
74 increasePlaybackRateKey: { 93 increasePlaybackRateKey: {
75 key: function (event) { 94 key: function (event) {
@@ -86,6 +105,17 @@ function getVideojsOptions (options: {
86 handler: function (player) { 105 handler: function (player) {
87 player.playbackRate((player.playbackRate() - 0.1).toFixed(2)) 106 player.playbackRate((player.playbackRate() - 0.1).toFixed(2))
88 } 107 }
108 },
109 frameByFrame: {
110 key: function (event) {
111 return event.key === '.'
112 },
113 handler: function (player, options, event) {
114 player.pause()
115 // Calculate movement distance (assuming 30 fps)
116 const dist = 1 / 30
117 player.currentTime(player.currentTime() + dist)
118 }
89 } 119 }
90 } 120 }
91 } 121 }