mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
We broke external_api.min.js by importing react/features/util which imported react/features/base/lib-jitsi-meet. 1. To reduce the risks of such a breakage until we add external_api.min.js to the torture tests, import as little as possible in modules/API/external/external_api.js. 2. Use the global JitsiMeetJS on Web in react/features/base/util.
22 lines
674 B
JavaScript
22 lines
674 B
JavaScript
/* @flow */
|
|
|
|
declare var JitsiMeetJS: Object;
|
|
|
|
/**
|
|
* 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) {
|
|
return new Promise((resolve, reject) =>
|
|
JitsiMeetJS.util.ScriptUtil.loadScript(
|
|
url,
|
|
/* async */ true,
|
|
/* prepend */ false,
|
|
/* relativeURL */ false,
|
|
/* loadCallback */ resolve,
|
|
/* errorCallback */ reject));
|
|
}
|