mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-12 22:47:18 +03:00
Add warning messages to catch weird not skipping bug
This commit is contained in:
@@ -456,6 +456,7 @@ function startSponsorSchedule(includeIntersectingSegments = false, currentTime?:
|
|||||||
// Reset lastCheckVideoTime
|
// Reset lastCheckVideoTime
|
||||||
lastCheckVideoTime = -1;
|
lastCheckVideoTime = -1;
|
||||||
lastCheckTime = 0;
|
lastCheckTime = 0;
|
||||||
|
console.warn("[SB] Ad playing, pausing skipping");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -548,7 +549,7 @@ function startSponsorSchedule(includeIntersectingSegments = false, currentTime?:
|
|||||||
} else {
|
} else {
|
||||||
const delayTime = timeUntilSponsor * 1000 * (1 / video.playbackRate);
|
const delayTime = timeUntilSponsor * 1000 * (1 / video.playbackRate);
|
||||||
if (delayTime < 300) {
|
if (delayTime < 300) {
|
||||||
// For Firefox, use interval instead of timeout near the end to combat imprecise video time
|
// Use interval instead of timeout near the end to combat imprecise video time
|
||||||
const startIntervalTime = performance.now();
|
const startIntervalTime = performance.now();
|
||||||
const startVideoTime = Math.max(currentTime, video.currentTime);
|
const startVideoTime = Math.max(currentTime, video.currentTime);
|
||||||
currentSkipInterval = setInterval(() => {
|
currentSkipInterval = setInterval(() => {
|
||||||
@@ -709,8 +710,12 @@ function setupVideoListeners() {
|
|||||||
|
|
||||||
cancelSponsorSchedule();
|
cancelSponsorSchedule();
|
||||||
};
|
};
|
||||||
video.addEventListener('pause', paused);
|
video.addEventListener('pause', () => paused());
|
||||||
video.addEventListener('waiting', paused);
|
video.addEventListener('waiting', () => {
|
||||||
|
paused();
|
||||||
|
|
||||||
|
console.warn("[SB] Not skipping due to buffering");
|
||||||
|
});
|
||||||
|
|
||||||
startSponsorSchedule();
|
startSponsorSchedule();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user