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 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. var logger = require("jitsi-meet-logger").getLogger(__filename);
  2. module.exports = {
  3. /**
  4. * Returns JitsiTrackErrors based on the error object passed by GUM
  5. * @param error the error
  6. * @param {Array} devices Array with the requested devices
  7. */
  8. parseError: function (error, devices) {
  9. if (typeof error === "object") {
  10. var constraintName = error.constraintName;
  11. var name;
  12. if (constraintName
  13. && (name = error.name)
  14. && (name == "ConstraintNotSatisfiedError"
  15. || name == "OverconstrainedError")
  16. && (constraintName == "minWidth"
  17. || constraintName == "maxWidth"
  18. || constraintName == "minHeight"
  19. || constraintName == "maxHeight"
  20. || constraintName == "width"
  21. || constraintName == "height")
  22. && (devices || []).indexOf("video") !== -1) {
  23. return this.UNSUPPORTED_RESOLUTION;
  24. }
  25. if (error.type === "jitsiError") {
  26. return error.errorObject;
  27. }
  28. }
  29. // XXX We're about to lose the details represented by error and devices
  30. // (because we're about to generalize them to GENERAL). At the very
  31. // least log the details.
  32. logger.error('Parsing error into ' + this.GENERAL + ': ' + error);
  33. return this.GENERAL;
  34. },
  35. UNSUPPORTED_RESOLUTION: "gum.unsupported_resolution",
  36. /**
  37. * An event which indicates that the jidesha extension for Firefox is
  38. * needed to proceed with screen sharing, and that it is not installed.
  39. */
  40. FIREFOX_EXTENSION_NEEDED: "gum.firefox_extension_needed",
  41. CHROME_EXTENSION_INSTALLATION_ERROR:
  42. "gum.chrome_extension_installation_error",
  43. CHROME_EXTENSION_USER_CANCELED:
  44. "gum.chrome_extension_user_canceled",
  45. GENERAL: "gum.general",
  46. TRACK_IS_DISPOSED: "track.track_is_disposed",
  47. TRACK_MUTE_UNMUTE_IN_PROGRESS: "track.mute_unmute_inprogress"
  48. };