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.

loadScript.web.js 689B

123456789101112131415161718192021
  1. /* @flow */
  2. declare var JitsiMeetJS: Object;
  3. /**
  4. * Loads a script from a specific URL. The script will be interpreted upon load.
  5. *
  6. * @param {string} url - The url to be loaded.
  7. * @returns {Promise} Resolved with no arguments when the script is loaded and
  8. * rejected with the error from JitsiMeetJS.ScriptUtil.loadScript method.
  9. */
  10. export function loadScript(url: string): Promise<void> {
  11. return new Promise((resolve, reject) =>
  12. JitsiMeetJS.util.ScriptUtil.loadScript(
  13. url,
  14. /* async */ true,
  15. /* prepend */ false,
  16. /* relativeURL */ false,
  17. /* loadCallback */ resolve,
  18. /* errorCallback */ reject));
  19. }