diff --git a/src/components/subtitlesync/subtitlesync.js b/src/components/subtitlesync/subtitlesync.js index 57ae63cb8c2e..aae73957e56f 100644 --- a/src/components/subtitlesync/subtitlesync.js +++ b/src/components/subtitlesync/subtitlesync.js @@ -151,6 +151,21 @@ class SubtitleSync { subtitleSyncContainer.classList.add('hide'); } } + + update(offset) { + this.toggle(); + + const value = parseFloat(subtitleSyncSlider.value) + offset; + subtitleSyncSlider.updateOffset(value); + } + + incrementOffset() { + this.update(+subtitleSyncSlider.step); + } + + decrementOffset() { + this.update(-subtitleSyncSlider.step); + } } export default SubtitleSync; diff --git a/src/controllers/playback/video/index.js b/src/controllers/playback/video/index.js index fbe4c3cecb70..3019e2bacdc1 100644 --- a/src/controllers/playback/video/index.js +++ b/src/controllers/playback/video/index.js @@ -1340,6 +1340,12 @@ export default function (view) { case 'PageDown': playbackManager.previousChapter(currentPlayer); break; + case 'g': + subtitleSyncOverlay?.decrementOffset(); + break; + case 'h': + subtitleSyncOverlay?.incrementOffset(); + break; } }