mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-15 07:57:09 +03:00
Fix crash from preview bar not being defined yet
This commit is contained in:
@@ -449,7 +449,7 @@ function startSponsorSchedule(includeIntersectingSegments = false, currentTime?:
|
|||||||
if (!video) return;
|
if (!video) return;
|
||||||
if (currentTime === undefined || currentTime === null) currentTime = video.currentTime;
|
if (currentTime === undefined || currentTime === null) currentTime = video.currentTime;
|
||||||
|
|
||||||
previewBar.updateChapterText(sponsorTimes, currentTime);
|
previewBar?.updateChapterText(sponsorTimes, currentTime);
|
||||||
|
|
||||||
if (video.paused) return;
|
if (video.paused) return;
|
||||||
if (videoMuted && !inMuteSegment(currentTime)) {
|
if (videoMuted && !inMuteSegment(currentTime)) {
|
||||||
@@ -630,7 +630,7 @@ function setupVideoListeners() {
|
|||||||
|
|
||||||
startSponsorSchedule();
|
startSponsorSchedule();
|
||||||
} else {
|
} else {
|
||||||
previewBar.updateChapterText(sponsorTimes, video.currentTime);
|
previewBar?.updateChapterText(sponsorTimes, video.currentTime);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
video.addEventListener('ratechange', () => startSponsorSchedule());
|
video.addEventListener('ratechange', () => startSponsorSchedule());
|
||||||
|
|||||||
Reference in New Issue
Block a user