kybarg / react-qr-scanner

React component for reading QR codes using PC web camera or mobile phone camera.
MIT License
126 stars 40 forks source link

feat: Allow use of existing MediaStream #22

Closed danielcrisp closed 4 years ago

danielcrisp commented 4 years ago

Adds the ability to reuse an existing MediaStream.

By default Firefox prompts the user every time we request camera access, even if we already have access to a stream.

In my app I already have a MediaStream available so this small modification allows me to reuse that stream rather than creating a new one and asking the user for access again.