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

Reflect webcam #23

Closed
cuongnl-pnc opened this issue Aug 15, 2018 · 3 comments
Closed

Reflect webcam #23

cuongnl-pnc opened this issue Aug 15, 2018 · 3 comments

Comments

@cuongnl-pnc
Copy link

cuongnl-pnc commented Aug 15, 2018

Hi.
When I use my mobile phone with front camera, it seems not my expected image, it need to be reflected.
How can I do this?

@basst314
Copy link
Owner

basst314 commented Aug 15, 2018

Hi @cuongnl-pnc,
Thanks for raising this. You‘re right, since most phones mirror the image horizontally, it does not correspondent to the image that is returned by the webcam. The webcam returns just the image that it sees.

I‘m not sure if that can be resolved, since you would only want the image to be mirrored when the camera is front facing.

I will look into it in a couple of days when I have some more time.

@basst314
Copy link
Owner

Hi @cuongnl-pnc,

I looked into this a little more. There are differences among browsers what information is returned about the active camera (i.e. is it user-facing or not).

During my tests I noticed, that my desktop and laptop cameras, even if they are built-in, don't reveil whether they are user-facing or not, but my smartphone did reveal it.
So I should be able to build a mechanism into the existing code to mirror the camera image if the camera diagnoses itself as user-facing.

I will also provide mechanisms to turn-off this feature as it might not be desirable under certain circumstances.

Cheers!

@basst314
Copy link
Owner

Hi @cuongnl-pnc,

I released a new version of this library (0.2.0) that mirrors the webcam image horizontally when the active webcam is detected to be user-facing.
Please note that not all devices might reveal their facingMode.

I also provided a new parameter with which the mirroring can be controlled explicitly. See the documentation for details.

Cheers!

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