DEV Community

Cover image for Open Mobile Camera With HTML
Beginner Developer
Beginner Developer

Posted on • Originally published at beginners-developer.blogspot.com

29 11

Open Mobile Camera With HTML

The HTML Capture attribute open device camera to capture image followed by accept attribute

The capture attribute takes as it's value a string that specifies which camera to use for capture of image or video

1 capture="user" - Open Front Camera
2 capture="environment" - Open back camera

Open Front Camera

Front camera

Open Back Camera

Back Camera

Output:
Output

To record video pass video/* to accept attribute

Reference:- https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/capture

Visit Blog:- https://beginners-developer.blogspot.com

Portfolio:- https://ejaazrkhan.github.io/portfolio

Top comments (0)

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, cherished by the supportive DEV Community. Coders of every background are encouraged to bring their perspectives and bolster our collective wisdom.

A sincere “thank you” often brightens someone’s day—share yours in the comments below!

On DEV, the act of sharing knowledge eases our journey and forges stronger community ties. Found value in this? A quick thank-you to the author can make a world of difference.

Okay