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.

UI.js 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762
  1. /* global APP, $, config, interfaceConfig */
  2. const logger = require('jitsi-meet-logger').getLogger(__filename);
  3. const UI = {};
  4. import messageHandler from './util/MessageHandler';
  5. import UIUtil from './util/UIUtil';
  6. import UIEvents from '../../service/UI/UIEvents';
  7. import EtherpadManager from './etherpad/Etherpad';
  8. import SharedVideoManager from './shared_video/SharedVideo';
  9. import VideoLayout from './videolayout/VideoLayout';
  10. import { getLocalParticipant } from '../../react/features/base/participants';
  11. import { toggleChat } from '../../react/features/chat';
  12. import { setDocumentUrl } from '../../react/features/etherpad';
  13. import { setFilmstripVisible } from '../../react/features/filmstrip';
  14. import { setNotificationsEnabled } from '../../react/features/notifications';
  15. import {
  16. dockToolbox,
  17. setToolboxEnabled,
  18. showToolbox
  19. } from '../../react/features/toolbox';
  20. const EventEmitter = require('events');
  21. UI.messageHandler = messageHandler;
  22. const eventEmitter = new EventEmitter();
  23. UI.eventEmitter = eventEmitter;
  24. let etherpadManager;
  25. let sharedVideoManager;
  26. const UIListeners = new Map([
  27. [
  28. UIEvents.ETHERPAD_CLICKED,
  29. () => etherpadManager && etherpadManager.toggleEtherpad()
  30. ], [
  31. UIEvents.SHARED_VIDEO_CLICKED,
  32. () => sharedVideoManager && sharedVideoManager.toggleSharedVideo()
  33. ], [
  34. UIEvents.TOGGLE_FILMSTRIP,
  35. () => UI.toggleFilmstrip()
  36. ]
  37. ]);
  38. /**
  39. * Indicates if we're currently in full screen mode.
  40. *
  41. * @return {boolean} {true} to indicate that we're currently in full screen
  42. * mode, {false} otherwise
  43. */
  44. UI.isFullScreen = function() {
  45. return UIUtil.isFullScreen();
  46. };
  47. /**
  48. * Returns true if the etherpad window is currently visible.
  49. * @returns {Boolean} - true if the etherpad window is currently visible.
  50. */
  51. UI.isEtherpadVisible = function() {
  52. return Boolean(etherpadManager && etherpadManager.isVisible());
  53. };
  54. /**
  55. * Returns true if there is a shared video which is being shown (?).
  56. * @returns {boolean} - true if there is a shared video which is being shown.
  57. */
  58. UI.isSharedVideoShown = function() {
  59. return Boolean(sharedVideoManager && sharedVideoManager.isSharedVideoShown);
  60. };
  61. /**
  62. * Notify user that server has shut down.
  63. */
  64. UI.notifyGracefulShutdown = function() {
  65. messageHandler.showError({
  66. descriptionKey: 'dialog.gracefulShutdown',
  67. titleKey: 'dialog.serviceUnavailable'
  68. });
  69. };
  70. /**
  71. * Notify user that reservation error happened.
  72. */
  73. UI.notifyReservationError = function(code, msg) {
  74. messageHandler.showError({
  75. descriptionArguments: {
  76. code,
  77. msg
  78. },
  79. descriptionKey: 'dialog.reservationErrorMsg',
  80. titleKey: 'dialog.reservationError'
  81. });
  82. };
  83. /**
  84. * Notify user that conference was destroyed.
  85. * @param reason {string} the reason text
  86. */
  87. UI.notifyConferenceDestroyed = function(reason) {
  88. // FIXME: use Session Terminated from translation, but
  89. // 'reason' text comes from XMPP packet and is not translated
  90. messageHandler.showError({
  91. description: reason,
  92. titleKey: 'dialog.sessTerminated'
  93. });
  94. };
  95. /**
  96. * Change nickname for the user.
  97. * @param {string} id user id
  98. * @param {string} displayName new nickname
  99. */
  100. UI.changeDisplayName = function(id, displayName) {
  101. VideoLayout.onDisplayNameChanged(id, displayName);
  102. };
  103. /**
  104. * Initialize conference UI.
  105. */
  106. UI.initConference = function() {
  107. const { getState } = APP.store;
  108. const { id, name } = getLocalParticipant(getState);
  109. // Update default button states before showing the toolbar
  110. // if local role changes buttons state will be again updated.
  111. UI.updateLocalRole(APP.conference.isModerator);
  112. UI.showToolbar();
  113. const displayName = config.displayJids ? id : name;
  114. if (displayName) {
  115. UI.changeDisplayName('localVideoContainer', displayName);
  116. }
  117. };
  118. /**
  119. * Returns the shared document manager object.
  120. * @return {EtherpadManager} the shared document manager object
  121. */
  122. UI.getSharedVideoManager = function() {
  123. return sharedVideoManager;
  124. };
  125. /**
  126. * Starts the UI module and initializes all related components.
  127. *
  128. * @returns {boolean} true if the UI is ready and the conference should be
  129. * established, false - otherwise (for example in the case of welcome page)
  130. */
  131. UI.start = function() {
  132. // Set the defaults for prompt dialogs.
  133. $.prompt.setDefaults({ persistent: false });
  134. VideoLayout.init(eventEmitter);
  135. if (!interfaceConfig.filmStripOnly) {
  136. VideoLayout.initLargeVideo();
  137. }
  138. // Do not animate the video area on UI start (second argument passed into
  139. // resizeVideoArea) because the animation is not visible anyway. Plus with
  140. // the current dom layout, the quality label is part of the video layout and
  141. // will be seen animating in.
  142. VideoLayout.resizeVideoArea(true, false);
  143. sharedVideoManager = new SharedVideoManager(eventEmitter);
  144. if (interfaceConfig.filmStripOnly) {
  145. $('body').addClass('filmstrip-only');
  146. APP.store.dispatch(setNotificationsEnabled(false));
  147. } else if (config.iAmRecorder) {
  148. // in case of iAmSipGateway keep local video visible
  149. if (!config.iAmSipGateway) {
  150. VideoLayout.setLocalVideoVisible(false);
  151. }
  152. APP.store.dispatch(setToolboxEnabled(false));
  153. APP.store.dispatch(setNotificationsEnabled(false));
  154. UI.messageHandler.enablePopups(false);
  155. }
  156. };
  157. /**
  158. * Setup some UI event listeners.
  159. */
  160. UI.registerListeners
  161. = () => UIListeners.forEach((value, key) => UI.addListener(key, value));
  162. /**
  163. * Setup some DOM event listeners.
  164. */
  165. UI.bindEvents = () => {
  166. /**
  167. *
  168. */
  169. function onResize() {
  170. VideoLayout.onResize();
  171. }
  172. // Resize and reposition videos in full screen mode.
  173. $(document).on(
  174. 'webkitfullscreenchange mozfullscreenchange fullscreenchange',
  175. onResize);
  176. $(window).resize(onResize);
  177. };
  178. /**
  179. * Unbind some DOM event listeners.
  180. */
  181. UI.unbindEvents = () => {
  182. $(document).off(
  183. 'webkitfullscreenchange mozfullscreenchange fullscreenchange');
  184. $(window).off('resize');
  185. };
  186. /**
  187. * Show local video stream on UI.
  188. * @param {JitsiTrack} track stream to show
  189. */
  190. UI.addLocalVideoStream = track => {
  191. VideoLayout.changeLocalVideo(track);
  192. };
  193. /**
  194. * Setup and show Etherpad.
  195. * @param {string} name etherpad id
  196. */
  197. UI.initEtherpad = name => {
  198. if (etherpadManager || !config.etherpad_base || !name) {
  199. return;
  200. }
  201. logger.log('Etherpad is enabled');
  202. etherpadManager = new EtherpadManager(eventEmitter);
  203. const url = new URL(name, config.etherpad_base);
  204. APP.store.dispatch(setDocumentUrl(url.toString()));
  205. };
  206. /**
  207. * Returns the shared document manager object.
  208. * @return {EtherpadManager} the shared document manager object
  209. */
  210. UI.getSharedDocumentManager = () => etherpadManager;
  211. /**
  212. * Show user on UI.
  213. * @param {JitsiParticipant} user
  214. */
  215. UI.addUser = function(user) {
  216. const id = user.getId();
  217. const displayName = user.getDisplayName();
  218. const status = user.getStatus();
  219. if (status) {
  220. // FIXME: move updateUserStatus in participantPresenceChanged action
  221. UI.updateUserStatus(user, status);
  222. }
  223. // set initial display name
  224. if (displayName) {
  225. UI.changeDisplayName(id, displayName);
  226. }
  227. };
  228. /**
  229. * Update videotype for specified user.
  230. * @param {string} id user id
  231. * @param {string} newVideoType new videotype
  232. */
  233. UI.onPeerVideoTypeChanged
  234. = (id, newVideoType) => VideoLayout.onVideoTypeChanged(id, newVideoType);
  235. /**
  236. * Update local user role and show notification if user is moderator.
  237. * @param {boolean} isModerator if local user is moderator or not
  238. */
  239. UI.updateLocalRole = isModerator => {
  240. VideoLayout.showModeratorIndicator();
  241. if (isModerator && !interfaceConfig.DISABLE_FOCUS_INDICATOR) {
  242. messageHandler.participantNotification(
  243. null, 'notify.me', 'connected', 'notify.moderator');
  244. }
  245. };
  246. /**
  247. * Check the role for the user and reflect it in the UI, moderator ui indication
  248. * and notifies user who is the moderator
  249. * @param user to check for moderator
  250. */
  251. UI.updateUserRole = user => {
  252. VideoLayout.showModeratorIndicator();
  253. // We don't need to show moderator notifications when the focus (moderator)
  254. // indicator is disabled.
  255. if (!user.isModerator() || interfaceConfig.DISABLE_FOCUS_INDICATOR) {
  256. return;
  257. }
  258. const displayName = user.getDisplayName();
  259. messageHandler.participantNotification(
  260. displayName,
  261. 'notify.somebody',
  262. 'connected',
  263. 'notify.grantedTo',
  264. { to: displayName
  265. ? UIUtil.escapeHtml(displayName) : '$t(notify.somebody)' });
  266. };
  267. /**
  268. * Updates the user status.
  269. *
  270. * @param {JitsiParticipant} user - The user which status we need to update.
  271. * @param {string} status - The new status.
  272. */
  273. UI.updateUserStatus = (user, status) => {
  274. const reduxState = APP.store.getState() || {};
  275. const { calleeInfoVisible } = reduxState['features/invite'] || {};
  276. if (!status || calleeInfoVisible) {
  277. return;
  278. }
  279. const displayName = user.getDisplayName();
  280. messageHandler.participantNotification(
  281. displayName,
  282. '',
  283. 'connected',
  284. 'dialOut.statusMessage',
  285. { status: UIUtil.escapeHtml(status) });
  286. };
  287. /**
  288. * Toggles filmstrip.
  289. */
  290. UI.toggleFilmstrip = function() {
  291. const { visible } = APP.store.getState()['features/filmstrip'];
  292. APP.store.dispatch(setFilmstripVisible(!visible));
  293. };
  294. /**
  295. * Toggles the visibility of the chat panel.
  296. */
  297. UI.toggleChat = () => APP.store.dispatch(toggleChat());
  298. /**
  299. * Handle new user display name.
  300. */
  301. UI.inputDisplayNameHandler = function(newDisplayName) {
  302. eventEmitter.emit(UIEvents.NICKNAME_CHANGED, newDisplayName);
  303. };
  304. /**
  305. * Return the type of the remote video.
  306. * @param jid the jid for the remote video
  307. * @returns the video type video or screen.
  308. */
  309. UI.getRemoteVideoType = function(jid) {
  310. return VideoLayout.getRemoteVideoType(jid);
  311. };
  312. // FIXME check if someone user this
  313. UI.showLoginPopup = function(callback) {
  314. logger.log('password is required');
  315. const message
  316. = `<input name="username" type="text"
  317. placeholder="user@domain.net"
  318. class="input-control" autofocus>
  319. <input name="password" type="password"
  320. data-i18n="[placeholder]dialog.userPassword"
  321. class="input-control"
  322. placeholder="user password">`
  323. ;
  324. // eslint-disable-next-line max-params
  325. const submitFunction = (e, v, m, f) => {
  326. if (v && f.username && f.password) {
  327. callback(f.username, f.password);
  328. }
  329. };
  330. messageHandler.openTwoButtonDialog({
  331. titleKey: 'dialog.passwordRequired',
  332. msgString: message,
  333. leftButtonKey: 'dialog.Ok',
  334. submitFunction,
  335. focus: ':input:first'
  336. });
  337. };
  338. UI.askForNickname = function() {
  339. // eslint-disable-next-line no-alert
  340. return window.prompt('Your nickname (optional)');
  341. };
  342. /**
  343. * Sets muted audio state for participant
  344. */
  345. UI.setAudioMuted = function(id, muted) {
  346. VideoLayout.onAudioMute(id, muted);
  347. if (APP.conference.isLocalId(id)) {
  348. APP.conference.updateAudioIconEnabled();
  349. }
  350. };
  351. /**
  352. * Sets muted video state for participant
  353. */
  354. UI.setVideoMuted = function(id, muted) {
  355. VideoLayout.onVideoMute(id, muted);
  356. if (APP.conference.isLocalId(id)) {
  357. APP.conference.updateVideoIconEnabled();
  358. }
  359. };
  360. /**
  361. * Triggers an update of remote video and large video displays so they may pick
  362. * up any state changes that have occurred elsewhere.
  363. *
  364. * @returns {void}
  365. */
  366. UI.updateAllVideos = () => VideoLayout.updateAllVideos();
  367. /**
  368. * Adds a listener that would be notified on the given type of event.
  369. *
  370. * @param type the type of the event we're listening for
  371. * @param listener a function that would be called when notified
  372. */
  373. UI.addListener = function(type, listener) {
  374. eventEmitter.on(type, listener);
  375. };
  376. /**
  377. * Removes the all listeners for all events.
  378. *
  379. * @returns {void}
  380. */
  381. UI.removeAllListeners = function() {
  382. eventEmitter.removeAllListeners();
  383. };
  384. /**
  385. * Removes the given listener for the given type of event.
  386. *
  387. * @param type the type of the event we're listening for
  388. * @param listener the listener we want to remove
  389. */
  390. UI.removeListener = function(type, listener) {
  391. eventEmitter.removeListener(type, listener);
  392. };
  393. /**
  394. * Emits the event of given type by specifying the parameters in options.
  395. *
  396. * @param type the type of the event we're emitting
  397. * @param options the parameters for the event
  398. */
  399. UI.emitEvent = (type, ...options) => eventEmitter.emit(type, ...options);
  400. UI.clickOnVideo = videoNumber => VideoLayout.togglePin(videoNumber);
  401. // Used by torture.
  402. UI.showToolbar = timeout => APP.store.dispatch(showToolbox(timeout));
  403. // Used by torture.
  404. UI.dockToolbar = dock => APP.store.dispatch(dockToolbox(dock));
  405. /**
  406. * Updates the displayed avatar for participant.
  407. *
  408. * @param {string} id - User id whose avatar should be updated.
  409. * @param {string} avatarURL - The URL to avatar image to display.
  410. * @returns {void}
  411. */
  412. UI.refreshAvatarDisplay = function(id) {
  413. VideoLayout.changeUserAvatar(id);
  414. };
  415. /**
  416. * Notify user that connection failed.
  417. * @param {string} stropheErrorMsg raw Strophe error message
  418. */
  419. UI.notifyConnectionFailed = function(stropheErrorMsg) {
  420. let descriptionKey;
  421. let descriptionArguments;
  422. if (stropheErrorMsg) {
  423. descriptionKey = 'dialog.connectErrorWithMsg';
  424. descriptionArguments = { msg: stropheErrorMsg };
  425. } else {
  426. descriptionKey = 'dialog.connectError';
  427. }
  428. messageHandler.showError({
  429. descriptionArguments,
  430. descriptionKey,
  431. titleKey: 'connection.CONNFAIL'
  432. });
  433. };
  434. /**
  435. * Notify user that maximum users limit has been reached.
  436. */
  437. UI.notifyMaxUsersLimitReached = function() {
  438. messageHandler.showError({
  439. hideErrorSupportLink: true,
  440. descriptionKey: 'dialog.maxUsersLimitReached',
  441. titleKey: 'dialog.maxUsersLimitReachedTitle'
  442. });
  443. };
  444. /**
  445. * Notify user that he was automatically muted when joned the conference.
  446. */
  447. UI.notifyInitiallyMuted = function() {
  448. messageHandler.participantNotification(
  449. null,
  450. 'notify.mutedTitle',
  451. 'connected',
  452. 'notify.muted',
  453. null);
  454. };
  455. UI.handleLastNEndpoints = function(leavingIds, enteringIds) {
  456. VideoLayout.onLastNEndpointsChanged(leavingIds, enteringIds);
  457. };
  458. /**
  459. * Update audio level visualization for specified user.
  460. * @param {string} id user id
  461. * @param {number} lvl audio level
  462. */
  463. UI.setAudioLevel = (id, lvl) => VideoLayout.setAudioLevel(id, lvl);
  464. /**
  465. * Hide connection quality statistics from UI.
  466. */
  467. UI.hideStats = function() {
  468. VideoLayout.hideStats();
  469. };
  470. UI.notifyTokenAuthFailed = function() {
  471. messageHandler.showError({
  472. descriptionKey: 'dialog.tokenAuthFailed',
  473. titleKey: 'dialog.tokenAuthFailedTitle'
  474. });
  475. };
  476. UI.notifyInternalError = function(error) {
  477. messageHandler.showError({
  478. descriptionArguments: { error },
  479. descriptionKey: 'dialog.internalError',
  480. titleKey: 'dialog.internalErrorTitle'
  481. });
  482. };
  483. UI.notifyFocusDisconnected = function(focus, retrySec) {
  484. messageHandler.participantNotification(
  485. null, 'notify.focus',
  486. 'disconnected', 'notify.focusFail',
  487. { component: focus,
  488. ms: retrySec }
  489. );
  490. };
  491. /**
  492. * Notifies interested listeners that the raise hand property has changed.
  493. *
  494. * @param {boolean} isRaisedHand indicates the current state of the
  495. * "raised hand"
  496. */
  497. UI.onLocalRaiseHandChanged = function(isRaisedHand) {
  498. eventEmitter.emit(UIEvents.LOCAL_RAISE_HAND_CHANGED, isRaisedHand);
  499. };
  500. /**
  501. * Update list of available physical devices.
  502. */
  503. UI.onAvailableDevicesChanged = function() {
  504. APP.conference.updateAudioIconEnabled();
  505. APP.conference.updateVideoIconEnabled();
  506. };
  507. /**
  508. * Returns the id of the current video shown on large.
  509. * Currently used by tests (torture).
  510. */
  511. UI.getLargeVideoID = function() {
  512. return VideoLayout.getLargeVideoID();
  513. };
  514. /**
  515. * Returns the current video shown on large.
  516. * Currently used by tests (torture).
  517. */
  518. UI.getLargeVideo = function() {
  519. return VideoLayout.getLargeVideo();
  520. };
  521. /**
  522. * Shows "Please go to chrome webstore to install the desktop sharing extension"
  523. * 2 button dialog with buttons - cancel and go to web store.
  524. * @param url {string} the url of the extension.
  525. */
  526. UI.showExtensionExternalInstallationDialog = function(url) {
  527. let openedWindow = null;
  528. const submitFunction = function(e, v) {
  529. if (v) {
  530. e.preventDefault();
  531. if (openedWindow === null || openedWindow.closed) {
  532. openedWindow
  533. = window.open(
  534. url,
  535. 'extension_store_window',
  536. 'resizable,scrollbars=yes,status=1');
  537. } else {
  538. openedWindow.focus();
  539. }
  540. }
  541. };
  542. const closeFunction = function(e, v) {
  543. if (openedWindow) {
  544. // Ideally we would close the popup, but this does not seem to work
  545. // on Chrome. Leaving it uncommented in case it could work
  546. // in some version.
  547. openedWindow.close();
  548. openedWindow = null;
  549. }
  550. if (!v) {
  551. eventEmitter.emit(UIEvents.EXTERNAL_INSTALLATION_CANCELED);
  552. }
  553. };
  554. messageHandler.openTwoButtonDialog({
  555. titleKey: 'dialog.externalInstallationTitle',
  556. msgKey: 'dialog.externalInstallationMsg',
  557. leftButtonKey: 'dialog.goToStore',
  558. submitFunction,
  559. loadedFunction: $.noop,
  560. closeFunction
  561. });
  562. };
  563. /**
  564. * Shows a dialog which asks user to install the extension. This one is
  565. * displayed after installation is triggered from the script, but fails because
  566. * it must be initiated by user gesture.
  567. * @param callback {function} function to be executed after user clicks
  568. * the install button - it should make another attempt to install the extension.
  569. */
  570. UI.showExtensionInlineInstallationDialog = function(callback) {
  571. const submitFunction = function(e, v) {
  572. if (v) {
  573. callback();
  574. }
  575. };
  576. const closeFunction = function(e, v) {
  577. if (!v) {
  578. eventEmitter.emit(UIEvents.EXTERNAL_INSTALLATION_CANCELED);
  579. }
  580. };
  581. messageHandler.openTwoButtonDialog({
  582. titleKey: 'dialog.externalInstallationTitle',
  583. msgKey: 'dialog.inlineInstallationMsg',
  584. leftButtonKey: 'dialog.inlineInstallExtension',
  585. submitFunction,
  586. loadedFunction: $.noop,
  587. closeFunction
  588. });
  589. };
  590. /**
  591. * Show shared video.
  592. * @param {string} id the id of the sender of the command
  593. * @param {string} url video url
  594. * @param {string} attributes
  595. */
  596. UI.onSharedVideoStart = function(id, url, attributes) {
  597. if (sharedVideoManager) {
  598. sharedVideoManager.onSharedVideoStart(id, url, attributes);
  599. }
  600. };
  601. /**
  602. * Update shared video.
  603. * @param {string} id the id of the sender of the command
  604. * @param {string} url video url
  605. * @param {string} attributes
  606. */
  607. UI.onSharedVideoUpdate = function(id, url, attributes) {
  608. if (sharedVideoManager) {
  609. sharedVideoManager.onSharedVideoUpdate(id, url, attributes);
  610. }
  611. };
  612. /**
  613. * Stop showing shared video.
  614. * @param {string} id the id of the sender of the command
  615. * @param {string} attributes
  616. */
  617. UI.onSharedVideoStop = function(id, attributes) {
  618. if (sharedVideoManager) {
  619. sharedVideoManager.onSharedVideoStop(id, attributes);
  620. }
  621. };
  622. /**
  623. * Handles user's features changes.
  624. */
  625. UI.onUserFeaturesChanged = user => VideoLayout.onUserFeaturesChanged(user);
  626. /**
  627. * Returns the number of known remote videos.
  628. *
  629. * @returns {number} The number of remote videos.
  630. */
  631. UI.getRemoteVideosCount = () => VideoLayout.getRemoteVideosCount();
  632. /**
  633. * Sets the remote control active status for a remote participant.
  634. *
  635. * @param {string} participantID - The id of the remote participant.
  636. * @param {boolean} isActive - The new remote control active status.
  637. * @returns {void}
  638. */
  639. UI.setRemoteControlActiveStatus = function(participantID, isActive) {
  640. VideoLayout.setRemoteControlActiveStatus(participantID, isActive);
  641. };
  642. /**
  643. * Sets the remote control active status for the local participant.
  644. *
  645. * @returns {void}
  646. */
  647. UI.setLocalRemoteControlActiveChanged = function() {
  648. VideoLayout.setLocalRemoteControlActiveChanged();
  649. };
  650. // TODO: Export every function separately. For now there is no point of doing
  651. // this because we are importing everything.
  652. export default UI;