-
Notifications
You must be signed in to change notification settings - Fork 327
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
Feature Request - pauseHard Camera #24
Comments
Thanks 😀 Could you split this issue so we can handle your suggestions separately. Just open another issue and rename this one. |
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 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 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 😉 |
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. |
The `video` element is tightly bound to the camera stream. If the stream ends the `video` is stopped too. By using the `video` as a mediator and painting it's frames to a visible canvas, the last frame of a camera stream can be preserved even when the stream ends. Close #24
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. |
Use additional canvas overlaying the camera stream to paint the last frame before pausing the component. In contrast to calling `video.pause()` the painted frame also persists when the stream is killed completely. Close #24
🎉 This issue has been resolved in version 1.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Hi,
first of all: Works like a Charm and a very nice piece of Code!
Im using this in Browsers on mobile devices and as long as the component is mounted Chrome displays a Notification that there is an 'Access to Video Camera from
domain
'. Even if the Browser is in background or switched to an different Tab.Would it be possible for your to expose a pauseHard() function which disconnects the Camera but keeps the last image in the canvas?
Calling stopCamera() works but kills the canvas or blacks it out
The text was updated successfully, but these errors were encountered: