Support server side rendered ads

Fixes #2035
This commit is contained in:
Ajay
2024-06-23 00:03:03 +05:30
parent 5c279d80df
commit 4bbd59b988
4 changed files with 69 additions and 69 deletions

View File

@@ -15,7 +15,7 @@ import { downvoteButtonColor, SkipNoticeAction } from "../utils/noticeUtils";
import { generateUserID } from "../../maze-utils/src/setup";
import { keybindToString } from "../../maze-utils/src/config";
import { getFormattedTime } from "../../maze-utils/src/formating";
import { getVideo } from "../../maze-utils/src/video";
import { getCurrentTime, getVideo } from "../../maze-utils/src/video";
enum SkipButtonState {
Undo, // Unskip
@@ -686,7 +686,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] - getVideo().currentTime) * (1 / getVideo().playbackRate));
const duration = Math.round((sponsorTime.segment[1] - getCurrentTime()) * (1 / getVideo().playbackRate));
return Math.max(duration, Config.config.skipNoticeDuration);
};