robingenz / capacitor-mlkit-plugin-demo

⚡️ Simple Ionic Angular app to demonstrate the use of certain Capacitor ML Kit plugins.
MIT License
40 stars 22 forks source link

feat: Video Stream HTMLVideoElement #26

Closed onra2 closed 3 months ago

onra2 commented 3 months ago

Is your feature request related to a problem? Please describe. Not really, but hiding the body in some frameworks feels like a hack, it would be easier if we could get a video stream of the active camera so we can put it in any video html tag. It makes it easier to customize the UI too.

Describe the solution you'd like I would like to be able to show a continuous video preview in a video html tag for a ticket scanning app. The way i want to scan is when the user presses on the screen it activates the scanning capabilities instead of pressing a button and only then showing the camera.

Describe alternatives you've considered The normal way of hiding technically works but it's hard to customize the UI. What i did try was getting the stream this way: //html ref to the video tag const stream = await navigator.mediaDevices.getUserMedia({ video: { facingMode: 'environment' } }); if (video.value) { video.value.srcObject = stream; }

I would be very happy with that feature :) Thanks

robingenz commented 3 months ago

I close this as duplicate of https://github.com/capawesome-team/capacitor-mlkit/issues/79.