A cool way to access your smartphone's camera with just HTML



In movies and dramas, there are scenes where hackers hijack people's smartphone cameras using special software and spyware. However, without using such a tool, Mr. Austin Gill, a video distributor who works on web design and software development, demonstrated the function by discovering the '

capture attribute ' that can start the camera with HTML alone. It is easy to understand.

TIL: You Can Access A User's Camera with Just HTML
https://austingil.com/html-capture-attribute/

You can see the movie that Mr. Gill explained about capture as 'a cool HTML attribute that I have never seen or heard' from the following.

Accessing the User's Camera with HTML Only | Web Dev Office Hours-YouTube


Gill found capture while resting in bed and checking MDN docs .



Of particular interest is that users visiting the site on mobile devices can use it to launch the camera directly instead of the file picker on their smartphone. Furthermore, it is also possible to specify front camera or rear camera with values such as 'user' and 'environment'.



Immediately, Mr. Gill decided to actually write HTML using capture and experiment.



When I try this feature on my desktop PC's browser, it just opens the file picker.



Next, Mr. Gill tried using a capture that was accessed with a smartphone and set the environment as a value.



Then the camera started in recording mode.



user can take pictures. If you take a picture in this state, the image file will be sent to the HTML side. As mentioned above, environment and user are values that specify the front camera or the rear camera, but it seems that the terminal that Mr. Gill tried has become a movie or a photo for some reason.



You can try it yourself by accessing the MDN documentation from

this link on your smartphone and tapping the 'Choose File' button.



Compatibility of capture looks like this. Since it is a function that uses the front camera and rear camera of the terminal, browsers for PCs that have only one camera or no camera are annihilated, while browsers for mobiles such as Chrome for Android and Safari for iOS are not compatible. I'm here.



Mr. Gill commented on this capture, 'How cool!' ' Progressive enhancement is the best!'

When this feature became a hot topic when Mr. Gill mentioned capture, some of the people who reacted said, ``I don't see a request for permission to access the camera, so there may be security concerns. It is said that there was a person who pointed out. But since this feature provides access to the files captured by the camera rather than the camera itself, which is essentially the same as specifying files in any other way, Gill said, 'Extra security concerns. No need,' he said.

in Mobile,   Software,   Video, Posted by log1l_ks