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.ts 658B

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