diff options
author | Ajay <[email protected]> | 2021-12-29 00:30:24 -0500 |
---|---|---|
committer | Ajay <[email protected]> | 2021-12-29 00:30:24 -0500 |
commit | 2db19711900e0a87ee8cb97df2d8645375a24413 (patch) | |
tree | 5ccdf39871dcaba515eb457bcb3dc64be3ba4893 | |
parent | c3107ffcff63938a035ebe211f9de452b211f5ab (diff) | |
download | SponsorBlock-2db19711900e0a87ee8cb97df2d8645375a24413.tar.gz SponsorBlock-2db19711900e0a87ee8cb97df2d8645375a24413.zip |
Don't change countdown speed with playback speed
Fix #1067
-rw-r--r-- | src/components/NoticeComponent.tsx | 12 | ||||
-rw-r--r-- | src/components/SkipNoticeComponent.tsx | 1 |
2 files changed, 1 insertions, 12 deletions
diff --git a/src/components/NoticeComponent.tsx b/src/components/NoticeComponent.tsx index d7307bca..c3128e72 100644 --- a/src/components/NoticeComponent.tsx +++ b/src/components/NoticeComponent.tsx @@ -16,8 +16,6 @@ export interface NoticeProps { timed?: boolean, idSuffix?: string, - videoSpeed?: () => number, - fadeIn?: boolean, startFaded?: boolean, firstColumn?: React.ReactElement, @@ -51,7 +49,6 @@ export interface NoticeState { class NoticeComponent extends React.Component<NoticeProps, NoticeState> { countdownInterval: NodeJS.Timeout; - intervalVideoSpeed: number; idSuffix: string; @@ -259,10 +256,6 @@ class NoticeComponent extends React.Component<NoticeProps, NoticeState> { const countdownTime = Math.min(this.state.countdownTime - 1, this.state.maxCountdownTime()); - if (this.props.videoSpeed && this.intervalVideoSpeed != this.props.videoSpeed()) { - this.setupInterval(); - } - if (countdownTime <= 0) { //remove this from setInterval clearInterval(this.countdownInterval); @@ -325,10 +318,7 @@ class NoticeComponent extends React.Component<NoticeProps, NoticeState> { setupInterval(): void { if (this.countdownInterval) clearInterval(this.countdownInterval); - const intervalDuration = this.props.videoSpeed ? 1000 / this.props.videoSpeed() : 1000; - this.countdownInterval = setInterval(this.countdown.bind(this), intervalDuration); - - if (this.props.videoSpeed) this.intervalVideoSpeed = this.props.videoSpeed(); + this.countdownInterval = setInterval(this.countdown.bind(this), 1000); } resetCountdown(): void { diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx index 002218b6..da771853 100644 --- a/src/components/SkipNoticeComponent.tsx +++ b/src/components/SkipNoticeComponent.tsx @@ -177,7 +177,6 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta || (Config.config.noticeVisibilityMode >= NoticeVisbilityMode.FadedForAutoSkip && this.autoSkip)} timed={true} maxCountdownTime={this.state.maxCountdownTime} - videoSpeed={() => this.contentContainer().v?.playbackRate} style={noticeStyle} biggerCloseButton={this.contentContainer().onMobileYouTube} ref={this.noticeRef} |