mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-14 15:37:12 +03:00
Fix cases where skipping sometimes doesn't work
Should fix compatibility with new update to Enhancer for YouTube Should fix #2138
This commit is contained in:
@@ -877,8 +877,7 @@ function incorrectVideoCheck(videoID?: string, sponsorTime?: SponsorTime): boole
|
|||||||
let playbackRateCheckInterval: NodeJS.Timeout | null = null;
|
let playbackRateCheckInterval: NodeJS.Timeout | null = null;
|
||||||
let lastPlaybackSpeed = 1;
|
let lastPlaybackSpeed = 1;
|
||||||
let setupVideoListenersFirstTime = true;
|
let setupVideoListenersFirstTime = true;
|
||||||
function setupVideoListeners() {
|
function setupVideoListeners(video: HTMLVideoElement) {
|
||||||
const video = getVideo();
|
|
||||||
if (!video) return; // Maybe video became invisible
|
if (!video) return; // Maybe video became invisible
|
||||||
|
|
||||||
//wait until it is loaded
|
//wait until it is loaded
|
||||||
@@ -1460,10 +1459,10 @@ async function channelIDChange(channelIDInfo: ChannelIDInfo) {
|
|||||||
if (Config.config.forceChannelCheck && sponsorTimes?.length > 0) startSkipScheduleCheckingForStartSponsors();
|
if (Config.config.forceChannelCheck && sponsorTimes?.length > 0) startSkipScheduleCheckingForStartSponsors();
|
||||||
}
|
}
|
||||||
|
|
||||||
function videoElementChange(newVideo: boolean): void {
|
function videoElementChange(newVideo: boolean, video: HTMLVideoElement): void {
|
||||||
waitFor(() => Config.isReady()).then(() => {
|
waitFor(() => Config.isReady()).then(() => {
|
||||||
if (newVideo) {
|
if (newVideo) {
|
||||||
setupVideoListeners();
|
setupVideoListeners(video);
|
||||||
setupSkipButtonControlBar();
|
setupSkipButtonControlBar();
|
||||||
setupCategoryPill();
|
setupCategoryPill();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user