aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAjay <[email protected]>2021-12-29 00:30:24 -0500
committerAjay <[email protected]>2021-12-29 00:30:24 -0500
commit2db19711900e0a87ee8cb97df2d8645375a24413 (patch)
tree5ccdf39871dcaba515eb457bcb3dc64be3ba4893
parentc3107ffcff63938a035ebe211f9de452b211f5ab (diff)
downloadSponsorBlock-2db19711900e0a87ee8cb97df2d8645375a24413.tar.gz
SponsorBlock-2db19711900e0a87ee8cb97df2d8645375a24413.zip
Don't change countdown speed with playback speed
Fix #1067
-rw-r--r--src/components/NoticeComponent.tsx12
-rw-r--r--src/components/SkipNoticeComponent.tsx1
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}