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.

API.js 23KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820
  1. // @flow
  2. import * as JitsiMeetConferenceEvents from '../../ConferenceEvents';
  3. import {
  4. createApiEvent,
  5. sendAnalytics
  6. } from '../../react/features/analytics';
  7. import {
  8. sendTones,
  9. setPassword,
  10. setSubject
  11. } from '../../react/features/base/conference';
  12. import { parseJWTFromURLParams } from '../../react/features/base/jwt';
  13. import { invite } from '../../react/features/invite';
  14. import { toggleTileView } from '../../react/features/video-layout';
  15. import { getJitsiMeetTransport } from '../transport';
  16. import { API_ID, ENDPOINT_TEXT_MESSAGE_NAME } from './constants';
  17. import {
  18. processExternalDeviceRequest
  19. } from '../../react/features/device-selection/functions';
  20. const logger = require('jitsi-meet-logger').getLogger(__filename);
  21. declare var APP: Object;
  22. /**
  23. * List of the available commands.
  24. */
  25. let commands = {};
  26. /**
  27. * The state of screen sharing(started/stopped) before the screen sharing is
  28. * enabled and initialized.
  29. * NOTE: This flag help us to cache the state and use it if toggle-share-screen
  30. * was received before the initialization.
  31. */
  32. let initialScreenSharingState = false;
  33. /**
  34. * The transport instance used for communication with external apps.
  35. *
  36. * @type {Transport}
  37. */
  38. const transport = getJitsiMeetTransport();
  39. /**
  40. * The current audio availability.
  41. *
  42. * @type {boolean}
  43. */
  44. let audioAvailable = true;
  45. /**
  46. * The current video availability.
  47. *
  48. * @type {boolean}
  49. */
  50. let videoAvailable = true;
  51. /**
  52. * Initializes supported commands.
  53. *
  54. * @returns {void}
  55. */
  56. function initCommands() {
  57. commands = {
  58. 'display-name': displayName => {
  59. sendAnalytics(createApiEvent('display.name.changed'));
  60. APP.conference.changeLocalDisplayName(displayName);
  61. },
  62. 'password': password => {
  63. const { conference, passwordRequired }
  64. = APP.store.getState()['features/base/conference'];
  65. if (passwordRequired) {
  66. sendAnalytics(createApiEvent('submit.password'));
  67. APP.store.dispatch(setPassword(
  68. passwordRequired,
  69. passwordRequired.join,
  70. password
  71. ));
  72. } else {
  73. sendAnalytics(createApiEvent('password.changed'));
  74. APP.store.dispatch(setPassword(
  75. conference,
  76. conference.lock,
  77. password
  78. ));
  79. }
  80. },
  81. 'proxy-connection-event': event => {
  82. APP.conference.onProxyConnectionEvent(event);
  83. },
  84. 'send-tones': (options = {}) => {
  85. const { duration, tones, pause } = options;
  86. APP.store.dispatch(sendTones(tones, duration, pause));
  87. },
  88. 'subject': subject => {
  89. sendAnalytics(createApiEvent('subject.changed'));
  90. APP.store.dispatch(setSubject(subject));
  91. },
  92. 'submit-feedback': feedback => {
  93. sendAnalytics(createApiEvent('submit.feedback'));
  94. APP.conference.submitFeedback(feedback.score, feedback.message);
  95. },
  96. 'toggle-audio': () => {
  97. sendAnalytics(createApiEvent('toggle-audio'));
  98. logger.log('Audio toggle: API command received');
  99. APP.conference.toggleAudioMuted(false /* no UI */);
  100. },
  101. 'toggle-video': () => {
  102. sendAnalytics(createApiEvent('toggle-video'));
  103. logger.log('Video toggle: API command received');
  104. APP.conference.toggleVideoMuted(false /* no UI */);
  105. },
  106. 'toggle-film-strip': () => {
  107. sendAnalytics(createApiEvent('film.strip.toggled'));
  108. APP.UI.toggleFilmstrip();
  109. },
  110. 'toggle-chat': () => {
  111. sendAnalytics(createApiEvent('chat.toggled'));
  112. APP.UI.toggleChat();
  113. },
  114. /**
  115. * Callback to invoke when the "toggle-share-screen" command is received.
  116. *
  117. * @param {Object} options - Additional details of how to perform
  118. * the action. Note this parameter is undocumented and experimental.
  119. * @param {boolean} options.enable - Whether trying to enable screen
  120. * sharing or to turn it off.
  121. * @returns {void}
  122. */
  123. 'toggle-share-screen': (options = {}) => {
  124. sendAnalytics(createApiEvent('screen.sharing.toggled'));
  125. toggleScreenSharing(options.enable);
  126. },
  127. 'toggle-tile-view': () => {
  128. sendAnalytics(createApiEvent('tile-view.toggled'));
  129. APP.store.dispatch(toggleTileView());
  130. },
  131. 'video-hangup': (showFeedbackDialog = true) => {
  132. sendAnalytics(createApiEvent('video.hangup'));
  133. APP.conference.hangup(showFeedbackDialog);
  134. },
  135. 'email': email => {
  136. sendAnalytics(createApiEvent('email.changed'));
  137. APP.conference.changeLocalEmail(email);
  138. },
  139. 'avatar-url': avatarUrl => {
  140. sendAnalytics(createApiEvent('avatar.url.changed'));
  141. APP.conference.changeLocalAvatarUrl(avatarUrl);
  142. },
  143. 'send-endpoint-text-message': (to, text) => {
  144. logger.debug('Send endpoint message command received');
  145. try {
  146. APP.conference.sendEndpointMessage(to, {
  147. name: ENDPOINT_TEXT_MESSAGE_NAME,
  148. text
  149. });
  150. } catch (err) {
  151. logger.error('Failed sending endpoint text message', err);
  152. }
  153. }
  154. };
  155. transport.on('event', ({ data, name }) => {
  156. if (name && commands[name]) {
  157. commands[name](...data);
  158. return true;
  159. }
  160. return false;
  161. });
  162. transport.on('request', (request, callback) => {
  163. const { dispatch, getState } = APP.store;
  164. if (processExternalDeviceRequest(dispatch, getState, request, callback)) {
  165. return true;
  166. }
  167. const { name } = request;
  168. switch (name) {
  169. case 'invite': {
  170. const { invitees } = request;
  171. if (!Array.isArray(invitees) || invitees.length === 0) {
  172. callback({
  173. error: new Error('Unexpected format of invitees')
  174. });
  175. break;
  176. }
  177. // The store should be already available because API.init is called
  178. // on appWillMount action.
  179. APP.store.dispatch(
  180. invite(invitees, true))
  181. .then(failedInvitees => {
  182. let error;
  183. let result;
  184. if (failedInvitees.length) {
  185. error = new Error('One or more invites failed!');
  186. } else {
  187. result = true;
  188. }
  189. callback({
  190. error,
  191. result
  192. });
  193. });
  194. break;
  195. }
  196. case 'is-audio-muted':
  197. callback(APP.conference.isLocalAudioMuted());
  198. break;
  199. case 'is-video-muted':
  200. callback(APP.conference.isLocalVideoMuted());
  201. break;
  202. case 'is-audio-available':
  203. callback(audioAvailable);
  204. break;
  205. case 'is-video-available':
  206. callback(videoAvailable);
  207. break;
  208. default:
  209. return false;
  210. }
  211. return true;
  212. });
  213. }
  214. /**
  215. * Listens for desktop/screen sharing enabled events and toggles the screen
  216. * sharing if needed.
  217. *
  218. * @param {boolean} enabled - Current screen sharing enabled status.
  219. * @returns {void}
  220. */
  221. function onDesktopSharingEnabledChanged(enabled = false) {
  222. if (enabled && initialScreenSharingState) {
  223. toggleScreenSharing();
  224. }
  225. }
  226. /**
  227. * Check whether the API should be enabled or not.
  228. *
  229. * @returns {boolean}
  230. */
  231. function shouldBeEnabled() {
  232. return (
  233. typeof API_ID === 'number'
  234. // XXX Enable the API when a JSON Web Token (JWT) is specified in
  235. // the location/URL because then it is very likely that the Jitsi
  236. // Meet (Web) app is being used by an external/wrapping (Web) app
  237. // and, consequently, the latter will need to communicate with the
  238. // former. (The described logic is merely a heuristic though.)
  239. || parseJWTFromURLParams());
  240. }
  241. /**
  242. * Executes on toggle-share-screen command.
  243. *
  244. * @param {boolean} [enable] - Whether this toggle is to explicitly enable or
  245. * disable screensharing. If not defined, the application will automatically
  246. * attempt to toggle between enabled and disabled. This boolean is useful for
  247. * explicitly setting desired screensharing state.
  248. * @returns {void}
  249. */
  250. function toggleScreenSharing(enable) {
  251. if (APP.conference.isDesktopSharingEnabled) {
  252. // eslint-disable-next-line no-empty-function
  253. APP.conference.toggleScreenSharing(enable).catch(() => {});
  254. } else {
  255. initialScreenSharingState = !initialScreenSharingState;
  256. }
  257. }
  258. /**
  259. * Implements API class that communicates with external API class and provides
  260. * interface to access Jitsi Meet features by external applications that embed
  261. * Jitsi Meet.
  262. */
  263. class API {
  264. _enabled: boolean;
  265. /**
  266. * Initializes the API. Setups message event listeners that will receive
  267. * information from external applications that embed Jitsi Meet. It also
  268. * sends a message to the external application that API is initialized.
  269. *
  270. * @param {Object} options - Optional parameters.
  271. * @returns {void}
  272. */
  273. init() {
  274. if (!shouldBeEnabled()) {
  275. return;
  276. }
  277. /**
  278. * Current status (enabled/disabled) of API.
  279. *
  280. * @private
  281. * @type {boolean}
  282. */
  283. this._enabled = true;
  284. APP.conference.addListener(
  285. JitsiMeetConferenceEvents.DESKTOP_SHARING_ENABLED_CHANGED,
  286. onDesktopSharingEnabledChanged);
  287. initCommands();
  288. }
  289. /**
  290. * Notify external application (if API is enabled) that the large video
  291. * visibility changed.
  292. *
  293. * @param {boolean} isHidden - True if the large video is hidden and false
  294. * otherwise.
  295. * @returns {void}
  296. */
  297. notifyLargeVideoVisibilityChanged(isHidden: boolean) {
  298. this._sendEvent({
  299. name: 'large-video-visibility-changed',
  300. isVisible: !isHidden
  301. });
  302. }
  303. /**
  304. * Notifies the external application (spot) that the local jitsi-participant
  305. * has a status update.
  306. *
  307. * @param {Object} event - The message to pass onto spot.
  308. * @returns {void}
  309. */
  310. sendProxyConnectionEvent(event: Object) {
  311. this._sendEvent({
  312. name: 'proxy-connection-event',
  313. ...event
  314. });
  315. }
  316. /**
  317. * Sends event to the external application.
  318. *
  319. * @param {Object} event - The event to be sent.
  320. * @returns {void}
  321. */
  322. _sendEvent(event: Object = {}) {
  323. if (this._enabled) {
  324. transport.sendEvent(event);
  325. }
  326. }
  327. /**
  328. * Notify external application (if API is enabled) that message was sent.
  329. *
  330. * @param {string} message - Message body.
  331. * @param {boolean} privateMessage - True if the message was a private message.
  332. * @returns {void}
  333. */
  334. notifySendingChatMessage(message: string, privateMessage: boolean) {
  335. this._sendEvent({
  336. name: 'outgoing-message',
  337. message,
  338. privateMessage
  339. });
  340. }
  341. /**
  342. * Notify external application (if API is enabled) that message was
  343. * received.
  344. *
  345. * @param {Object} options - Object with the message properties.
  346. * @returns {void}
  347. */
  348. notifyReceivedChatMessage(
  349. { body, id, nick, ts }: {
  350. body: *, id: string, nick: string, ts: *
  351. } = {}) {
  352. if (APP.conference.isLocalId(id)) {
  353. return;
  354. }
  355. this._sendEvent({
  356. name: 'incoming-message',
  357. from: id,
  358. message: body,
  359. nick,
  360. stamp: ts
  361. });
  362. }
  363. /**
  364. * Notify external application (if API is enabled) that user joined the
  365. * conference.
  366. *
  367. * @param {string} id - User id.
  368. * @param {Object} props - The display name of the user.
  369. * @returns {void}
  370. */
  371. notifyUserJoined(id: string, props: Object) {
  372. this._sendEvent({
  373. name: 'participant-joined',
  374. id,
  375. ...props
  376. });
  377. }
  378. /**
  379. * Notify external application (if API is enabled) that user left the
  380. * conference.
  381. *
  382. * @param {string} id - User id.
  383. * @returns {void}
  384. */
  385. notifyUserLeft(id: string) {
  386. this._sendEvent({
  387. name: 'participant-left',
  388. id
  389. });
  390. }
  391. /**
  392. * Notify external application (if API is enabled) that user changed their
  393. * avatar.
  394. *
  395. * @param {string} id - User id.
  396. * @param {string} avatarURL - The new avatar URL of the participant.
  397. * @returns {void}
  398. */
  399. notifyAvatarChanged(id: string, avatarURL: string) {
  400. this._sendEvent({
  401. name: 'avatar-changed',
  402. avatarURL,
  403. id
  404. });
  405. }
  406. /**
  407. * Notify external application (if API is enabled) that user received
  408. * a text message through datachannels.
  409. *
  410. * @param {Object} data - The event data.
  411. * @returns {void}
  412. */
  413. notifyEndpointTextMessageReceived(data: Object) {
  414. this._sendEvent({
  415. name: 'endpoint-text-message-received',
  416. data
  417. });
  418. }
  419. /**
  420. * Notify external application (if API is enabled) that the device list has
  421. * changed.
  422. *
  423. * @param {Object} devices - The new device list.
  424. * @returns {void}
  425. */
  426. notifyDeviceListChanged(devices: Object) {
  427. this._sendEvent({
  428. name: 'device-list-changed',
  429. devices });
  430. }
  431. /**
  432. * Notify external application (if API is enabled) that user changed their
  433. * nickname.
  434. *
  435. * @param {string} id - User id.
  436. * @param {string} displayname - User nickname.
  437. * @param {string} formattedDisplayName - The display name shown in Jitsi
  438. * meet's UI for the user.
  439. * @returns {void}
  440. */
  441. notifyDisplayNameChanged(
  442. id: string,
  443. { displayName, formattedDisplayName }: Object) {
  444. this._sendEvent({
  445. name: 'display-name-change',
  446. displayname: displayName,
  447. formattedDisplayName,
  448. id
  449. });
  450. }
  451. /**
  452. * Notify external application (if API is enabled) that user changed their
  453. * email.
  454. *
  455. * @param {string} id - User id.
  456. * @param {string} email - The new email of the participant.
  457. * @returns {void}
  458. */
  459. notifyEmailChanged(
  460. id: string,
  461. { email }: Object) {
  462. this._sendEvent({
  463. name: 'email-change',
  464. email,
  465. id
  466. });
  467. }
  468. /**
  469. * Notify external application (if API is enabled) that the conference has
  470. * been joined.
  471. *
  472. * @param {string} roomName - The room name.
  473. * @param {string} id - The id of the local user.
  474. * @param {Object} props - The display name and avatar URL of the local
  475. * user.
  476. * @returns {void}
  477. */
  478. notifyConferenceJoined(roomName: string, id: string, props: Object) {
  479. this._sendEvent({
  480. name: 'video-conference-joined',
  481. roomName,
  482. id,
  483. ...props
  484. });
  485. }
  486. /**
  487. * Notify external application (if API is enabled) that user changed their
  488. * nickname.
  489. *
  490. * @param {string} roomName - User id.
  491. * @returns {void}
  492. */
  493. notifyConferenceLeft(roomName: string) {
  494. this._sendEvent({
  495. name: 'video-conference-left',
  496. roomName
  497. });
  498. }
  499. /**
  500. * Notify external application (if API is enabled) that we are ready to be
  501. * closed.
  502. *
  503. * @returns {void}
  504. */
  505. notifyReadyToClose() {
  506. this._sendEvent({ name: 'video-ready-to-close' });
  507. }
  508. /**
  509. * Notify external application (if API is enabled) that a suspend event in host computer.
  510. *
  511. * @returns {void}
  512. */
  513. notifySuspendDetected() {
  514. this._sendEvent({ name: 'suspend-detected' });
  515. }
  516. /**
  517. * Notify external application (if API is enabled) for audio muted status
  518. * changed.
  519. *
  520. * @param {boolean} muted - The new muted status.
  521. * @returns {void}
  522. */
  523. notifyAudioMutedStatusChanged(muted: boolean) {
  524. this._sendEvent({
  525. name: 'audio-mute-status-changed',
  526. muted
  527. });
  528. }
  529. /**
  530. * Notify external application (if API is enabled) for video muted status
  531. * changed.
  532. *
  533. * @param {boolean} muted - The new muted status.
  534. * @returns {void}
  535. */
  536. notifyVideoMutedStatusChanged(muted: boolean) {
  537. this._sendEvent({
  538. name: 'video-mute-status-changed',
  539. muted
  540. });
  541. }
  542. /**
  543. * Notify external application (if API is enabled) for audio availability
  544. * changed.
  545. *
  546. * @param {boolean} available - True if available and false otherwise.
  547. * @returns {void}
  548. */
  549. notifyAudioAvailabilityChanged(available: boolean) {
  550. audioAvailable = available;
  551. this._sendEvent({
  552. name: 'audio-availability-changed',
  553. available
  554. });
  555. }
  556. /**
  557. * Notify external application (if API is enabled) for video available
  558. * status changed.
  559. *
  560. * @param {boolean} available - True if available and false otherwise.
  561. * @returns {void}
  562. */
  563. notifyVideoAvailabilityChanged(available: boolean) {
  564. videoAvailable = available;
  565. this._sendEvent({
  566. name: 'video-availability-changed',
  567. available
  568. });
  569. }
  570. /**
  571. * Notify external application (if API is enabled) that the on stage
  572. * participant has changed.
  573. *
  574. * @param {string} id - User id of the new on stage participant.
  575. * @returns {void}
  576. */
  577. notifyOnStageParticipantChanged(id: string) {
  578. this._sendEvent({
  579. name: 'on-stage-participant-changed',
  580. id
  581. });
  582. }
  583. /**
  584. * Notify external application of an unexpected camera-related error having
  585. * occurred.
  586. *
  587. * @param {string} type - The type of the camera error.
  588. * @param {string} message - Additional information about the error.
  589. * @returns {void}
  590. */
  591. notifyOnCameraError(type: string, message: string) {
  592. this._sendEvent({
  593. name: 'camera-error',
  594. type,
  595. message
  596. });
  597. }
  598. /**
  599. * Notify external application of an unexpected mic-related error having
  600. * occurred.
  601. *
  602. * @param {string} type - The type of the mic error.
  603. * @param {string} message - Additional information about the error.
  604. * @returns {void}
  605. */
  606. notifyOnMicError(type: string, message: string) {
  607. this._sendEvent({
  608. name: 'mic-error',
  609. type,
  610. message
  611. });
  612. }
  613. /**
  614. * Notify external application (if API is enabled) that conference feedback
  615. * has been submitted. Intended to be used in conjunction with the
  616. * submit-feedback command to get notified if feedback was submitted.
  617. *
  618. * @param {string} error - A failure message, if any.
  619. * @returns {void}
  620. */
  621. notifyFeedbackSubmitted(error: string) {
  622. this._sendEvent({
  623. name: 'feedback-submitted',
  624. error
  625. });
  626. }
  627. /**
  628. * Notify external application (if API is enabled) that the feedback prompt
  629. * has been displayed.
  630. *
  631. * @returns {void}
  632. */
  633. notifyFeedbackPromptDisplayed() {
  634. this._sendEvent({ name: 'feedback-prompt-displayed' });
  635. }
  636. /**
  637. * Notify external application (if API is enabled) that the display
  638. * configuration of the filmstrip has been changed.
  639. *
  640. * @param {boolean} visible - Whether or not the filmstrip has been set to
  641. * be displayed or hidden.
  642. * @returns {void}
  643. */
  644. notifyFilmstripDisplayChanged(visible: boolean) {
  645. this._sendEvent({
  646. name: 'filmstrip-display-changed',
  647. visible
  648. });
  649. }
  650. /**
  651. * Notify external application of a participant, remote or local, being
  652. * removed from the conference by another participant.
  653. *
  654. * @param {string} kicked - The ID of the participant removed from the
  655. * conference.
  656. * @param {string} kicker - The ID of the participant that removed the
  657. * other participant.
  658. * @returns {void}
  659. */
  660. notifyKickedOut(kicked: Object, kicker: Object) {
  661. this._sendEvent({
  662. name: 'participant-kicked-out',
  663. kicked,
  664. kicker
  665. });
  666. }
  667. /**
  668. * Notify external application of the current meeting requiring a password
  669. * to join.
  670. *
  671. * @returns {void}
  672. */
  673. notifyOnPasswordRequired() {
  674. this._sendEvent({ name: 'password-required' });
  675. }
  676. /**
  677. * Notify external application (if API is enabled) that the screen sharing
  678. * has been turned on/off.
  679. *
  680. * @param {boolean} on - True if screen sharing is enabled.
  681. * @param {Object} details - Additional information about the screen
  682. * sharing.
  683. * @param {string} details.sourceType - Type of device or window the screen
  684. * share is capturing.
  685. * @returns {void}
  686. */
  687. notifyScreenSharingStatusChanged(on: boolean, details: Object) {
  688. this._sendEvent({
  689. name: 'screen-sharing-status-changed',
  690. on,
  691. details
  692. });
  693. }
  694. /**
  695. * Notify external application (if API is enabled) that the dominant speaker
  696. * has been turned on/off.
  697. *
  698. * @param {string} id - Id of the dominant participant.
  699. * @returns {void}
  700. */
  701. notifyDominantSpeakerChanged(id: string) {
  702. this._sendEvent({
  703. name: 'dominant-speaker-changed',
  704. id
  705. });
  706. }
  707. /**
  708. * Notify external application (if API is enabled) that the conference
  709. * changed their subject.
  710. *
  711. * @param {string} subject - Conference subject.
  712. * @returns {void}
  713. */
  714. notifySubjectChanged(subject: string) {
  715. this._sendEvent({
  716. name: 'subject-change',
  717. subject
  718. });
  719. }
  720. /**
  721. * Notify external application (if API is enabled) that tile view has been
  722. * entered or exited.
  723. *
  724. * @param {string} enabled - True if tile view is currently displayed, false
  725. * otherwise.
  726. * @returns {void}
  727. */
  728. notifyTileViewChanged(enabled: boolean) {
  729. this._sendEvent({
  730. name: 'tile-view-changed',
  731. enabled
  732. });
  733. }
  734. /**
  735. * Disposes the allocated resources.
  736. *
  737. * @returns {void}
  738. */
  739. dispose() {
  740. if (this._enabled) {
  741. this._enabled = false;
  742. APP.conference.removeListener(
  743. JitsiMeetConferenceEvents.DESKTOP_SHARING_ENABLED_CHANGED,
  744. onDesktopSharingEnabledChanged);
  745. }
  746. }
  747. }
  748. export default new API();