mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-11-13 02:14:23 +01:00
Reverse "requested changes"
This commit is contained in:
parent
02a9238869
commit
7b0488d068
1 changed files with 62 additions and 56 deletions
|
@ -41,6 +41,9 @@ var sponsorSkipped: boolean[] = [];
|
|||
//the video
|
||||
var video: HTMLVideoElement;
|
||||
|
||||
/** The last time this video was seeking to */
|
||||
var lastVideoTime: number = null;
|
||||
|
||||
var onInvidious;
|
||||
var onMobileYouTube;
|
||||
|
||||
|
@ -281,9 +284,6 @@ function resetValues() {
|
|||
} else {
|
||||
switchingVideos = true;
|
||||
}
|
||||
|
||||
// Reset advert playing flag
|
||||
isAdPlaying = false;
|
||||
}
|
||||
|
||||
async function videoIDChange(id) {
|
||||
|
@ -473,6 +473,8 @@ function startSponsorSchedule(includeIntersectingSegments: boolean = false, curr
|
|||
// Reset lastCheckVideoTime
|
||||
lastCheckVideoTime = -1;
|
||||
lastCheckTime = 0;
|
||||
|
||||
lastVideoTime = video.currentTime;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -566,8 +568,6 @@ function sponsorsLookup(id: string) {
|
|||
video.addEventListener('play', () => {
|
||||
switchingVideos = false;
|
||||
|
||||
updateAdFlag();
|
||||
|
||||
// Make sure it doesn't get double called with the playing event
|
||||
if (lastCheckVideoTime !== video.currentTime && Date.now() - lastCheckTime > 2000) {
|
||||
lastCheckTime = Date.now();
|
||||
|
@ -575,6 +575,8 @@ function sponsorsLookup(id: string) {
|
|||
|
||||
startSponsorSchedule();
|
||||
}
|
||||
|
||||
updateAdFlag();
|
||||
});
|
||||
video.addEventListener('playing', () => {
|
||||
// Make sure it doesn't get double called with the play event
|
||||
|
@ -590,6 +592,8 @@ function sponsorsLookup(id: string) {
|
|||
lastCheckVideoTime = -1
|
||||
lastCheckTime = 0;
|
||||
|
||||
lastVideoTime = video.currentTime;
|
||||
|
||||
if (!video.paused){
|
||||
startSponsorSchedule();
|
||||
}
|
||||
|
@ -600,6 +604,8 @@ function sponsorsLookup(id: string) {
|
|||
lastCheckVideoTime = -1;
|
||||
lastCheckTime = 0;
|
||||
|
||||
lastVideoTime = video.currentTime;
|
||||
|
||||
cancelSponsorSchedule();
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue