3 ms·
HTML media capture is superb. I have successfully used it in production, and I was surprised by how simple it was and how well it worked. I learned about it fro
by polyrand 4y ago
HTML media capture is superb. I have successfully used it in production, and I was surprised by how simple it was and how well it worked. I learned about it from here[0].
It's cool because if you have an app that requires users uploading pictures, you just need an HTML <form>, an <input> with `capture`, and a few lines of code in the backend. I thought I would need to do some JavaScript gymnastics, and it ended up taking just an afternoon to design, develop, and deploy.
[0]: https://anssiko.github.io/html-media-capture/ https://anssiko.github.io/html-media-capture/
- aesyondu 4y agoHmm, I don't get it. In the site you linked I see "It appears @capture is not supported and @accept is supported." for Safari, Firefox and Chrome on MacOS. I see two buttons, Choose File and Upload. Upload is just a placeholder that shows a 405 error so I'll ignore that. Choose File just lets me choose a file, but there's no option to take a picture. What am I missing here? EDIT: nvm I see that it only works on mobile: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/capture#examples https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes...