mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-10 18:06:22 +00:00
Add NeverPausePreviews plugin
This commit is contained in:
parent
0b611a2911
commit
87ae710e3b
1 changed files with 35 additions and 0 deletions
35
src/plugins/NeverPausePreviews/index.ts
Normal file
35
src/plugins/NeverPausePreviews/index.ts
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
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",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
patches: [
|
||||||
|
{ //picture-in-picture player patch
|
||||||
|
find: "streamerPaused()",
|
||||||
|
replacement: {
|
||||||
|
match: /return (.{0,120})&&!.{1,2}}/,
|
||||||
|
replace: "return $1&&false}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ //in-call player patch #1 (keep stream playing)
|
||||||
|
find: /videoComponent:.{1,2},className:/,
|
||||||
|
replacement: {
|
||||||
|
match: "paused:p})",
|
||||||
|
replace: "paused:false})"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ //in-call player patch #2 (disable "your stream is still running" text overlay)
|
||||||
|
find: /let{mainText:.{1,2},supportingText:.{1,2}/,
|
||||||
|
replacement: {
|
||||||
|
match: /let{.{0,120};/,
|
||||||
|
replace: "return;"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
});
|
Loading…
Reference in a new issue