mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 05:27:03 +03:00
Added back whitelist support
This commit is contained in:
@@ -435,17 +435,19 @@ function cancelSponsorSchedule(): void {
|
|||||||
function startSponsorSchedule(currentTime?: number): void {
|
function startSponsorSchedule(currentTime?: number): void {
|
||||||
cancelSponsorSchedule();
|
cancelSponsorSchedule();
|
||||||
|
|
||||||
if (Config.config.disableSkipping || sponsorTimes === null) return;
|
if (sponsorTimes === null || Config.config.disableSkipping || channelWhitelisted){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (currentTime === undefined) currentTime = video.currentTime;
|
if (currentTime === undefined) currentTime = video.currentTime;
|
||||||
|
|
||||||
let skipInfo = getNextSkipIndex(currentTime);
|
let skipInfo = getNextSkipIndex(currentTime);
|
||||||
|
|
||||||
let skipStartTime = skipInfo.array[skipInfo.index][0];
|
let skipTime = skipInfo.array[skipInfo.index];
|
||||||
let timeUntilSponsor = skipStartTime - currentTime;
|
let timeUntilSponsor = skipTime[0] - currentTime;
|
||||||
|
|
||||||
currentSkipSchedule = setTimeout(() => {
|
currentSkipSchedule = setTimeout(() => {
|
||||||
if (video.currentTime >= skipStartTime) {
|
if (video.currentTime >= skipTime[0] && video.currentTime < skipTime[1]) {
|
||||||
skipToTime(video, skipInfo.index, skipInfo.array, skipInfo.openNotice);
|
skipToTime(video, skipInfo.index, skipInfo.array, skipInfo.openNotice);
|
||||||
|
|
||||||
startSponsorSchedule();
|
startSponsorSchedule();
|
||||||
|
|||||||
Reference in New Issue
Block a user