fix: enable pulseaudio sharing on non-wayland sessions

This commit is contained in:
smartfrigde 2024-04-29 19:14:29 +02:00
parent 362a116e6a
commit fb50a89ce3

View file

@ -62,10 +62,14 @@ if (!app.requestSingleInstanceLock() && getConfigSync("multiInstance") == (false
app.commandLine.appendSwitch("disable-features", "WidgetLayering"); // fix dev tools layers app.commandLine.appendSwitch("disable-features", "WidgetLayering"); // fix dev tools layers
// Your data now belongs to CCP // Your data now belongs to CCP
crashReporter.start({uploadToServer: false}); crashReporter.start({uploadToServer: false});
// enable pulseaudio audio sharing on linux
if (process.platform === "linux") {
app.commandLine.appendSwitch("enable-features", "PulseaudioLoopbackForScreenShare");
app.commandLine.appendSwitch("disable-features", "WebRtcAllowInputVolumeAdjustment");
}
// enable webrtc capturer for wayland // enable webrtc capturer for wayland
if (process.platform === "linux" && process.env.XDG_SESSION_TYPE?.toLowerCase() === "wayland") { if (process.platform === "linux" && process.env.XDG_SESSION_TYPE?.toLowerCase() === "wayland") {
app.commandLine.appendSwitch("enable-features", "WebRTCPipeWireCapturer,PulseaudioLoopbackForScreenShare"); app.commandLine.appendSwitch("enable-features", "WebRTCPipeWireCapturer");
app.commandLine.appendSwitch("disable-features", "WebRtcAllowInputVolumeAdjustment");
console.log("Wayland detected, using PipeWire for video capture."); console.log("Wayland detected, using PipeWire for video capture.");
} }
// work around chrome 66 disabling autoplay by default // work around chrome 66 disabling autoplay by default