Skip to content

Commit

Permalink
subtitles offset keybinding
Browse files Browse the repository at this point in the history
  • Loading branch information
carlo-colombo committed Feb 10, 2024
1 parent 675a59a commit dd0b496
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/subtitlesync/subtitlesync.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,14 @@ class SubtitleSync {
subtitleSyncContainer.classList.add('hide');
}
}

update(updateValue) {
SubtitleSync.prototype.toggle();

const value = new Intl.NumberFormat({ maximumFractionDigits: 1 })
.format(updateValue(parseFloat(subtitleSyncSlider.value)));
subtitleSyncSlider.updateOffset(value);
}
}

export default SubtitleSync;
6 changes: 6 additions & 0 deletions src/controllers/playback/video/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1323,6 +1323,12 @@ export default function (view) {
case 'PageDown':
playbackManager.previousChapter(currentPlayer);
break;
case 'g':
SubtitleSync.prototype.update(v => v - 0.1);
break;
case 'h':
SubtitleSync.prototype.update(v => v + 0.1);
break;
}
}

Expand Down

0 comments on commit dd0b496

Please sign in to comment.