mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-08-09 14:47:43 +02:00
Rename States to STATES
This commit is contained in:
@@ -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 => {
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user