aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAjay Ramachandran <[email protected]>2020-10-08 22:15:50 -0400
committerGitHub <[email protected]>2020-10-08 22:15:50 -0400
commitc5a37cf4d618d417bfb3b5dc1d4ef356bc5a4b05 (patch)
treef7cd48740966d13b174f1aede36d869f9c82e9e9
parent43ea5cc3ec9849ed48df521d0cfcddaf8e746228 (diff)
parent34bcb120e52642805f7f61fe5c92c1e6c73702dc (diff)
downloadSponsorBlock-c5a37cf4d618d417bfb3b5dc1d4ef356bc5a4b05.tar.gz
SponsorBlock-c5a37cf4d618d417bfb3b5dc1d4ef356bc5a4b05.zip
Merge pull request #502 from SuspiciousActivity/patch-1
Fix: skipping to the end of looped videos #426
-rw-r--r--src/content.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/content.ts b/src/content.ts
index f4156d83..a2911f9a 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -1007,7 +1007,13 @@ 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]) {
- 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) {