Fixed looping sometimes not skipping beginning sponsors.

Resolves https://github.com/ajayyy/SponsorBlock/issues/306
This commit is contained in:
Ajay Ramachandran 2020-03-30 15:33:03 -04:00
parent 78dd44c502
commit b21a59f4e5

View file

@ -533,11 +533,10 @@ function sponsorsLookup(id: string, channelIDPromise?) {
startSponsorSchedule(); startSponsorSchedule();
} }
}); });
video.addEventListener('seeked', () => { video.addEventListener('seeking', () => {
if (!video.paused) startSponsorSchedule(); if (!video.paused) startSponsorSchedule();
}); });
video.addEventListener('ratechange', () => startSponsorSchedule()); video.addEventListener('ratechange', () => startSponsorSchedule());
video.addEventListener('seeking', cancelSponsorSchedule);
video.addEventListener('pause', cancelSponsorSchedule); video.addEventListener('pause', cancelSponsorSchedule);
startSponsorSchedule(); startSponsorSchedule();