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

Allow passing in an existing MediaStream #250

Closed
atav32 opened this issue Nov 18, 2020 · 1 comment
Closed

Allow passing in an existing MediaStream #250

atav32 opened this issue Nov 18, 2020 · 1 comment

Comments

@atav32
Copy link

atav32 commented Nov 18, 2020

Feature Request:

Re-rendering <ReactWebcam/> on Firefox will prompt the user for video permission several times. This is intentional behavior according to Mozilla, i.e. "keep the user in charge", mozilla/standards-positions#19 (comment).

To avoid annoying the user and to keep the media permission user experience in-line with other browsers, I'd like to manually make a getUserMedia() call, hold on to that MediaStream and then pass it into <ReactWebcam/>.

The alternative would be to contort the app to keep <ReactWebcam/>'s video element from being re-rendered (maybe putting it in a portal; hiding & unhiding it; etc).

@mozmorris
Copy link
Owner

@atav32 could you provide an example of this?

I have created a simple demo that updates a component at a 1 second interval. Tested in Firefox and I don't get asked for permission on each render. Perhaps I'm misunderstanding the problem so an example would be useful.

https://codepen.io/mozmorris/pen/KKgwZmo?editors=0010

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants