getUserMedia() video size in Firefox & Chrome differs getUserMedia() video size in Firefox & Chrome differs google-chrome google-chrome

getUserMedia() video size in Firefox & Chrome differs


Edit April 15

As noted by @jib in his awesome answer,

Firefox [38+] does support a subset of constraints with getUserMedia(), but not the outdated syntax that Chrome and Opera are using. The mandatory / optional syntax was deprecated a year ago, and minWidth and minHeight the year before that.

So the new syntax, approved by specs is :

var constraints = {    audio: false,    video: {        width: { min: 1024, ideal: 1280, max: 1920 },        height: { min: 576, ideal: 720, max: 1080 },    }};

However this syntax throws an error in Chrome. As noted in comments, a PR to adapter.js has been made, including a polyfill for older FF and chrome.

Here is my attempt, for chrome only (but newer version of FF seem to accept the magical and hidden require:['width', 'height'].