Skip to content
This repository was archived by the owner on Sep 29, 2023. It is now read-only.

Add getDisplayMedia and PipeWire support#1477

Merged
TheCleric merged 12 commits into
nativefier:masterfrom
johan12345:master
Mar 23, 2023
Merged

Add getDisplayMedia and PipeWire support#1477
TheCleric merged 12 commits into
nativefier:masterfrom
johan12345:master

Conversation

@johan12345

@johan12345 johan12345 commented Nov 2, 2022

Copy link
Copy Markdown
Contributor

I'm picking up @RickStanley's abandoned PR #1321 again to add screensharing support (fixes #927), with the following additional changes:

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?

@johan12345

Copy link
Copy Markdown
Contributor Author

I can confirm that this works with both Windows and Linux (Xorg), haven't tested Wayland.

@ronjouch ronjouch left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johan12345 thanks! Hmmmmmm, looking at #1321 & comments, I see two remaining things to address:

  1. ✅ A smoke test
  2. 🔲 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)

Comment thread app/src/preload.ts
Comment thread app/src/helpers/helpers.ts
Comment thread .github/manual-test

# ------------------------------------------------------------------------------

printf '\n***** SMOKE TEST 4: Setting up test and building app... *****\n'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍👍👍

@johan12345

johan12345 commented Nov 8, 2022

Copy link
Copy Markdown
Contributor Author

Thanks @ronjouch! Yes, the comments that you added for the copy-pasted isWayland function are a good idea.

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:

As for dialog element/browserwindow for screen share picker: I think the latter is the better option, on the long run, thinking about support and web standards of dialog, maybe it's not ready yet (my opinion). And create an issue as an enhancement.

@ronjouch

ronjouch commented Nov 8, 2022

Copy link
Copy Markdown
Contributor

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.

@TylerLaBree

Copy link
Copy Markdown

@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.

@Lythenas

Copy link
Copy Markdown

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...).

@LukeAI

LukeAI commented Mar 22, 2023

Copy link
Copy Markdown

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?

@TheCleric

Copy link
Copy Markdown
Collaborator

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.

@LukeAI

LukeAI commented Mar 23, 2023

Copy link
Copy Markdown

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) ||

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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')
true

We have written a parseBoolean function in src/utils/parseUtils.ts that should probably be copy and pasted here for use in the app.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, thanks for the clarification.

Comment thread app/src/preload.ts
function isWayland(): boolean {
return (
isLinux() &&
(Boolean(process.env.WAYLAND_DISPLAY) ||

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above comment about parseBoolean

@toffereins-stratusgroup

Copy link
Copy Markdown

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.

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.

@johan12345

Copy link
Copy Markdown
Contributor Author

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.

@TheCleric

Copy link
Copy Markdown
Collaborator

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. 😆

@TheCleric TheCleric merged commit 79009e8 into nativefier:master Mar 23, 2023
@Eugeniusz-Gienek

Copy link
Copy Markdown

What about Mac? I hope this will allow screen sharing in teams on mac... Won't it?

@johan12345

Copy link
Copy Markdown
Contributor Author

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.

@niccolomineo

niccolomineo commented Mar 23, 2023

Copy link
Copy Markdown

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.

@TheCleric

Copy link
Copy Markdown
Collaborator

My test with Zoom was on a Mac, so I anticipate it should work.

@niccolomineo

Copy link
Copy Markdown

Looking forward to this being officially released. Any ETA for this?

@LukeAI

LukeAI commented Apr 13, 2023

Copy link
Copy Markdown

@TheCleric any ETA on when we can expect this in npm? Anything I can do to help?

@TheCleric

Copy link
Copy Markdown
Collaborator

Apologies. This was released and is in the latest version.

@niccolomineo

Copy link
Copy Markdown

Apologies. This was released and is in the latest version.

It doesn't work with Google Meet, though. Any idea why?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Google Meet, Teams, Jitsi, etc: screensharing is broken (because APIs getDisplayMedia / chooseDesktopMedia missing in Electron)

10 participants