You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

JitsiTrackErrors.js 935B

123456789101112131415161718192021222324
  1. module.exports = {
  2. /**
  3. * Returns JitsiTrackErrors based on the error object passed by GUM
  4. * @param error the error
  5. * @param {Object} options the options object given to GUM.
  6. */
  7. parseError: function (error, options) {
  8. options = options || {};
  9. if (typeof error == "object" && error.constraintName && error.name
  10. && (error.name == "ConstraintNotSatisfiedError" ||
  11. error.name == "OverconstrainedError") &&
  12. (error.constraintName == "minWidth" ||
  13. error.constraintName == "maxWidth" ||
  14. error.constraintName == "minHeight" ||
  15. error.constraintName == "maxHeight") &&
  16. options.devices.indexOf("video") !== -1) {
  17. return this.UNSUPPORTED_RESOLUTION;
  18. } else {
  19. return this.GENERAL;
  20. }
  21. },
  22. UNSUPPORTED_RESOLUTION: "gum.unsupported_resolution",
  23. GENERAL: "gum.general"
  24. };