Fix: skipping to the end of looped videos #426

This commit is contained in:
SuspiciousActivity
2020-10-07 00:26:19 +02:00
committed by GitHub
parent 43ea5cc3ec
commit 34bcb120e5

View File

@@ -1007,8 +1007,14 @@ function skipToTime(v: HTMLVideoElement, skipTime: number[], skippingSegments: S
let autoSkip: boolean = utils.getCategorySelection(skippingSegments[0].category)?.option === CategorySkipOption.AutoSkip;
if ((autoSkip || sponsorTimesSubmitting.includes(skippingSegments[0])) && v.currentTime !== skipTime[1]) {
// Fix for looped videos not working when skipping to the end #426
// for some reason you also can't skip to 1 second before the end
if (v.loop && v.duration > 1 && skipTime[1] >= v.duration - 1) {
v.currentTime = 0;
} else {
v.currentTime = skipTime[1];
}
}
if (openNotice) {
//send out the message saying that a sponsor message was skipped