Pan / Tilt / Zoom Support for Camera in getUserMedia()

Javascript Update

The getUserMedia() method has added support for pan, tilt & zoom properties as input constraints. This means that it is now possible to pan, tilt or zoom the camera using Javascript.

const stream = await navigator.mediaDevices.getUserMedia({
	video: {
		pan: true, 
		tilt: true, 
		zoom: true
	audio: true

This feature can be used by media applications to improve the user experience. For example, a web application can use <input type="range"> to show a range slider to the user — whose current value can be set as the zoom of the camera.

Browser Compatibility

January 15, 2021


Loading Comments