mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-07 16:17:20 +02:00
Combine "Resolution" and "Video" badges into one
This commit is contained in:
parent
d9288a322b
commit
8ac37754e6
@ -93,9 +93,14 @@ class StreamBadges {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static async render() {
|
static async render() {
|
||||||
let video;
|
let video = '';
|
||||||
|
if (StreamBadges.resolution) {
|
||||||
|
video = `${StreamBadges.resolution.width}x${StreamBadges.resolution.height}`;
|
||||||
|
}
|
||||||
|
|
||||||
if (StreamBadges.video) {
|
if (StreamBadges.video) {
|
||||||
video = StreamBadges.video.codec;
|
video && (video += '/');
|
||||||
|
video += StreamBadges.video.codec;
|
||||||
if (StreamBadges.video.profile) {
|
if (StreamBadges.video.profile) {
|
||||||
let profile = StreamBadges.video.profile;
|
let profile = StreamBadges.video.profile;
|
||||||
profile = profile.startsWith('4d') ? 'High' : (profile.startsWith('42') ? 'Normal' : profile);
|
profile = profile.startsWith('4d') ? 'High' : (profile.startsWith('42') ? 'Normal' : profile);
|
||||||
@ -133,7 +138,6 @@ class StreamBadges {
|
|||||||
batteryLevel ? ['battery', batteryLevel, '#008751'] : null,
|
batteryLevel ? ['battery', batteryLevel, '#008751'] : null,
|
||||||
['region', StreamBadges.region, '#ff6c24'],
|
['region', StreamBadges.region, '#ff6c24'],
|
||||||
['server', StreamBadges.ipv6 ? 'IPv6' : 'IPv4', '#065ab5'],
|
['server', StreamBadges.ipv6 ? 'IPv6' : 'IPv4', '#065ab5'],
|
||||||
StreamBadges.resolution && ['resolution', `${StreamBadges.resolution.width}x${StreamBadges.resolution.height}`, '#7e2553'],
|
|
||||||
video ? ['video', video, '#065AB5'] : null,
|
video ? ['video', video, '#065AB5'] : null,
|
||||||
audio ? ['audio', audio, '#5f574f'] : null,
|
audio ? ['audio', audio, '#5f574f'] : null,
|
||||||
];
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user