您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

JitsiTrackErrors.js 1.2KB

12345678910111213141516171819202122232425262728293031
  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. CHROME_EXTENSION_INSTALLATION_ERROR:
  27. "gum.chrome_extension_installation_error",
  28. CHROME_EXTENSION_USER_CANCELED:
  29. "gum.chrome_extension_user_canceled",
  30. GENERAL: "gum.general"
  31. };