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