Skip to content
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

access to browser getUserMedia() via Electron's desktopCapturer #375

Open
elrypto opened this issue Jul 29, 2018 · 12 comments
Open

access to browser getUserMedia() via Electron's desktopCapturer #375

elrypto opened this issue Jul 29, 2018 · 12 comments
Labels
community issue Open for community contributions enhancement New feature or request

Comments

@elrypto
Copy link

elrypto commented Jul 29, 2018

Describe the solution you'd like and the expected behavior

Integrate Electron's desktopCapturer, documentation here: https://electronjs.org/docs/api/desktop-capturer.

Allow access to the users desktop audio and video with the following parameters supported (as described in documentation):

To capture both audio and video from the entire desktop the constraints passed to navigator.mediaDevices.getUserMedia must include chromeMediaSource: 'desktop', for both audio and video, but should not include a chromeMediaSourceId constraint.

Is your feature request related to a problem? Please describe.

Currently, a call to navigator.mediaDevices.getUserMedia() fails without an alternative.

Possible implementation / References

https://electronjs.org/docs/api/desktop-capture

Additional context

@deanpress deanpress added enhancement New feature or request community issue Open for community contributions labels Jul 29, 2018
@mhuggins
Copy link
Contributor

Thanks for submitting this!

@elrypto
Copy link
Author

elrypto commented Jul 29, 2018 via email

@mhuggins
Copy link
Contributor

It seems like we may not have the option to make this work. According to this article:

Browser vendors have recently ruled that getUserMedia should only work on https: protocol. You'll need a SSL certificate for this API to work.

As an example, loading https://davidwalsh.name/demo/camera.php works within nOS because it's an https URL.

@mhuggins
Copy link
Contributor

It looks like we can register a protocol as "secure" in electron. So in theory, we could change this line:

protocol.registerStandardSchemes(['nos']);

to instead read:

protocol.registerStandardSchemes(['nos'], { secure: true });

The problem is that I don't think we can actually consider a secure scheme in a security sense. As far as I understand, the RPC servers aren't using Secure RPC, and many of the consensus nodes run on HTTP rather than HTTPS as well.

@mhuggins
Copy link
Contributor

@deanpress I think we should opt to close this and #345 given the above, but I wanted to see what you think. Users will still be able to use getUserMedia via HTTPS within the client as they can today.

@mhuggins
Copy link
Contributor

A possible solution for content hosted coming from the nos protocol would be to communicate with an IFRAME that's using the https protocol via cross-origin communication.

@elrypto
Copy link
Author

elrypto commented Sep 24, 2018 via email

@jeroenptrs
Copy link
Contributor

jeroenptrs commented Sep 24, 2018

The problem is that I don't think we can actually consider a secure scheme in a security sense. As far as I understand, the RPC servers aren't using Secure RPC, and many of the consensus nodes run on HTTP rather than HTTPS as well.

@mhuggins what about proxying the consensus servers with a https server? Similar to this https://github.com/be-neo/neo-https-proxy

@mhuggins
Copy link
Contributor

@jeroenptrs Interesting idea. Where is this being used today? Would it integrate well with neon-js by chance?

@DalderupMaurice
Copy link
Member

Good old https proxy days hahaha amazing work @jeroenptrs 💪
we've used this on NeoBlog because IPFS requires a secure connection and the NEO nodes require a connection over HTTP. Due to this, we got a mixed content issue & Jeroen fixed it with this proxy module, to enable interactions with the IPFS nodes @mhuggins

@mhuggins
Copy link
Contributor

If we can make this work with neon-js, then that might be a good short-term solution. The downside is that it's a centralized solution.

It seems like this is something that should be solved by NGD / added to NEO core long term. Any reason it shouldn't be that you guys know of?

@jeroenptrs
Copy link
Contributor

If you start off http, it's gonna be hard to enforce https on every node. Especially since it requires reverse proxies and the whole #!, but NGD could force it on nodes... don't think they will though

@jeroenptrs jeroenptrs modified the milestone: 0.7.0 Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community issue Open for community contributions enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants