Skip to content

Commit

Permalink
Fix duration time to consider playback rate
Browse files Browse the repository at this point in the history
  • Loading branch information
vicente-higino committed Aug 28, 2023
1 parent a1b2855 commit e5472eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -843,8 +843,8 @@ function setupVideoListeners() {
const rateChangeListener = () => {
updateVirtualTime();
clearWaitingTime();

startSponsorSchedule();
updatePreviewBar();
};
getVideo().addEventListener('ratechange', rateChangeListener);
// Used by videospeed extension (https://github.com/igrigorik/videospeed/pull/740)
Expand Down Expand Up @@ -2525,8 +2525,8 @@ function showTimeWithoutSkips(skippedDuration: number): void {

display.appendChild(duration);
}

const durationAfterSkips = getFormattedTime(getVideo()?.duration - skippedDuration);
const durationAfterSkips = getFormattedTime((getVideo()?.duration - skippedDuration)/(getVideo()?.playbackRate ?? 1));

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

0 comments on commit e5472eb

Please sign in to comment.