Audio is Windows only

This commit is contained in:
V 2023-06-21 20:51:11 +02:00
parent 9044300a49
commit 001d881215
No known key found for this signature in database
GPG key ID: A1DC0CFB5615D905
3 changed files with 16 additions and 9 deletions

View file

@ -48,7 +48,7 @@ export function registerScreenShareHandler() {
const streams: Streams = { const streams: Streams = {
video: source video: source
}; };
if (choice.audio) streams.audio = "loopback"; if (choice.audio && process.platform === "win32") streams.audio = "loopback";
callback(streams); callback(streams);
}); });

View file

@ -10,6 +10,7 @@ import { classes, closeModal, Margins, Modals, openModal, useAwaiter } from "@ve
import { findByPropsLazy } from "@vencord/types/webpack"; import { findByPropsLazy } from "@vencord/types/webpack";
import { Button, Card, Forms, Switch, Text, useState } from "@vencord/types/webpack/common"; import { Button, Card, Forms, Switch, Text, useState } from "@vencord/types/webpack/common";
import type { Dispatch, SetStateAction } from "react"; import type { Dispatch, SetStateAction } from "react";
import { isWindows } from "renderer/utils";
const StreamResolutions = ["720", "1080", "1440", "Source"] as const; const StreamResolutions = ["720", "1080", "1440", "Source"] as const;
const StreamFps = ["15", "30", "60"] as const; const StreamFps = ["15", "30", "60"] as const;
@ -143,14 +144,16 @@ function StreamSettings({
</section> </section>
</div> </div>
<Switch {isWindows && (
value={settings.audio} <Switch
onChange={checked => setSettings(s => ({ ...s, audio: checked }))} value={settings.audio}
hideBorder onChange={checked => setSettings(s => ({ ...s, audio: checked }))}
className="vcd-screen-picker-audio" hideBorder
> className="vcd-screen-picker-audio"
Stream With Audio >
</Switch> Stream With Audio
</Switch>
)}
</Card> </Card>
</div> </div>
); );

View file

@ -12,3 +12,7 @@ export const isFirstRun = (() => {
localStorage.setItem(key, "false"); localStorage.setItem(key, "false");
return true; return true;
})(); })();
const { platform } = navigator;
export const isWindows = platform.startsWith("Win");