HTML5 & JavaScript: resolution or size of <input type=file capture=camera>

JavascriptWeb DevelopmentFront End Scripts

When the device is taking very large photos and we want to make such setting to take smaller photos from the mobile phone, then we can use two W3C ways of taking pictures.

This can be done either through HTML or through JavaScript.

HTML Media Capture

For this, HTML uses capture and accept=”image/* ” on input tag .This will specify intend.

However, through this way, we cannot specify the size

Media capture streams

It allows fully programmatic access to the camera so that user can implement own capture dialogue for videos and still images.

It also specifies constraints related to width, height, frame rate, facing rate, facing mode, etc.

Global browser support for this stream is 50% and is usable in closed environments

Published on 11-Apr-2018 13:53:56