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 Jun 8, 2024
1 parent 97d03f3 commit ba58851
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/subtitlesync/subtitlesync.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,13 @@ class SubtitleSync {
subtitleSyncContainer.classList.add('hide');
}
}

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

const value = 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 @@ -1340,6 +1340,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 ba58851

Please sign in to comment.