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.

ConferenceUrl.js 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. const logger = require("jitsi-meet-logger").getLogger(__filename);
  2. /**
  3. * The modules stores information about the URL used to start the conference and
  4. * provides utility methods for dealing with conference URL and reloads.
  5. */
  6. export default class ConferenceUrl {
  7. /**
  8. * Initializes the module.
  9. *
  10. * @param location an object which stores provides the info about conference
  11. * URL(would be 'window.location' for the Web app). The params below are
  12. * described based on the following example URL:
  13. *
  14. * https://example.com:8888/SomeConference1245?opt=1#somehash
  15. *
  16. * @param location.href full URL with all parameters, would be the whole URL
  17. * from the example string above.
  18. * @param location.host the host part of the URL, 'example.com' from
  19. * the sample URL above.
  20. * @param location.pathname the path part of the URL, would be
  21. * '/SomeConference1245' from the example above.
  22. * @param location.protocol the protocol part of the URL, would be 'https:'
  23. * from the sample URL.
  24. */
  25. constructor(location) {
  26. /**
  27. * A simplified version of the conference URL stripped out of
  28. * the parameters which should be used for sending invites.
  29. * Example:
  30. * https://example.com:8888/SomeConference1245
  31. * @type {string}
  32. */
  33. this.inviteURL
  34. = location.protocol + "//" + location.host + location.pathname;
  35. logger.info("Stored original conference URL: " + location.href);
  36. logger.info("Conference URL for invites: " + this.inviteURL);
  37. }
  38. /**
  39. * Obtains the conference invite URL.
  40. * @return {string} the URL pointing o the conference which is mean to be
  41. * used to invite new participants.
  42. */
  43. getInviteUrl() {
  44. return this.inviteURL;
  45. }
  46. }