mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-12 19:01:47 +00:00
Keep segments when skipping
This commit is contained in:
@ -12,16 +12,16 @@ module.exports = () => {
|
||||
});
|
||||
|
||||
ontimeupdate((videoElement) => {
|
||||
if (
|
||||
currentSegments.length > 0 &&
|
||||
videoElement.currentTime >= currentSegments[0][0] &&
|
||||
videoElement.currentTime <= currentSegments[0][1]
|
||||
) {
|
||||
videoElement.currentTime = currentSegments[0][1];
|
||||
const skipped = currentSegments.shift();
|
||||
if (is.dev()) {
|
||||
console.log("SponsorBlock: skipping segment", skipped);
|
||||
currentSegments.forEach((segment) => {
|
||||
if (
|
||||
videoElement.currentTime >= segment[0] &&
|
||||
videoElement.currentTime <= segment[1]
|
||||
) {
|
||||
videoElement.currentTime = segment[1];
|
||||
if (is.dev()) {
|
||||
console.log("SponsorBlock: skipping segment", segment);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user