This commit is contained in:
redphx
2024-12-05 17:10:39 +07:00
parent c836e33f7b
commit 9199351af1
207 changed files with 9833 additions and 6953 deletions

18
src/utils/stream-stats-collector.ts Normal file → Executable file
View File

@@ -4,21 +4,7 @@ import { STATES } from "./global";
import { humanFileSize, secondsToHm } from "./html";
import { getPref } from "./settings-storages/global-settings-storage";
import { BxLogger } from "./bx-logger";
export enum StreamStat {
PING = 'ping',
JITTER = 'jit',
FPS = 'fps',
BITRATE = 'btr',
DECODE_TIME = 'dt',
PACKETS_LOST = 'pl',
FRAMES_LOST = 'fl',
DOWNLOAD = 'dl',
UPLOAD = 'ul',
PLAYTIME = 'play',
BATTERY = 'batt',
CLOCK = 'time',
};
import { StreamStat } from "@/enums/pref-values";
export type StreamStatGrade = '' | 'bad' | 'ok' | 'good';
@@ -125,7 +111,7 @@ export class StreamStatsCollector {
[StreamStat.FPS]: {
current: 0,
toString() {
const maxFps = getPref(PrefKey.VIDEO_MAX_FPS);
const maxFps = getPref<VideoMaxFps>(PrefKey.VIDEO_MAX_FPS);
return maxFps < 60 ? `${maxFps}/${this.current}` : this.current.toString();
},
},