It's "just" using Electron's built-in screencasting capability (`desktopCapturer`), and Electron supports both X11 screencasting and the xdg-desktop-portal+pipewire approach used by Wayland compositors.
Yes, that's right. But tbh, getting Mediastream in Electron can be done by a 5y old.
If you're using a recent Electron. Nearly everything (Discord, Slack, you name it) does not. This is all from memory, but I believe Wayland was "fixed" in Electron 19, but with a showstopper bug that was never backported. Many Electron apps are on 18 to this day.
Yes, I was just triggered by the "just" somehow :( it is not the hard part that I was trying to solve. The hard part is the UX/UI and the WebRTC part itself.
I believe you interpreted it exactly the opposite of what I wanted. I put "just" in quotes precisely to make the point that that there's a lot more to your application than getting the screencast buffer.