mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
19 lines
653 B
TypeScript
19 lines
653 B
TypeScript
/**
|
|
* Loads a script from a specific URL. The script will be interpreted upon load.
|
|
*
|
|
* @param {string} url - The url to be loaded.
|
|
* @returns {Promise} Resolved with no arguments when the script is loaded and
|
|
* rejected with the error from JitsiMeetJS.ScriptUtil.loadScript method.
|
|
*/
|
|
export function loadScript(url: string): Promise<void> {
|
|
return new Promise((resolve, reject) =>
|
|
JitsiMeetJS.util.ScriptUtil.loadScript(
|
|
{ src: url,
|
|
async: true,
|
|
prepend: false,
|
|
relativeURL: false,
|
|
loadCallback: resolve,
|
|
errorCallback: reject
|
|
}))
|
|
}
|