display correct steam resolution

This commit is contained in:
Malte Jürgens 2022-09-21 17:32:41 +02:00
parent 758ffa8cb5
commit c4f6c33f9d
No known key found for this signature in database
GPG Key ID: D29FBD5F93C0CFC3
1 changed files with 9 additions and 0 deletions

View File

@ -112,6 +112,7 @@ setInterval(() => {
const initialDisplay = el.style.display; const initialDisplay = el.style.display;
window.discordScreenaudioStartStream = (width, height, frameRate) => { window.discordScreenaudioStartStream = (width, height, frameRate) => {
window.discordScreenaudioResolutionString = `${height}p ${frameRate}FPS`;
setGetDisplayMedia({ setGetDisplayMedia({
audio: true, audio: true,
video: { width, height, frameRate }, video: { width, height, frameRate },
@ -147,6 +148,14 @@ setInterval(() => {
// Remove stream settings if stream is active // Remove stream settings if stream is active
document.getElementById("manage-streams-change-windows")?.remove(); document.getElementById("manage-streams-change-windows")?.remove();
document.querySelector(`[aria-label="Stream Settings"]`)?.remove(); document.querySelector(`[aria-label="Stream Settings"]`)?.remove();
if (window.discordScreenaudioResolutionString) {
for (const el of document.getElementsByClassName(
"qualityIndicator-39wQDy"
)) {
el.innerHTML = window.discordScreenaudioResolutionString;
}
}
}, 500); }, 500);
// Fix for broken discord notifications after restart // Fix for broken discord notifications after restart