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.6KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. error.constraintName == "width" ||
  17. error.constraintName == "height") &&
  18. devices.indexOf("video") !== -1) {
  19. return this.UNSUPPORTED_RESOLUTION;
  20. } else if(typeof error === "object" && error.type === "jitsiError") {
  21. return error.errorObject;
  22. } else {
  23. return this.GENERAL;
  24. }
  25. },
  26. UNSUPPORTED_RESOLUTION: "gum.unsupported_resolution",
  27. /**
  28. * An event which indicates that the jidesha extension for Firefox is
  29. * needed to proceed with screen sharing, and that it is not installed.
  30. */
  31. FIREFOX_EXTENSION_NEEDED: "gum.firefox_extension_needed",
  32. CHROME_EXTENSION_INSTALLATION_ERROR:
  33. "gum.chrome_extension_installation_error",
  34. CHROME_EXTENSION_USER_CANCELED:
  35. "gum.chrome_extension_user_canceled",
  36. GENERAL: "gum.general",
  37. TRACK_IS_DISPOSED: "track.track_is_disposed",
  38. TRACK_MUTE_UNMUTE_IN_PROGRESS: "track.mute_unmute_inprogress"
  39. };