createCapture() constraints and facingMode

Are there any resources out there that clearly list all the possible constraints you can apply to createCapture()?

All they do is redirect you to this page:
and leave it at that.

Basically, I want to change the facingMode so that I can use the environment camera and not the user camera, and as far as I can tell, I have to supply a Constraints object in order to do that.

I don’t know if this is necessarily a problem with the constraints, but the lack of clear examples is a little frustrating. This is the only snippet I have to go off of:

function setup() {
  createCanvas(480, 120);
  var constraints = {
    video: {
      mandatory: {
        minWidth: 1280,
        minHeight: 720
      optional: [{ maxFrameRate: 10 }]
    audio: true
  createCapture(constraints, function(stream) {

Someone’s had this problem before, right?

Found a solution here:

But the original problem still remains. What does exact mean? Where do I find a general reference for Constraints?


Thanks for sharing the solution :slight_smile:

I think that is worth asking as a follow-on question on the issue that you linked, e.g. “what does exact mean and is it documented anywhere?”