How to take a picture of the user on click?

How to take a picture of the user on click?

Please elaborate

I would like to access a camera (either webcam or mobile camera) to take the picture of the user. Who is submitting the form?

It’s a little bit complicated.
I think you can do it in a custom element (see first link below).
create a “Take a Picture” button + video element + canvas element (see second link below) in the custom element (not with Wix Editor elements), then once the picture has taken, send the data url (base64) string to the page (using dispatchEvent in the custom element file, and customElement.on() on the page side), send it from the front-end page to the backend, use buffer and mediaManager.upload to create the file (3rd link below).

I’ve never tried it. Maybe there’re other ways. Let’s see if anyone has an idea.

https://www.wix.com/velo/reference/$w/customelement

https://usefulangle.com/post/352/javascript-capture-image-from-camera

https://www.wix.com/velo/reference/wix-media-backend/mediamanager-obj/upload

Thank you for your answer. I will work on it and update you.

Hello @myskentino, were you able to make this work?