Add getDisplayMedia and PipeWire support#1477
Conversation
This prevents the scenario where the promise never finishes.
|
I can confirm that this works with both Windows and Linux (Xorg), haven't tested Wayland. |
ronjouch
left a comment
There was a problem hiding this comment.
@johan12345 thanks! Hmmmmmm, looking at #1321 & comments, I see two remaining things to address:
- ✅ A smoke test
- 🔲 The last paragraph of #1321 (comment) , a "dialog element/browserwindow for screen share picker" . I'm okay to merge your PR without it (and I'd rather, actually, 2 small atomic PRs are better than one larger PR), but I just wanted to be sure it was fine with the original author (or you, now that you're pushing this)
|
|
||
| # ------------------------------------------------------------------------------ | ||
|
|
||
| printf '\n***** SMOKE TEST 4: Setting up test and building app... *****\n' |
|
Thanks @ronjouch! Yes, the comments that you added for the copy-pasted Yeah, I agree an improved UI using a dialog for the screen share picker could be tackled in a separate issue & PR. For me that would be fine (and I'm not sure how much time I would have to work on that myself in the short-term, so probably better to get this highly-requested feature merged sooner than later 🙂), and I think @RickStanley agreed to that as well in his original PR #1321:
|
|
Okay. Will re-review and merge soon. Thx. EDIT I no longer maintain Nativefier and no longer have merge/write permissions. I won't be merging this, but another maintainer might. |
|
@jiahaog Are there any plans to merge this in the future? It looks to me like you're the only maintainer on this project. Apologies if this isn't the right place to ask. |
|
I tested this with MS Teams on Wayland (Ubuntu 22.04) and it works basically the same as Teams in Chromium. Would be nice if this can be merged (I spent way to much time searching around until I found this PR...). |
|
I would very much like to be able to run MS Teams with screen sharing - if it's just silence from the maintainers maybe a fork would be an idea? |
|
Sorry for the silence. I'll take a look as soon as I can at this and see about getting it merged in. As well, I'd be curious to know for those waiting for this: is there an advantage of using Teams in this way (with Nativefier) over using it via a PWA app from the browser? I know redistribution would be one, but not sure if that was anyone's actual goal here. |
|
Thanks @TheCleric - I just like having Teams as it's own app separate from the browser. Independently launchable, separate window, won't go away when I bulk close all my tabs. Not a big deal but helps my workflow. |
| export function isWayland(): boolean { | ||
| return ( | ||
| isLinux() && | ||
| (Boolean(process.env.WAYLAND_DISPLAY) || |
There was a problem hiding this comment.
For the record Boolean or boolean on a string only returns its truthiness (i.e., is it not blank, null, nor undefined).
> Boolean('true')
true
> Boolean('false')
trueWe have written a parseBoolean function in src/utils/parseUtils.ts that should probably be copy and pasted here for use in the app.
There was a problem hiding this comment.
I think in this case Boolean is okay, as the WAYLAND_DISPLAY environment variable does not contain a "true"/"false" value, but rather the name of a display. So what we want to check here is just whether it has been set to some value (not null or empty) or not.
There was a problem hiding this comment.
Ahh, thanks for the clarification.
| function isWayland(): boolean { | ||
| return ( | ||
| isLinux() && | ||
| (Boolean(process.env.WAYLAND_DISPLAY) || |
There was a problem hiding this comment.
See above comment about parseBoolean
Just chiming in here, to backup @LukeAI. I too prefer Teams in a controlled, independently launchable sandbox away from my browser. I do this for Outlook as well, among others. |
|
Yep, same usecase for me, with the additional reason that I need two separate instances of Teams to sign in to different accounts/organizations. That is not possible with the PWA as far as I know, at least not on Linux. |
|
Don't use Teams, but verified this works great with Zoom. Thanks for the contribution. Will get it merged in, and try to get a release soon. This will be my first release (previously handled by ronjouch) so please be patient. May take a little while to make sure the permissions are setup and I don't mess it up. 😆 |
|
What about Mac? I hope this will allow screen sharing in teams on mac... Won't it? |
|
In principle it should, but I do not have a Mac to test. The original author in #1321 also said it was not tested on Mac. |
I am willing to test this with Google Meet as soon as a new release is put out. |
|
My test with Zoom was on a Mac, so I anticipate it should work. |
|
Looking forward to this being officially released. Any ETA for this? |
|
@TheCleric any ETA on when we can expect this in npm? Anything I can do to help? |
|
Apologies. This was released and is in the latest version. |
It doesn't work with Google Meet, though. Any idea why? |
I'm picking up @RickStanley's abandoned PR #1321 again to add screensharing support (fixes #927), with the following additional changes:
desktopCapturer.getSourcesmust be called from the main process, so I solved this with an IPC call../helpers/helpersin 'preload.ts' does not work, as was mentioned by @DimICE in Add getDisplayMedia and PipeWire support #1321 (comment). I'm not very familiar with TypeScript or Electron, so not sure why that is and how it could be solved - for now I just copied the referencedisWaylandfunction topreload.ts.As far as I understood from the discussion in #1321, the last point was basically the only thing that was missing to get this merged, correct?