-
-
Notifications
You must be signed in to change notification settings - Fork 351
feat: allow patching video & audio devices into screen share #195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@Vendicated I need some help here, currently using a video device errors with |
7b615f5 to
273606b
Compare
273606b to
a62d162
Compare
a62d162 to
c94098c
Compare
432c1d6 to
fa5c6bd
Compare
d23e730 to
1e7cbb8
Compare
1e7cbb8 to
62c4e1c
Compare
03ae7c5 to
869d95a
Compare
869d95a to
8ae191f
Compare
|
Doesn't allow picking video patch on wayland - the modal is entirely skipped since the selection is done with the desktop portal instead of in the app. |
|
a lot has changed about the code since and now it has global state that it applies inside a getUserMedia patch. that'll likely solve your issues of only applying once! could you please rebase based on that? |
|
sorry for my useless comment, but this will make screen-sharing games on X11 finally bearable using my small tool (edit: i am talking as an NVIDIA proprietary driver user). if the dev of this pr cannot currently / doesn't have the time to rebase it, would it be possible for me to do it? |
This comment was marked as spam.
This comment was marked as spam.
8ae191f to
5b5edf4
Compare
|
I rewrote the implementation from scratch based on the latest code and added back audio device patching support; video device patching is on the roadmap as well :> |
5b5edf4 to
4d49e7e
Compare
|
i have been dailying this PR for three days now and I haven't encountered any issues yet. maybe a better UI can be implemented later, but for now i think it's OK. (huge thanks for the dev since this is what i personally needed for streaming in discord) update 4 Aug 2025: |
4d49e7e to
5133e70
Compare
5133e70 to
ed60441
Compare
|
@Vendicated any updates on the status of this PR? Would be great to have this merged in some form before the two-year mark rolls around. |
|
Branch has conflicts also you might want to join the Discord, might have better luck reaching the devs there. |
ed60441 to
f35e44f
Compare
| const [audioDevices, , audioDevicesPending] = useAwaiter( | ||
| () => navigator.mediaDevices.enumerateDevices().then(g => g.filter(d => d.kind === "audioinput")), | ||
| { fallbackValue: [] } | ||
| ); | ||
|
|
||
| const [videoDevices, , videoDevicesPending] = useAwaiter( | ||
| () => navigator.mediaDevices.enumerateDevices().then(g => g.filter(d => d.kind === "videoinput")), | ||
| { fallbackValue: [] } | ||
| ); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| const [audioDevices, , audioDevicesPending] = useAwaiter( | |
| () => navigator.mediaDevices.enumerateDevices().then(g => g.filter(d => d.kind === "audioinput")), | |
| { fallbackValue: [] } | |
| ); | |
| const [videoDevices, , videoDevicesPending] = useAwaiter( | |
| () => navigator.mediaDevices.enumerateDevices().then(g => g.filter(d => d.kind === "videoinput")), | |
| { fallbackValue: [] } | |
| ); | |
| const [[audioDevices, videoDevices], _deviceError, devicesPending] = useAwaiter( | |
| () => navigator.mediaDevices.enumerateDevices().then(devices => [ | |
| devices.filter(d => d.kind === "audioinput"), | |
| devices.filter(d => d.kind === "videoinput") | |
| ] as const), | |
| { fallbackValue: [[], []] as const } | |
| ); |
| }} | ||
| serialize={String} | ||
| popoutPosition="top" | ||
| closeOnSelect={true} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| closeOnSelect={true} | |
| closeOnSelect |
| }} | ||
| serialize={String} | ||
| popoutPosition="top" | ||
| closeOnSelect={true} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| closeOnSelect={true} | |
| closeOnSelect |
| navigator.mediaDevices.getDisplayMedia = async function (opts) { | ||
| const stream = await original.call(this, opts); | ||
|
|
||
| if (overrideDevices.audio) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this entire block is strange. why get temporary video & audio tracks just to remove them again and call getUserMedia for a second time? you can just set deviceId and similar properties on the options object before calling the original

This is useful when loopback audio drivers or applications, such as BlackHole, are already installed.