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

Question: Is it possible to update facingMode without re-rendering Webcam? #361

Open
3 tasks done
bfaulk96 opened this issue Dec 19, 2022 · 2 comments
Open
3 tasks done

Comments

@bfaulk96
Copy link

Please follow the general troubleshooting steps first:

Question

This is more a general inquiry, not a bug (and perhaps depending on the answer, a feature request?).

I have react-webcam set up in my app and working on multiple browsers and devices. I also have a mechanism set up to switch between user and environment cameras (after checking that both exist) prior to recording, by updating videoConstraints={{ ...videoConstraints, facingMode }}. Unfortunately, while this works great prior to recording, changing this setting mid-recording causes the Webcam component to re-render, which stops the recording.

This brings me to two questions

  1. Is it possible to use the underlying media recorder ref or webcam ref to update facingMode on the fly, without re-rendering the component? I've tried several things and cannot seem to get that to happen.
  2. Is this a feature that could be built into this library? I.e. instead of re-rendering, just updating the props of the media recording potentially?

Thank you for your work on this library, and for reading my questions! 😄

@zaindewsi
Copy link

@bfaulk96 did you ever find a solution to this?

@bfaulk96
Copy link
Author

Nope, unfortunately not. My solution was to show a loading symbol while the camera re-initializes, and disable facing mode switching once you'd already started recording (since switching ended the video)

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

No branches or pull requests

2 participants