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 673B

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