Compare commits

...

5 Commits

Author SHA1 Message Date
Malte Jürgens
f01c941c90 add timeout to getAudioDevice 2022-08-01 22:26:44 +02:00
Malte Jürgens
95d391e869 fix remote debugging 2022-08-01 19:59:01 +02:00
Malte Jürgens
af107168db update metainfo description 2022-07-31 21:12:53 +02:00
Malte Jürgens
e7e6c5d82b update readme 2022-07-30 21:14:56 +02:00
Malte Jürgens
ee0c66762d add --enable-features=WebRTCPipeWireCapturer
Co-authored-by: edisionnano <samantas5855@gmail.com>
2022-07-30 21:09:30 +02:00
5 changed files with 29 additions and 7 deletions

View File

@@ -23,9 +23,8 @@ told you and it's not my fault.
## Known Issues
- Only works with **PipeWire**
- Only works on **X11**
- Can only share primary screen (no other screens or specific applications) (see
[#1](https://github.com/maltejur/discord-screenaudio/issues/1))
- Can only share primary screen on X11 (no other screens or specific applications)
(see [#1](https://github.com/maltejur/discord-screenaudio/issues/1))
## Installation

View File

@@ -13,6 +13,8 @@
<description>
<p>A very WIP custom discord client that supports streaming with audio on Linux, made possible by the great work of @edisionnano and the Rohrkabel library by @Curve.</p>
<p>The purpose of this project is not to provide an alternative to the original Discord client. Rather, it should be used in addition to the original client in case you want to stream something, maybe used with a second account. For anything else, this client has way too many things that work less well than in the original client.</p>
<p>Technically this could be against Discord's TOS, so be warned. Discord probably won't ban you for using this, but if they do I told you and it's not my fault.</p>
<p>Known issues:<ul><li>Only works with PipeWire</li><li>Can only share primary screen on X11</li></ul></p>
</description>
<launchable type="desktop-id">

View File

@@ -3,10 +3,15 @@
navigator.mediaDevices.chromiumGetDisplayMedia =
navigator.mediaDevices.getDisplayMedia;
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
const getAudioDevice = async (nameOfAudioDevice) => {
await navigator.mediaDevices.getUserMedia({
audio: true,
});
await sleep(500);
let devices = await navigator.mediaDevices.enumerateDevices();
let audioDevice = devices.find(({ label }) => label === nameOfAudioDevice);
return audioDevice;

View File

@@ -1,3 +1,5 @@
#include "main.h"
#include "mainwindow.h"
#include "virtmic.h"
@@ -20,16 +22,24 @@ int main(int argc, char *argv[]) {
QCommandLineOption virtmicOption("virtmic", "Start the Virtual Microphone",
"target");
parser.addOption(virtmicOption);
#ifdef DEBUG
parser.addOption(QCommandLineOption(
"remote-debugging-port", "Chromium Remote Debugging Port", "port"));
#endif
QCommandLineOption degubOption("remote-debugging",
"Open Chromium Remote Debugging on port 9222");
parser.addOption(degubOption);
parser.process(app);
if (parser.isSet(virtmicOption)) {
Virtmic::start(parser.value(virtmicOption));
}
qputenv("QTWEBENGINE_CHROMIUM_FLAGS",
"--enable-features=WebRTCPipeWireCapturer " +
qgetenv("QTWEBENGINE_CHROMIUM_FLAGS"));
if (parser.isSet(degubOption))
qputenv("QTWEBENGINE_CHROMIUM_FLAGS",
"--remote-debugging-port=9222 " +
qgetenv("QTWEBENGINE_CHROMIUM_FLAGS"));
MainWindow w;
w.show();

6
src/main.h Normal file
View File

@@ -0,0 +1,6 @@
#pragma once
#include <QString>
int main(int argc, char *argv[]);
void addToEnvVar(const char *var, const char *val);