Git Product home page Git Product logo

Comments (5)

gruhn avatar gruhn commented on May 19, 2024 1

Thanks 😀

Could you split this issue so we can handle your suggestions separately. Just open another issue and rename this one.

from vue-qrcode-reader.

gruhn avatar gruhn commented on May 19, 2024 1

🎉 This issue has been resolved in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

from vue-qrcode-reader.

gruhn avatar gruhn commented on May 19, 2024

You should know: At the moment, there isn't really a canvas element. The camera stream is displayed via a video element. When you pause the component, we simply call pause() on the video. The camera is still streaming in the background and that's why Chrome displays the notification. When you call stopCamera the stream is closed and I guess video elements need the stream to be active to display anything. As a result the last captured frame is lost.

We could continuously paint the streams frames to an actual canvas. This should look exactly like a video element but when the stream is closed the last painted frame will persist. I assume you had something like this in mind too, right?

I'd like to keep this components API as simple as possible, so I always hesitate to expose new events, props and so on. However, I think your suggestion is totally valid. It makes sense to release the camera when it seems to be not in use. I'm thinking about making this the default when pause is set to false. Un-pausing might cause perceivably more delay though, because the stream has to be loaded again.

Those are my thoughts so far. What do you think?

PS: don't forget to open the drag-and-drop related issue. I like that idea too 😉

from vue-qrcode-reader.

monsdroid avatar monsdroid commented on May 19, 2024

Maybe handle it transparent for the user of your component. The https://caniuse.com/#feat=pagevisibility API should work on all devices which support camera streams. if (document.visibilityState == "visible") do a soft pause otherwise disconnect the stream.
Another turn down beside the notificaton that a stream is open is that the stream is open :-)
Which means it uses battery. My Phone (Galaxy S7) heats up quite fast with the connected stream running in background

from vue-qrcode-reader.

gruhn avatar gruhn commented on May 19, 2024

I finally started to work on this one too. I think I found a nice solution but performance might have suffered. On desktop it's fine but my old-ass phone has a hard time. If you want, you can checkout the demo page – especially validation (hard) demo – and tell me how it performs on your device.

from vue-qrcode-reader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.