eduardolundgren / tracking.js

A modern approach for Computer Vision on the web
http://trackingjs.com
Other
9.44k stars 1.45k forks source link

Allow custom constraints to be passed to getUserMedia() #250

Open djipco opened 7 years ago

djipco commented 7 years ago

There is currently no way to control the webcam media constraints. This PR changes that by allowing you to pass a mediaConstraints property in the options parameter of tracking.track().

This would be very useful if you want, for example, to use a low-res feed for faster color tracking or if you need to pick a specific webcam out of many.

The suggested implementation is backwards-compatible.