code: function getConstraintObj(deviceId, facingMode, width, height){
        var obj = { audio: false, video: {} };
        obj.video.deviceId = {exact: deviceId};
        if(facingMode) {
          obj.video.facingMode = {exact: facingMode};
        }
        if(width) {
          obj.video.width = {exact: width};
        }
        if(height) {
          obj.video.height = {exact: height};
        }
        return obj;
      }
docs: return a getUserMedia Constraints