mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-06 19:47:04 +03:00
Add flag to disable virtual time
This commit is contained in:
@@ -67,6 +67,7 @@ interface SBConfig {
|
||||
showCategoryGuidelines: boolean;
|
||||
showCategoryWithoutPermission: boolean;
|
||||
showSegmentNameInChapterBar: boolean;
|
||||
useVirtualTime: boolean;
|
||||
|
||||
// Used to cache calculated text color info
|
||||
categoryPillColors: {
|
||||
@@ -200,6 +201,7 @@ const Config: SBObject = {
|
||||
showCategoryGuidelines: true,
|
||||
showCategoryWithoutPermission: false,
|
||||
showSegmentNameInChapterBar: true,
|
||||
useVirtualTime: true,
|
||||
|
||||
categoryPillColors: {},
|
||||
|
||||
|
||||
@@ -711,7 +711,8 @@ function getVirtualTime(): number {
|
||||
const virtualTime = lastTimeFromWaitingEvent ?? (lastKnownVideoTime.videoTime ?
|
||||
(performance.now() - lastKnownVideoTime.preciseTime) * video.playbackRate / 1000 + lastKnownVideoTime.videoTime : null);
|
||||
|
||||
if (!isSafari() && virtualTime && Math.abs(virtualTime - video.currentTime) < 0.6 && video.currentTime !== 0) {
|
||||
if (Config.config.useVirtualTime && !isSafari() && virtualTime
|
||||
&& Math.abs(virtualTime - video.currentTime) < 0.6 && video.currentTime !== 0) {
|
||||
return virtualTime;
|
||||
} else {
|
||||
return video.currentTime;
|
||||
|
||||
Reference in New Issue
Block a user