Merge pull request #1174 from Stremio/feat/shortcut-playback-speed-increase-decrease

Shortcuts: Decrease "[" and increase "]" playback speed
This commit is contained in:
Timothy Z. 2026-03-26 19:54:01 +02:00 committed by GitHub
commit 1f56ddf8e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 28 additions and 6 deletions

View file

@ -41,7 +41,7 @@
"react-i18next": "^15.1.3",
"react-is": "18.3.1",
"spatial-navigation-polyfill": "github:Stremio/spatial-navigation#64871b1422466f5f45d24ebc8bbd315b2ebab6a6",
"stremio-translations": "github:Stremio/stremio-translations#fab271a6df6369ad98e21e5260d397752c9a9a5c",
"stremio-translations": "github:Stremio/stremio-translations#90ea718c18750a0e9cd6824b0ef7c512a41cb90b",
"url": "0.11.4",
"use-long-press": "^3.2.0"
},

View file

@ -90,8 +90,8 @@ importers:
specifier: github:Stremio/spatial-navigation#64871b1422466f5f45d24ebc8bbd315b2ebab6a6
version: https://codeload.github.com/Stremio/spatial-navigation/tar.gz/64871b1422466f5f45d24ebc8bbd315b2ebab6a6
stremio-translations:
specifier: github:Stremio/stremio-translations#fab271a6df6369ad98e21e5260d397752c9a9a5c
version: https://codeload.github.com/Stremio/stremio-translations/tar.gz/fab271a6df6369ad98e21e5260d397752c9a9a5c
specifier: github:Stremio/stremio-translations#90ea718c18750a0e9cd6824b0ef7c512a41cb90b
version: https://codeload.github.com/Stremio/stremio-translations/tar.gz/90ea718c18750a0e9cd6824b0ef7c512a41cb90b
url:
specifier: 0.11.4
version: 0.11.4
@ -4133,8 +4133,8 @@ packages:
resolution: {integrity: sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==}
engines: {node: '>= 0.4'}
stremio-translations@https://codeload.github.com/Stremio/stremio-translations/tar.gz/fab271a6df6369ad98e21e5260d397752c9a9a5c:
resolution: {tarball: https://codeload.github.com/Stremio/stremio-translations/tar.gz/fab271a6df6369ad98e21e5260d397752c9a9a5c}
stremio-translations@https://codeload.github.com/Stremio/stremio-translations/tar.gz/90ea718c18750a0e9cd6824b0ef7c512a41cb90b:
resolution: {tarball: https://codeload.github.com/Stremio/stremio-translations/tar.gz/90ea718c18750a0e9cd6824b0ef7c512a41cb90b}
version: 1.48.0
string-length@4.0.2:
@ -9378,7 +9378,7 @@ snapshots:
es-errors: 1.3.0
internal-slot: 1.1.0
stremio-translations@https://codeload.github.com/Stremio/stremio-translations/tar.gz/fab271a6df6369ad98e21e5260d397752c9a9a5c: {}
stremio-translations@https://codeload.github.com/Stremio/stremio-translations/tar.gz/90ea718c18750a0e9cd6824b0ef7c512a41cb90b: {}
string-length@4.0.2:
dependencies:

View file

@ -74,6 +74,16 @@
"label": "SETTINGS_SHORTCUT_SUBTITLES_DELAY",
"combos": [["G"], ["H"]]
},
{
"name": "speedDown",
"label": "SETTINGS_SHORTCUT_DECREASE_PLAYBACK_SPEED",
"combos": [["["]]
},
{
"name": "speedUp",
"label": "SETTINGS_SHORTCUT_INCREASE_PLAYBACK_SPEED",
"combos": [["]"]]
},
{
"name": "toggleSubtitles",
"label": "SETTINGS_SHORTCUT_TOGGLE_SUBTITLES",

View file

@ -717,6 +717,18 @@ const Player = ({ urlParams, queryParams }) => {
}
}, [video.state.playbackSpeed, toggleSpeedMenu]);
onShortcut('speedUp', () => {
if (video.state.playbackSpeed !== null) {
onPlaybackSpeedChanged(Math.min(video.state.playbackSpeed + 0.25, 2));
}
}, [video.state.playbackSpeed, onPlaybackSpeedChanged]);
onShortcut('speedDown', () => {
if (video.state.playbackSpeed !== null) {
onPlaybackSpeedChanged(Math.max(video.state.playbackSpeed - 0.25, 0.25));
}
}, [video.state.playbackSpeed, onPlaybackSpeedChanged]);
onShortcut('statisticsMenu', () => {
closeMenus();
const stream = player.selected?.stream;