mozmorris / react-webcam

Webcam component
https://codepen.io/mozmorris/pen/JLZdoP
MIT License
1.65k stars 281 forks source link

[Feature Request] Show video mirrored but take a non-mirrored screenshot #354

Closed frankgalindo closed 1 year ago

frankgalindo commented 1 year ago

Hi guys, I was working on a project using react-webcam and at some point I needed to show the video mirrored, but take a non-mirrored screenshot. I managed to implement this in my project, but I think that could be a built-in option into the library itself.

I have never contributed to an open source project before, but I would like to implement this feature. Is that OK?

SanthoshRaju91 commented 1 year ago

@frankgalindo would like to know how you did this. Did you draw the image on a canvas and transformed the scaleX value to get non-mirrored screenshot ?

mozmorris commented 1 year ago

@frankgalindo @SanthoshRaju91 is this the functionality you describe? https://codepen.io/mozmorris/pen/oNygXwz

frankgalindo commented 1 year ago

Hi @SanthoshRaju91, I did it just like @mozmorris `s example.

@mozmorris Yes, I implemented it in my project just like u did in the example. I would like to add this as a feature in the library,

mozmorris commented 1 year ago

@frankgalindo thank you for raising this. As it's a case of adding a single line of css, I think it would make sense to add this to the README instead.

video {
  transform: scaleX(-1);
}
frankgalindo commented 1 year ago

So, should it be an example like "Show all cameras by device Id" and "Recording a stream"?

mozmorris commented 1 year ago

@frankgalindo that would be excellent.

frankgalindo commented 1 year ago

@mozmorris I just submitted a PR

355