Skip to content

Commit e5472eb

Browse files
Fix duration time to consider playback rate
1 parent a1b2855 commit e5472eb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/content.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -843,8 +843,8 @@ function setupVideoListeners() {
843843
const rateChangeListener = () => {
844844
updateVirtualTime();
845845
clearWaitingTime();
846-
847846
startSponsorSchedule();
847+
updatePreviewBar();
848848
};
849849
getVideo().addEventListener('ratechange', rateChangeListener);
850850
// Used by videospeed extension (https://github.com/igrigorik/videospeed/pull/740)
@@ -2525,8 +2525,8 @@ function showTimeWithoutSkips(skippedDuration: number): void {
25252525

25262526
display.appendChild(duration);
25272527
}
2528-
2529-
const durationAfterSkips = getFormattedTime(getVideo()?.duration - skippedDuration);
2528+
2529+
const durationAfterSkips = getFormattedTime((getVideo()?.duration - skippedDuration)/(getVideo()?.playbackRate ?? 1));
25302530

25312531
duration.innerText = (durationAfterSkips == null || skippedDuration <= 0) ? "" : " (" + durationAfterSkips + ")";
25322532
}

0 commit comments

Comments
 (0)