diff options
author | Ajay Ramachandran <[email protected]> | 2021-10-19 22:57:46 -0400 |
---|---|---|
committer | Ajay Ramachandran <[email protected]> | 2021-10-19 22:57:46 -0400 |
commit | 1e8b176c69704f96f25702afdc1bcd18e60ea575 (patch) | |
tree | 6fecfedc5bf3dfc282c1cdbf0d8b89cd5a67b512 | |
parent | 14018798f7f52dacc0b3bb49e50558aa91c1162b (diff) | |
download | SponsorBlock-1e8b176c69704f96f25702afdc1bcd18e60ea575.tar.gz SponsorBlock-1e8b176c69704f96f25702afdc1bcd18e60ea575.zip |
Allow finer tuned previewing
-rw-r--r-- | src/components/SponsorTimeEditComponent.tsx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/components/SponsorTimeEditComponent.tsx b/src/components/SponsorTimeEditComponent.tsx index 371228dd..d67d9d83 100644 --- a/src/components/SponsorTimeEditComponent.tsx +++ b/src/components/SponsorTimeEditComponent.tsx @@ -212,7 +212,7 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo {(!isNaN(segment[1]) && getCategoryActionType(sponsorTime.category) === CategoryActionType.Skippable) ? ( <span id={"sponsorTimePreviewButton" + this.idSuffix} className="sponsorTimeEditButton" - onClick={this.previewTime.bind(this)}> + onClick={(e) => this.previewTime(e.ctrlKey, e.shiftKey)}> {chrome.i18n.getMessage("preview")} </span> ): ""} @@ -436,13 +436,17 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo this.props.contentContainer().updatePreviewBar(); } - previewTime(): void { + previewTime(ctrlPressed = false, shiftPressed = false): void { const sponsorTimes = this.props.contentContainer().sponsorTimesSubmitting; const index = this.props.index; const skipTime = sponsorTimes[index].segment[0]; - this.props.contentContainer().previewTime(skipTime - (2 * this.props.contentContainer().v.playbackRate)); + let seekTime = 2; + if (ctrlPressed) seekTime = 0.5; + if (shiftPressed) seekTime = 0.25; + + this.props.contentContainer().previewTime(skipTime - (seekTime * this.props.contentContainer().v.playbackRate)); } inspectTime(): void { |