Show max FPS value in Stats bar

This commit is contained in:
redphx 2024-10-14 21:06:52 +07:00
parent e5bd7e64a7
commit b969d52a3c
2 changed files with 5 additions and 2 deletions

View File

@ -26,7 +26,7 @@ export class WebGL2Player {
};
private targetFps = 60;
private frameInterval = Math.ceil(1000 / this.targetFps);
private frameInterval = 0;
private lastFrameTime = 0;
private animFrameId: number | null = null;

View File

@ -1,6 +1,8 @@
import { PrefKey } from "@/enums/pref-keys";
import { BxEvent } from "./bx-event";
import { STATES } from "./global";
import { humanFileSize, secondsToHm } from "./html";
import { getPref } from "./settings-storages/global-settings-storage";
export enum StreamStat {
PING = 'ping',
@ -121,7 +123,8 @@ export class StreamStatsCollector {
[StreamStat.FPS]: {
current: 0,
toString() {
return this.current.toString();
const maxFps = getPref(PrefKey.VIDEO_MAX_FPS);
return maxFps < 60 ? `${maxFps}/${this.current}` : this.current.toString();
},
},