Rename States to STATES

This commit is contained in:
redphx
2024-04-24 17:09:39 +07:00
parent fd0f0799ee
commit 06ffcf20f7
17 changed files with 88 additions and 88 deletions

View File

@@ -1,7 +1,7 @@
import { t } from "../translation";
import { BxEvent } from "../bx-event";
import { CE } from "../../utils/html";
import { States } from "../../utils/global";
import { STATES } from "../../utils/global";
enum StreamBadge {
PLAYTIME = 'playtime',
@@ -86,7 +86,7 @@ export class StreamBadges {
} catch(e) {}
}
const stats = await States.currentStream.peerConnection?.getStats()!;
const stats = await STATES.currentStream.peerConnection?.getStats()!;
let totalIn = 0;
let totalOut = 0;
stats.forEach(stat => {

View File

@@ -4,7 +4,7 @@ import { getPref } from "../preferences"
import { StreamBadges } from "./stream-badges"
import { CE } from "../../utils/html"
import { t } from "../translation"
import { States } from "../../utils/global"
import { STATES } from "../../utils/global"
export enum StreamStat {
PING = 'ping',
@@ -106,13 +106,13 @@ export class StreamStats {
}
static update() {
if (StreamStats.isHidden() || !States.currentStream.peerConnection) {
if (StreamStats.isHidden() || !STATES.currentStream.peerConnection) {
StreamStats.onStoppedPlaying();
return;
}
const PREF_STATS_CONDITIONAL_FORMATTING = getPref(PrefKey.STATS_CONDITIONAL_FORMATTING);
States.currentStream.peerConnection.getStats().then(stats => {
STATES.currentStream.peerConnection.getStats().then(stats => {
stats.forEach(stat => {
let grade = '';
if (stat.type === 'inbound-rtp' && stat.kind === 'video') {
@@ -214,7 +214,7 @@ export class StreamStats {
}
static getServerStats() {
States.currentStream.peerConnection && States.currentStream.peerConnection.getStats().then(stats => {
STATES.currentStream.peerConnection && STATES.currentStream.peerConnection.getStats().then(stats => {
const allVideoCodecs: {[index: string]: RTCBasicStat} = {};
let videoCodecId;

View File

@@ -1,4 +1,4 @@
import { States } from "../../utils/global";
import { STATES } from "../../utils/global";
import { Icon } from "../../utils/html";
import { BxEvent } from "../bx-event";
import { PrefKey, getPref } from "../preferences";
@@ -93,7 +93,7 @@ function cloneStreamHudButton($orgButton: HTMLElement, label: string, svgIcon: I
}
};
if (States.hasTouchSupport) {
if (STATES.hasTouchSupport) {
$container.addEventListener('transitionstart', onTransitionStart);
$container.addEventListener('transitionend', onTransitionEnd);
}