From b4eff3b62b1a5c85c2f62f4a2bb389ce2f4e6daa Mon Sep 17 00:00:00 2001 From: Vendicated Date: Thu, 8 Jan 2026 15:54:40 +0100 Subject: [PATCH] Try to fix Screenshare loading issues on Vesktop --- src/plugins/webScreenShareFixes.web/index.ts | 27 +++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/plugins/webScreenShareFixes.web/index.ts b/src/plugins/webScreenShareFixes.web/index.ts index cce00ec8f..165d7b720 100644 --- a/src/plugins/webScreenShareFixes.web/index.ts +++ b/src/plugins/webScreenShareFixes.web/index.ts @@ -4,14 +4,25 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ +import { definePluginSettings } from "@api/Settings"; import { Devs } from "@utils/constants"; -import definePlugin from "@utils/types"; +import definePlugin, { OptionType } from "@utils/types"; + +const settings = definePluginSettings({ + experimentalAV1Support: { + type: OptionType.BOOLEAN, + description: "Enable AV1 codec support. May cause issues like infinitely loading streams", + default: false + } +}); export default definePlugin({ name: "WebScreenShareFixes", authors: [Devs.Kaitlyn], description: "Removes 2500kbps bitrate cap on chromium and vesktop clients.", enabledByDefault: true, + settings, + patches: [ { find: "x-google-max-bitrate", @@ -30,9 +41,19 @@ export default definePlugin({ }, { match: /\i\?\[(\i\.\i)\.H265,\i\.\i\.H264,\i\.\i\.VP8,\i\.\i\.VP9\]/, - replace: "true?['AV1',$1.H265,$1.VP9,$1.H264,$1.VP8]" + replace: "true?$self.getCodecs($1)" } ] } - ] + ], + + getCodecs(Codecs: Record) { + const codecs = [Codecs.H265, Codecs.VP9, Codecs.H264, Codecs.VP8]; + + if (settings.store.experimentalAV1Support) { + codecs.unshift("AV1"); + } + + return codecs; + } });