mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-13 15:07:02 +03:00
Requested changes
This commit is contained in:
@@ -41,9 +41,6 @@ var sponsorSkipped: boolean[] = [];
|
|||||||
//the video
|
//the video
|
||||||
var video: HTMLVideoElement;
|
var video: HTMLVideoElement;
|
||||||
|
|
||||||
/** The last time this video was seeking to */
|
|
||||||
var lastVideoTime: number = null;
|
|
||||||
|
|
||||||
var onInvidious;
|
var onInvidious;
|
||||||
var onMobileYouTube;
|
var onMobileYouTube;
|
||||||
|
|
||||||
@@ -284,6 +281,9 @@ function resetValues() {
|
|||||||
} else {
|
} else {
|
||||||
switchingVideos = true;
|
switchingVideos = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reset advert playing flag
|
||||||
|
isAdPlaying = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function videoIDChange(id) {
|
async function videoIDChange(id) {
|
||||||
@@ -473,8 +473,6 @@ function startSponsorSchedule(includeIntersectingSegments: boolean = false, curr
|
|||||||
// Reset lastCheckVideoTime
|
// Reset lastCheckVideoTime
|
||||||
lastCheckVideoTime = -1;
|
lastCheckVideoTime = -1;
|
||||||
lastCheckTime = 0;
|
lastCheckTime = 0;
|
||||||
|
|
||||||
lastVideoTime = video.currentTime;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -570,6 +568,8 @@ function sponsorsLookup(id: string) {
|
|||||||
video.addEventListener('play', () => {
|
video.addEventListener('play', () => {
|
||||||
switchingVideos = false;
|
switchingVideos = false;
|
||||||
|
|
||||||
|
updateAdFlag();
|
||||||
|
|
||||||
// Make sure it doesn't get double called with the playing event
|
// Make sure it doesn't get double called with the playing event
|
||||||
if (lastCheckVideoTime !== video.currentTime && Date.now() - lastCheckTime > 2000) {
|
if (lastCheckVideoTime !== video.currentTime && Date.now() - lastCheckTime > 2000) {
|
||||||
lastCheckTime = Date.now();
|
lastCheckTime = Date.now();
|
||||||
@@ -577,8 +577,6 @@ function sponsorsLookup(id: string) {
|
|||||||
|
|
||||||
startSponsorSchedule();
|
startSponsorSchedule();
|
||||||
}
|
}
|
||||||
|
|
||||||
updateAdFlag();
|
|
||||||
});
|
});
|
||||||
video.addEventListener('playing', () => {
|
video.addEventListener('playing', () => {
|
||||||
// Make sure it doesn't get double called with the play event
|
// Make sure it doesn't get double called with the play event
|
||||||
@@ -594,8 +592,6 @@ function sponsorsLookup(id: string) {
|
|||||||
lastCheckVideoTime = -1
|
lastCheckVideoTime = -1
|
||||||
lastCheckTime = 0;
|
lastCheckTime = 0;
|
||||||
|
|
||||||
lastVideoTime = video.currentTime;
|
|
||||||
|
|
||||||
if (!video.paused){
|
if (!video.paused){
|
||||||
startSponsorSchedule();
|
startSponsorSchedule();
|
||||||
}
|
}
|
||||||
@@ -606,8 +602,6 @@ function sponsorsLookup(id: string) {
|
|||||||
lastCheckVideoTime = -1;
|
lastCheckVideoTime = -1;
|
||||||
lastCheckTime = 0;
|
lastCheckTime = 0;
|
||||||
|
|
||||||
lastVideoTime = video.currentTime;
|
|
||||||
|
|
||||||
cancelSponsorSchedule();
|
cancelSponsorSchedule();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user