modified lib-jitsi-meet dev repo
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 1.1KB

12345678910111213141516171819202122232425262728
  1. module.exports = {
  2. /**
  3. * Returns JitsiTrackErrors based on the error object passed by GUM
  4. * @param error the error
  5. * @param {Array} devices Array with the requested devices
  6. */
  7. parseError: function (error, devices) {
  8. devices = devices || [];
  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. devices.indexOf("video") !== -1) {
  17. return this.UNSUPPORTED_RESOLUTION;
  18. } else if(typeof error === "object" && error.type === "jitsiError") {
  19. return error.errorObject;
  20. } else {
  21. return this.GENERAL;
  22. }
  23. },
  24. UNSUPPORTED_RESOLUTION: "gum.unsupported_resolution",
  25. FIREFOX_EXTENSION_NEEDED: "gum.firefox_extension_needed",
  26. GENERAL: "gum.general",
  27. TRACK_IS_DISPOSED: "track.track_is_disposed"
  28. };