From 7e16a1f95457a4edfe22ece3789c45e59bad7306 Mon Sep 17 00:00:00 2001 From: vappster Date: Fri, 7 Jun 2024 20:18:07 +0200 Subject: [PATCH] Added license header, avoid regex in finds, made requested edits --- src/plugins/NeverPausePreviews/index.ts | 30 ++++++++++++++++++------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/plugins/NeverPausePreviews/index.ts b/src/plugins/NeverPausePreviews/index.ts index d754b51cb..495b19c31 100644 --- a/src/plugins/NeverPausePreviews/index.ts +++ b/src/plugins/NeverPausePreviews/index.ts @@ -1,14 +1,28 @@ +/* + * Vencord, a modification for Discord's desktop app + * Copyright (c) 2022 Vendicated and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . +*/ + +import { Devs } from "@utils/constants"; import definePlugin from "@utils/types"; export default definePlugin({ name: "NeverPausePreviews", description: "Prevents in-call/PiP previews (screenshare, streams, etc) from pausing even if the client loses focus", - authors: [ - { - id: 747192967311261748n, - name: "vappster", - }, - ], + authors: [Devs.vappster], patches: [ { //picture-in-picture player patch find: "streamerPaused()", @@ -18,14 +32,14 @@ export default definePlugin({ } }, { //in-call player patch #1 (keep stream playing) - find: /videoComponent:.{1,2},className:/, + find: "VideoStreamFit:", replacement: { match: /paused:.{1,2}}\)/, replace: "paused:false})" } }, { //in-call player patch #2 (disable "your stream is still running" text overlay) - find: /let{mainText:.{1,2},supportingText:.{1,2}/, + find: "let{mainText:", replacement: { match: /let{.{0,120};/, replace: "return;"