diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index f0eb21e6df..6811962cc7 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -113,3 +113,4 @@ - [tikuf](https://github.com/tikuf/) - [Tim Hobbs](https://github.com/timhobbs) - [SvenVandenbrande](https://github.com/SvenVandenbrande) + - [jomp16](https://github.com/jomp16) diff --git a/src/components/playback/playbackmanager.js b/src/components/playback/playbackmanager.js index 85da076c5d..722ca522ce 100644 --- a/src/components/playback/playbackmanager.js +++ b/src/components/playback/playbackmanager.js @@ -3602,6 +3602,9 @@ class PlaybackManager { setPlaybackRate(value, player = this._currentPlayer) { if (player && player.setPlaybackRate) { player.setPlaybackRate(value); + + // Save the new playback rate in the browser session, to restore when playing a new video. + sessionStorage.setItem('playbackRateSpeed', value); } } diff --git a/src/controllers/playback/video/index.js b/src/controllers/playback/video/index.js index 96bb5eeb30..0ae93a63ed 100644 --- a/src/controllers/playback/video/index.js +++ b/src/controllers/playback/video/index.js @@ -446,6 +446,7 @@ import { appRouter } from '../../../components/appRouter'; updatePlayerStateInternal(event, player, state); updatePlaylist(); 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(); let currentPlayer;