This example uses constraints.
Click a button to call getUserMedia() with appropriate resolution.
getUserMedia()
For more information, see Capturing Audio & Video in HTML5 on HTML5 Rocks.