From c4f6c33f9d88e0e6651956dd5b07212b940ffea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20J=C3=BCrgens?= Date: Wed, 21 Sep 2022 17:32:41 +0200 Subject: [PATCH] display correct steam resolution --- assets/userscript.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/assets/userscript.js b/assets/userscript.js index 1227c5d..c7d2246 100644 --- a/assets/userscript.js +++ b/assets/userscript.js @@ -112,6 +112,7 @@ setInterval(() => { const initialDisplay = el.style.display; window.discordScreenaudioStartStream = (width, height, frameRate) => { + window.discordScreenaudioResolutionString = `${height}p ${frameRate}FPS`; setGetDisplayMedia({ audio: true, video: { width, height, frameRate }, @@ -147,6 +148,14 @@ setInterval(() => { // Remove stream settings if stream is active document.getElementById("manage-streams-change-windows")?.remove(); document.querySelector(`[aria-label="Stream Settings"]`)?.remove(); + + if (window.discordScreenaudioResolutionString) { + for (const el of document.getElementsByClassName( + "qualityIndicator-39wQDy" + )) { + el.innerHTML = window.discordScreenaudioResolutionString; + } + } }, 500); // Fix for broken discord notifications after restart