Skip to content

Commit

Permalink
Handle video being null in skip notice
Browse files Browse the repository at this point in the history
Resolves #2201
  • Loading branch information
ajayyy committed Feb 3, 2025
1 parent 5c7e3b5 commit 19efcb5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/SkipNoticeComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
getFullDurationCountdown(index: number): () => number {
return () => {
const sponsorTime = this.segments[index];
const duration = Math.round((sponsorTime.segment[1] - getCurrentTime()) * (1 / getVideo().playbackRate));
const duration = Math.round((sponsorTime.segment[1] - getCurrentTime()) * (1 / (getVideo()?.playbackRate ?? 1)));

return Math.max(duration, Config.config.skipNoticeDuration);
};
Expand Down

0 comments on commit 19efcb5

Please sign in to comment.