mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Save playback speed rate, and restore when playing a video again
This commit is contained in:
parent
55e09b6466
commit
5ffe4aac8f
3 changed files with 13 additions and 0 deletions
|
@ -113,3 +113,4 @@
|
||||||
- [tikuf](https://github.com/tikuf/)
|
- [tikuf](https://github.com/tikuf/)
|
||||||
- [Tim Hobbs](https://github.com/timhobbs)
|
- [Tim Hobbs](https://github.com/timhobbs)
|
||||||
- [SvenVandenbrande](https://github.com/SvenVandenbrande)
|
- [SvenVandenbrande](https://github.com/SvenVandenbrande)
|
||||||
|
- [jomp16](https://github.com/jomp16)
|
||||||
|
|
|
@ -3602,6 +3602,9 @@ class PlaybackManager {
|
||||||
setPlaybackRate(value, player = this._currentPlayer) {
|
setPlaybackRate(value, player = this._currentPlayer) {
|
||||||
if (player && player.setPlaybackRate) {
|
if (player && player.setPlaybackRate) {
|
||||||
player.setPlaybackRate(value);
|
player.setPlaybackRate(value);
|
||||||
|
|
||||||
|
// Save the new playback rate in the browser session, to restore when playing a new video.
|
||||||
|
sessionStorage.setItem('playbackRateSpeed', value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -446,6 +446,7 @@ import { appRouter } from '../../../components/appRouter';
|
||||||
updatePlayerStateInternal(event, player, state);
|
updatePlayerStateInternal(event, player, state);
|
||||||
updatePlaylist();
|
updatePlaylist();
|
||||||
enableStopOnBack(true);
|
enableStopOnBack(true);
|
||||||
|
updatePlaybackRate(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1253,6 +1254,14 @@ import { appRouter } from '../../../components/appRouter';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updatePlaybackRate(player) {
|
||||||
|
// Restore playback speed control, if it exists in the session.
|
||||||
|
const playbackRateSpeed = sessionStorage.getItem('playbackRateSpeed');
|
||||||
|
if (playbackRateSpeed !== null) {
|
||||||
|
player.setPlaybackRate(playbackRateSpeed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
shell.enableFullscreen();
|
shell.enableFullscreen();
|
||||||
|
|
||||||
let currentPlayer;
|
let currentPlayer;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue