mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-13 06: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 (currentTime === undefined || currentTime === null) currentTime = video.currentTime;
|
||||
|
||||
previewBar.updateChapterText(sponsorTimes, currentTime);
|
||||
previewBar?.updateChapterText(sponsorTimes, currentTime);
|
||||
|
||||
if (video.paused) return;
|
||||
if (videoMuted && !inMuteSegment(currentTime)) {
|
||||
@@ -630,7 +630,7 @@ function setupVideoListeners() {
|
||||
|
||||
startSponsorSchedule();
|
||||
} else {
|
||||
previewBar.updateChapterText(sponsorTimes, video.currentTime);
|
||||
previewBar?.updateChapterText(sponsorTimes, video.currentTime);
|
||||
}
|
||||
});
|
||||
video.addEventListener('ratechange', () => startSponsorSchedule());
|
||||
|
||||
Reference in New Issue
Block a user