Audio is Windows only
This commit is contained in:
parent
9044300a49
commit
001d881215
3 changed files with 16 additions and 9 deletions
|
@ -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);
|
||||||
});
|
});
|
||||||
|
|
|
@ -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>
|
||||||
);
|
);
|
||||||
|
|
|
@ -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");
|
||||||
|
|
Reference in a new issue