Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

external_api.js 23KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757
  1. import EventEmitter from 'events';
  2. import { urlObjectToString } from '../../../react/features/base/util/uri';
  3. import {
  4. PostMessageTransportBackend,
  5. Transport
  6. } from '../../transport';
  7. import electronPopupsConfig from './electronPopupsConfig.json';
  8. const logger = require('jitsi-meet-logger').getLogger(__filename);
  9. const ALWAYS_ON_TOP_FILENAMES = [
  10. 'css/all.css', 'libs/alwaysontop.min.js'
  11. ];
  12. /**
  13. * Maps the names of the commands expected by the API with the name of the
  14. * commands expected by jitsi-meet
  15. */
  16. const commands = {
  17. avatarUrl: 'avatar-url',
  18. displayName: 'display-name',
  19. email: 'email',
  20. hangup: 'video-hangup',
  21. submitFeedback: 'submit-feedback',
  22. toggleAudio: 'toggle-audio',
  23. toggleChat: 'toggle-chat',
  24. toggleFilmStrip: 'toggle-film-strip',
  25. toggleShareScreen: 'toggle-share-screen',
  26. toggleVideo: 'toggle-video'
  27. };
  28. /**
  29. * Maps the names of the events expected by the API with the name of the
  30. * events expected by jitsi-meet
  31. */
  32. const events = {
  33. 'avatar-changed': 'avatarChanged',
  34. 'audio-availability-changed': 'audioAvailabilityChanged',
  35. 'audio-mute-status-changed': 'audioMuteStatusChanged',
  36. 'display-name-change': 'displayNameChange',
  37. 'email-change': 'emailChange',
  38. 'feedback-submitted': 'feedbackSubmitted',
  39. 'incoming-message': 'incomingMessage',
  40. 'outgoing-message': 'outgoingMessage',
  41. 'participant-joined': 'participantJoined',
  42. 'participant-left': 'participantLeft',
  43. 'video-ready-to-close': 'readyToClose',
  44. 'video-conference-joined': 'videoConferenceJoined',
  45. 'video-conference-left': 'videoConferenceLeft',
  46. 'video-availability-changed': 'videoAvailabilityChanged',
  47. 'video-mute-status-changed': 'videoMuteStatusChanged',
  48. 'screen-sharing-status-changed': 'screenSharingStatusChanged'
  49. };
  50. /**
  51. * Last id of api object
  52. * @type {number}
  53. */
  54. let id = 0;
  55. /**
  56. * Adds given number to the numberOfParticipants property of given APIInstance.
  57. *
  58. * @param {JitsiMeetExternalAPI} APIInstance - The instance of the API.
  59. * @param {int} number - The number of participants to be added to
  60. * numberOfParticipants property (this parameter can be negative number if the
  61. * numberOfParticipants should be decreased).
  62. * @returns {void}
  63. */
  64. function changeParticipantNumber(APIInstance, number) {
  65. APIInstance._numberOfParticipants += number;
  66. }
  67. /**
  68. * Generates the URL for the iframe.
  69. *
  70. * @param {string} domain - The domain name of the server that hosts the
  71. * conference.
  72. * @param {string} [options] - Another optional parameters.
  73. * @param {Object} [options.configOverwrite] - Object containing configuration
  74. * options defined in config.js to be overridden.
  75. * @param {Object} [options.interfaceConfigOverwrite] - Object containing
  76. * configuration options defined in interface_config.js to be overridden.
  77. * @param {string} [options.jwt] - The JWT token if needed by jitsi-meet for
  78. * authentication.
  79. * @param {boolean} [options.noSSL] - If the value is true https won't be used.
  80. * @param {string} [options.roomName] - The name of the room to join.
  81. * @returns {string} The URL.
  82. */
  83. function generateURL(domain, options = {}) {
  84. return urlObjectToString({
  85. ...options,
  86. url:
  87. `${options.noSSL ? 'http' : 'https'}://${
  88. domain}/#jitsi_meet_external_api_id=${id}`
  89. });
  90. }
  91. /**
  92. * Parses the arguments passed to the constructor. If the old format is used
  93. * the function translates the arguments to the new format.
  94. *
  95. * @param {Array} args - The arguments to be parsed.
  96. * @returns {Object} JS object with properties.
  97. */
  98. function parseArguments(args) {
  99. if (!args.length) {
  100. return {};
  101. }
  102. const firstArg = args[0];
  103. switch (typeof firstArg) {
  104. case 'string': // old arguments format
  105. case undefined: {
  106. // Not sure which format but we are trying to parse the old
  107. // format because if the new format is used everything will be undefined
  108. // anyway.
  109. const [
  110. roomName,
  111. width,
  112. height,
  113. parentNode,
  114. configOverwrite,
  115. interfaceConfigOverwrite,
  116. noSSL,
  117. jwt,
  118. onload
  119. ] = args;
  120. return {
  121. roomName,
  122. width,
  123. height,
  124. parentNode,
  125. configOverwrite,
  126. interfaceConfigOverwrite,
  127. noSSL,
  128. jwt,
  129. onload
  130. };
  131. }
  132. case 'object': // new arguments format
  133. return args[0];
  134. default:
  135. throw new Error('Can\'t parse the arguments!');
  136. }
  137. }
  138. /**
  139. * Compute valid values for height and width. If a number is specified it's
  140. * treated as pixel units. If the value is expressed in px, em, pt or
  141. * percentage, it's used as is.
  142. *
  143. * @param {any} value - The value to be parsed.
  144. * @returns {string|undefined} The parsed value that can be used for setting
  145. * sizes through the style property. If invalid value is passed the method
  146. * retuns undefined.
  147. */
  148. function parseSizeParam(value) {
  149. let parsedValue;
  150. // This regex parses values of the form 100px, 100em, 100pt or 100%.
  151. // Values like 100 or 100px are handled outside of the regex, and
  152. // invalid values will be ignored and the minimum will be used.
  153. const re = /([0-9]*\.?[0-9]+)(em|pt|px|%)$/;
  154. if (typeof value === 'string' && String(value).match(re) !== null) {
  155. parsedValue = value;
  156. } else if (typeof value === 'number') {
  157. parsedValue = `${value}px`;
  158. }
  159. return parsedValue;
  160. }
  161. /**
  162. * The IFrame API interface class.
  163. */
  164. export default class JitsiMeetExternalAPI extends EventEmitter {
  165. /**
  166. * Constructs new API instance. Creates iframe and loads Jitsi Meet in it.
  167. *
  168. * @param {string} domain - The domain name of the server that hosts the
  169. * conference.
  170. * @param {Object} [options] - Optional arguments.
  171. * @param {string} [options.roomName] - The name of the room to join.
  172. * @param {number|string} [options.width] - Width of the iframe. Check
  173. * parseSizeParam for format details.
  174. * @param {number|string} [options.height] - Height of the iframe. Check
  175. * parseSizeParam for format details.
  176. * @param {DOMElement} [options.parentNode] - The node that will contain the
  177. * iframe.
  178. * @param {Object} [options.configOverwrite] - Object containing
  179. * configuration options defined in config.js to be overridden.
  180. * @param {Object} [options.interfaceConfigOverwrite] - Object containing
  181. * configuration options defined in interface_config.js to be overridden.
  182. * @param {boolean} [options.noSSL] - If the value is true https won't be
  183. * used.
  184. * @param {string} [options.jwt] - The JWT token if needed by jitsi-meet for
  185. * authentication.
  186. * @param {string} [options.onload] - The onload function that will listen
  187. * for iframe onload event.
  188. * @param {Array<Object>} [options.invitees] - Array of objects containing
  189. * information about new participants that will be invited in the call.
  190. */
  191. constructor(domain, ...args) {
  192. super();
  193. const {
  194. roomName = '',
  195. width = '100%',
  196. height = '100%',
  197. parentNode = document.body,
  198. configOverwrite = {},
  199. interfaceConfigOverwrite = {},
  200. noSSL = false,
  201. jwt = undefined,
  202. onload = undefined,
  203. invitees
  204. } = parseArguments(args);
  205. this._parentNode = parentNode;
  206. this._url = generateURL(domain, {
  207. configOverwrite,
  208. interfaceConfigOverwrite,
  209. jwt,
  210. noSSL,
  211. roomName
  212. });
  213. this._createIFrame(height, width, onload);
  214. this._transport = new Transport({
  215. backend: new PostMessageTransportBackend({
  216. postisOptions: {
  217. scope: `jitsi_meet_external_api_${id}`,
  218. window: this._frame.contentWindow
  219. }
  220. })
  221. });
  222. if (Array.isArray(invitees) && invitees.length > 0) {
  223. this.invite(invitees);
  224. }
  225. this._isLargeVideoVisible = true;
  226. this._numberOfParticipants = 0;
  227. this._participants = {};
  228. this._myUserID = undefined;
  229. this._onStageParticipant = undefined;
  230. this._setupListeners();
  231. id++;
  232. }
  233. /**
  234. * Creates the iframe element.
  235. *
  236. * @param {number|string} height - The height of the iframe. Check
  237. * parseSizeParam for format details.
  238. * @param {number|string} width - The with of the iframe. Check
  239. * parseSizeParam for format details.
  240. * @param {Function} onload - The function that will listen
  241. * for onload event.
  242. * @returns {void}
  243. *
  244. * @private
  245. */
  246. _createIFrame(height, width, onload) {
  247. const frameName = `jitsiConferenceFrame${id}`;
  248. this._frame = document.createElement('iframe');
  249. this._frame.allow = 'camera; microphone';
  250. this._frame.src = this._url;
  251. this._frame.name = frameName;
  252. this._frame.id = frameName;
  253. this._setSize(height, width);
  254. this._frame.setAttribute('allowFullScreen', 'true');
  255. this._frame.style.border = 0;
  256. if (onload) {
  257. // waits for iframe resources to load
  258. // and fires event when it is done
  259. this._frame.onload = onload;
  260. }
  261. this._frame = this._parentNode.appendChild(this._frame);
  262. }
  263. /**
  264. * Returns arrays with the all resources for the always on top feature.
  265. *
  266. * @returns {Array<string>}
  267. */
  268. _getAlwaysOnTopResources() {
  269. const iframeWindow = this._frame.contentWindow;
  270. const iframeDocument = iframeWindow.document;
  271. let baseURL = '';
  272. const base = iframeDocument.querySelector('base');
  273. if (base && base.href) {
  274. baseURL = base.href;
  275. } else {
  276. const { protocol, host } = iframeWindow.location;
  277. baseURL = `${protocol}//${host}`;
  278. }
  279. return ALWAYS_ON_TOP_FILENAMES.map(
  280. filename => (new URL(filename, baseURL)).href
  281. );
  282. }
  283. /**
  284. * Returns the id of the on stage participant.
  285. *
  286. * @returns {string} - The id of the on stage participant.
  287. */
  288. _getOnStageParticipant() {
  289. return this._onStageParticipant;
  290. }
  291. /**
  292. * Getter for the large video element in Jitsi Meet.
  293. *
  294. * @returns {HTMLElement|undefined} - The large video.
  295. */
  296. _getLargeVideo() {
  297. const iframe = this.getIFrame();
  298. if (!this._isLargeVideoVisible
  299. || !iframe
  300. || !iframe.contentWindow
  301. || !iframe.contentWindow.document) {
  302. return;
  303. }
  304. return iframe.contentWindow.document.getElementById('largeVideo');
  305. }
  306. /**
  307. * Sets the size of the iframe element.
  308. *
  309. * @param {number|string} height - The height of the iframe.
  310. * @param {number|string} width - The with of the iframe.
  311. * @returns {void}
  312. *
  313. * @private
  314. */
  315. _setSize(height, width) {
  316. const parsedHeight = parseSizeParam(height);
  317. const parsedWidth = parseSizeParam(width);
  318. if (parsedHeight !== undefined) {
  319. this._frame.style.height = parsedHeight;
  320. }
  321. if (parsedWidth !== undefined) {
  322. this._frame.style.width = parsedWidth;
  323. }
  324. }
  325. /**
  326. * Setups listeners that are used internally for JitsiMeetExternalAPI.
  327. *
  328. * @returns {void}
  329. *
  330. * @private
  331. */
  332. _setupListeners() {
  333. this._transport.on('event', ({ name, ...data }) => {
  334. const userID = data.id;
  335. switch (name) {
  336. case 'video-conference-joined':
  337. this._myUserID = userID;
  338. this._participants[userID] = {
  339. avatarURL: data.avatarURL
  340. };
  341. // eslint-disable-next-line no-fallthrough
  342. case 'participant-joined': {
  343. this._participants[userID] = this._participants[userID] || {};
  344. this._participants[userID].displayName = data.displayName;
  345. this._participants[userID].formattedDisplayName
  346. = data.formattedDisplayName;
  347. changeParticipantNumber(this, 1);
  348. break;
  349. }
  350. case 'participant-left':
  351. changeParticipantNumber(this, -1);
  352. delete this._participants[userID];
  353. break;
  354. case 'display-name-change': {
  355. const user = this._participants[userID];
  356. if (user) {
  357. user.displayName = data.displayname;
  358. user.formattedDisplayName = data.formattedDisplayName;
  359. }
  360. break;
  361. }
  362. case 'email-change': {
  363. const user = this._participants[userID];
  364. if (user) {
  365. user.email = data.email;
  366. }
  367. break;
  368. }
  369. case 'avatar-changed': {
  370. const user = this._participants[userID];
  371. if (user) {
  372. user.avatarURL = data.avatarURL;
  373. }
  374. break;
  375. }
  376. case 'on-stage-participant-changed':
  377. this._onStageParticipant = userID;
  378. this.emit('largeVideoChanged');
  379. break;
  380. case 'large-video-visibility-changed':
  381. this._isLargeVideoVisible = data.isVisible;
  382. this.emit('largeVideoChanged');
  383. break;
  384. case 'video-conference-left':
  385. changeParticipantNumber(this, -1);
  386. delete this._participants[this._myUserID];
  387. break;
  388. }
  389. const eventName = events[name];
  390. if (eventName) {
  391. this.emit(eventName, data);
  392. return true;
  393. }
  394. return false;
  395. });
  396. }
  397. /**
  398. * Adds event listener to Meet Jitsi.
  399. *
  400. * @param {string} event - The name of the event.
  401. * @param {Function} listener - The listener.
  402. * @returns {void}
  403. *
  404. * @deprecated
  405. * NOTE: This method is not removed for backward comatability purposes.
  406. */
  407. addEventListener(event, listener) {
  408. this.on(event, listener);
  409. }
  410. /**
  411. * Adds event listeners to Meet Jitsi.
  412. *
  413. * @param {Object} listeners - The object key should be the name of
  414. * the event and value - the listener.
  415. * Currently we support the following
  416. * events:
  417. * {@code incomingMessage} - receives event notifications about incoming
  418. * messages. The listener will receive object with the following structure:
  419. * {{
  420. * 'from': from,//JID of the user that sent the message
  421. * 'nick': nick,//the nickname of the user that sent the message
  422. * 'message': txt//the text of the message
  423. * }}
  424. * {@code outgoingMessage} - receives event notifications about outgoing
  425. * messages. The listener will receive object with the following structure:
  426. * {{
  427. * 'message': txt//the text of the message
  428. * }}
  429. * {@code displayNameChanged} - receives event notifications about display
  430. * name change. The listener will receive object with the following
  431. * structure:
  432. * {{
  433. * jid: jid,//the JID of the participant that changed his display name
  434. * displayname: displayName //the new display name
  435. * }}
  436. * {@code participantJoined} - receives event notifications about new
  437. * participant.
  438. * The listener will receive object with the following structure:
  439. * {{
  440. * jid: jid //the jid of the participant
  441. * }}
  442. * {@code participantLeft} - receives event notifications about the
  443. * participant that left the room.
  444. * The listener will receive object with the following structure:
  445. * {{
  446. * jid: jid //the jid of the participant
  447. * }}
  448. * {@code video-conference-joined} - receives event notifications about the
  449. * local user has successfully joined the video conference.
  450. * The listener will receive object with the following structure:
  451. * {{
  452. * roomName: room //the room name of the conference
  453. * }}
  454. * {@code video-conference-left} - receives event notifications about the
  455. * local user has left the video conference.
  456. * The listener will receive object with the following structure:
  457. * {{
  458. * roomName: room //the room name of the conference
  459. * }}
  460. * {@code screenSharingStatusChanged} - receives event notifications about
  461. * turning on/off the local user screen sharing.
  462. * The listener will receive object with the following structure:
  463. * {{
  464. * on: on //whether screen sharing is on
  465. * }}
  466. * {@code readyToClose} - all hangup operations are completed and Jitsi Meet
  467. * is ready to be disposed.
  468. * @returns {void}
  469. *
  470. * @deprecated
  471. * NOTE: This method is not removed for backward comatability purposes.
  472. */
  473. addEventListeners(listeners) {
  474. for (const event in listeners) { // eslint-disable-line guard-for-in
  475. this.addEventListener(event, listeners[event]);
  476. }
  477. }
  478. /**
  479. * Removes the listeners and removes the Jitsi Meet frame.
  480. *
  481. * @returns {void}
  482. */
  483. dispose() {
  484. this._transport.dispose();
  485. this.removeAllListeners();
  486. if (this._frame) {
  487. this._frame.parentNode.removeChild(this._frame);
  488. }
  489. }
  490. /**
  491. * Executes command. The available commands are:
  492. * {@code displayName} - Sets the display name of the local participant to
  493. * the value passed in the arguments array.
  494. * {@code toggleAudio} - Mutes / unmutes audio with no arguments.
  495. * {@code toggleVideo} - Mutes / unmutes video with no arguments.
  496. * {@code toggleFilmStrip} - Hides / shows the filmstrip with no arguments.
  497. *
  498. * If the command doesn't require any arguments the parameter should be set
  499. * to empty array or it may be omitted.
  500. *
  501. * @param {string} name - The name of the command.
  502. * @returns {void}
  503. */
  504. executeCommand(name, ...args) {
  505. if (!(name in commands)) {
  506. logger.error('Not supported command name.');
  507. return;
  508. }
  509. this._transport.sendEvent({
  510. data: args,
  511. name: commands[name]
  512. });
  513. }
  514. /**
  515. * Executes commands. The available commands are:
  516. * {@code displayName} - Sets the display name of the local participant to
  517. * the value passed in the arguments array.
  518. * {@code toggleAudio} - Mutes / unmutes audio. No arguments.
  519. * {@code toggleVideo} - Mutes / unmutes video. No arguments.
  520. * {@code toggleFilmStrip} - Hides / shows the filmstrip. No arguments.
  521. * {@code toggleChat} - Hides / shows chat. No arguments.
  522. * {@code toggleShareScreen} - Starts / stops screen sharing. No arguments.
  523. *
  524. * @param {Object} commandList - The object with commands to be executed.
  525. * The keys of the object are the commands that will be executed and the
  526. * values are the arguments for the command.
  527. * @returns {void}
  528. */
  529. executeCommands(commandList) {
  530. for (const key in commandList) { // eslint-disable-line guard-for-in
  531. this.executeCommand(key, commandList[key]);
  532. }
  533. }
  534. /**
  535. * Check if the audio is available.
  536. *
  537. * @returns {Promise} - Resolves with true if the audio available, with
  538. * false if not and rejects on failure.
  539. */
  540. isAudioAvailable() {
  541. return this._transport.sendRequest({
  542. name: 'is-audio-available'
  543. });
  544. }
  545. /**
  546. * Invite people to the call.
  547. *
  548. * @param {Array<Object>} invitees - The invitees.
  549. * @returns {Promise} - Resolves on success and rejects on failure.
  550. */
  551. invite(invitees) {
  552. if (!Array.isArray(invitees) || invitees.length === 0) {
  553. return Promise.reject(new TypeError('Invalid Argument'));
  554. }
  555. return this._transport.sendRequest({
  556. name: 'invite',
  557. invitees
  558. });
  559. }
  560. /**
  561. * Returns the audio mute status.
  562. *
  563. * @returns {Promise} - Resolves with the audio mute status and rejects on
  564. * failure.
  565. */
  566. isAudioMuted() {
  567. return this._transport.sendRequest({
  568. name: 'is-audio-muted'
  569. });
  570. }
  571. /**
  572. * Returns the avatar URL of a participant.
  573. *
  574. * @param {string} participantId - The id of the participant.
  575. * @returns {string} The avatar URL.
  576. */
  577. getAvatarURL(participantId) {
  578. const { avatarURL } = this._participants[participantId] || {};
  579. return avatarURL;
  580. }
  581. /**
  582. * Returns the display name of a participant.
  583. *
  584. * @param {string} participantId - The id of the participant.
  585. * @returns {string} The display name.
  586. */
  587. getDisplayName(participantId) {
  588. const { displayName } = this._participants[participantId] || {};
  589. return displayName;
  590. }
  591. /**
  592. * Returns the email of a participant.
  593. *
  594. * @param {string} participantId - The id of the participant.
  595. * @returns {string} The email.
  596. */
  597. getEmail(participantId) {
  598. const { email } = this._participants[participantId] || {};
  599. return email;
  600. }
  601. /**
  602. * Returns the formatted display name of a participant.
  603. *
  604. * @param {string} participantId - The id of the participant.
  605. * @returns {string} The formatted display name.
  606. */
  607. _getFormattedDisplayName(participantId) {
  608. const { formattedDisplayName }
  609. = this._participants[participantId] || {};
  610. return formattedDisplayName;
  611. }
  612. /**
  613. * Returns the iframe that loads Jitsi Meet.
  614. *
  615. * @returns {HTMLElement} The iframe.
  616. */
  617. getIFrame() {
  618. return this._frame;
  619. }
  620. /**
  621. * Returns the number of participants in the conference. The local
  622. * participant is included.
  623. *
  624. * @returns {int} The number of participants in the conference.
  625. */
  626. getNumberOfParticipants() {
  627. return this._numberOfParticipants;
  628. }
  629. /**
  630. * Check if the video is available.
  631. *
  632. * @returns {Promise} - Resolves with true if the video available, with
  633. * false if not and rejects on failure.
  634. */
  635. isVideoAvailable() {
  636. return this._transport.sendRequest({
  637. name: 'is-video-available'
  638. });
  639. }
  640. /**
  641. * Returns the audio mute status.
  642. *
  643. * @returns {Promise} - Resolves with the audio mute status and rejects on
  644. * failure.
  645. */
  646. isVideoMuted() {
  647. return this._transport.sendRequest({
  648. name: 'is-video-muted'
  649. });
  650. }
  651. /**
  652. * Removes event listener.
  653. *
  654. * @param {string} event - The name of the event.
  655. * @returns {void}
  656. *
  657. * @deprecated
  658. * NOTE: This method is not removed for backward comatability purposes.
  659. */
  660. removeEventListener(event) {
  661. this.removeAllListeners(event);
  662. }
  663. /**
  664. * Removes event listeners.
  665. *
  666. * @param {Array<string>} eventList - Array with the names of the events.
  667. * @returns {void}
  668. *
  669. * @deprecated
  670. * NOTE: This method is not removed for backward comatability purposes.
  671. */
  672. removeEventListeners(eventList) {
  673. eventList.forEach(event => this.removeEventListener(event));
  674. }
  675. /**
  676. * Returns the configuration for electron for the windows that are open
  677. * from Jitsi Meet.
  678. *
  679. * @returns {Promise<Object>}
  680. *
  681. * NOTE: For internal use only.
  682. */
  683. _getElectronPopupsConfig() {
  684. return Promise.resolve(electronPopupsConfig);
  685. }
  686. }