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.

functions.js 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  1. /* global APP */
  2. import { getMultipleVideoSupportFeatureFlag } from '../config/functions.any';
  3. import { isMobileBrowser } from '../environment/utils';
  4. import JitsiMeetJS, { JitsiTrackErrors, browser } from '../lib-jitsi-meet';
  5. import { MEDIA_TYPE, VIDEO_TYPE, setAudioMuted } from '../media';
  6. import { getFakeScreenShareParticipantOwnerId } from '../participants';
  7. import { toState } from '../redux';
  8. import {
  9. getUserSelectedCameraDeviceId,
  10. getUserSelectedMicDeviceId
  11. } from '../settings';
  12. import loadEffects from './loadEffects';
  13. import logger from './logger';
  14. /**
  15. * Returns root tracks state.
  16. *
  17. * @param {Object} state - Global state.
  18. * @returns {Object} Tracks state.
  19. */
  20. export const getTrackState = state => state['features/base/tracks'];
  21. /**
  22. * Checks if the passed media type is muted for the participant.
  23. *
  24. * @param {Object} participant - Participant reference.
  25. * @param {MEDIA_TYPE} mediaType - Media type.
  26. * @param {Object} state - Global state.
  27. * @returns {boolean} - Is the media type muted for the participant.
  28. */
  29. export function isParticipantMediaMuted(participant, mediaType, state) {
  30. if (!participant) {
  31. return false;
  32. }
  33. const tracks = getTrackState(state);
  34. if (participant?.local) {
  35. return isLocalTrackMuted(tracks, mediaType);
  36. } else if (!participant?.isFakeParticipant) {
  37. return isRemoteTrackMuted(tracks, mediaType, participant.id);
  38. }
  39. return true;
  40. }
  41. /**
  42. * Checks if the participant is audio muted.
  43. *
  44. * @param {Object} participant - Participant reference.
  45. * @param {Object} state - Global state.
  46. * @returns {boolean} - Is audio muted for the participant.
  47. */
  48. export function isParticipantAudioMuted(participant, state) {
  49. return isParticipantMediaMuted(participant, MEDIA_TYPE.AUDIO, state);
  50. }
  51. /**
  52. * Checks if the participant is video muted.
  53. *
  54. * @param {Object} participant - Participant reference.
  55. * @param {Object} state - Global state.
  56. * @returns {boolean} - Is video muted for the participant.
  57. */
  58. export function isParticipantVideoMuted(participant, state) {
  59. return isParticipantMediaMuted(participant, MEDIA_TYPE.VIDEO, state);
  60. }
  61. /**
  62. * Creates a local video track for presenter. The constraints are computed based
  63. * on the height of the desktop that is being shared.
  64. *
  65. * @param {Object} options - The options with which the local presenter track
  66. * is to be created.
  67. * @param {string|null} [options.cameraDeviceId] - Camera device id or
  68. * {@code undefined} to use app's settings.
  69. * @param {number} desktopHeight - The height of the desktop that is being
  70. * shared.
  71. * @returns {Promise<JitsiLocalTrack>}
  72. */
  73. export async function createLocalPresenterTrack(options, desktopHeight) {
  74. const { cameraDeviceId } = options;
  75. // compute the constraints of the camera track based on the resolution
  76. // of the desktop screen that is being shared.
  77. const cameraHeights = [ 180, 270, 360, 540, 720 ];
  78. const proportion = 5;
  79. const result = cameraHeights.find(
  80. height => (desktopHeight / proportion) < height);
  81. const constraints = {
  82. video: {
  83. aspectRatio: 4 / 3,
  84. height: {
  85. ideal: result
  86. }
  87. }
  88. };
  89. const [ videoTrack ] = await JitsiMeetJS.createLocalTracks(
  90. {
  91. cameraDeviceId,
  92. constraints,
  93. devices: [ 'video' ]
  94. });
  95. videoTrack.type = MEDIA_TYPE.PRESENTER;
  96. return videoTrack;
  97. }
  98. /**
  99. * Create local tracks of specific types.
  100. *
  101. * @param {Object} options - The options with which the local tracks are to be
  102. * created.
  103. * @param {string|null} [options.cameraDeviceId] - Camera device id or
  104. * {@code undefined} to use app's settings.
  105. * @param {string[]} options.devices - Required track types such as 'audio'
  106. * and/or 'video'.
  107. * @param {string|null} [options.micDeviceId] - Microphone device id or
  108. * {@code undefined} to use app's settings.
  109. * @param {number|undefined} [oprions.timeout] - A timeout for JitsiMeetJS.createLocalTracks used to create the tracks.
  110. * @param {boolean} [options.firePermissionPromptIsShownEvent] - Whether lib-jitsi-meet
  111. * should check for a {@code getUserMedia} permission prompt and fire a
  112. * corresponding event.
  113. * @param {boolean} [options.fireSlowPromiseEvent] - Whether lib-jitsi-meet
  114. * should check for a slow {@code getUserMedia} request and fire a
  115. * corresponding event.
  116. * @param {Object} store - The redux store in the context of which the function
  117. * is to execute and from which state such as {@code config} is to be retrieved.
  118. * @returns {Promise<JitsiLocalTrack[]>}
  119. */
  120. export function createLocalTracksF(options = {}, store) {
  121. let { cameraDeviceId, micDeviceId } = options;
  122. const {
  123. desktopSharingSourceDevice,
  124. desktopSharingSources,
  125. firePermissionPromptIsShownEvent,
  126. fireSlowPromiseEvent,
  127. timeout
  128. } = options;
  129. if (typeof APP !== 'undefined') {
  130. // TODO The app's settings should go in the redux store and then the
  131. // reliance on the global variable APP will go away.
  132. store || (store = APP.store); // eslint-disable-line no-param-reassign
  133. const state = store.getState();
  134. if (typeof cameraDeviceId === 'undefined' || cameraDeviceId === null) {
  135. cameraDeviceId = getUserSelectedCameraDeviceId(state);
  136. }
  137. if (typeof micDeviceId === 'undefined' || micDeviceId === null) {
  138. micDeviceId = getUserSelectedMicDeviceId(state);
  139. }
  140. }
  141. const state = store.getState();
  142. const {
  143. desktopSharingFrameRate,
  144. firefox_fake_device, // eslint-disable-line camelcase
  145. resolution
  146. } = state['features/base/config'];
  147. const constraints = options.constraints ?? state['features/base/config'].constraints;
  148. return (
  149. loadEffects(store).then(effectsArray => {
  150. // Filter any undefined values returned by Promise.resolve().
  151. const effects = effectsArray.filter(effect => Boolean(effect));
  152. return JitsiMeetJS.createLocalTracks(
  153. {
  154. cameraDeviceId,
  155. constraints,
  156. desktopSharingFrameRate,
  157. desktopSharingSourceDevice,
  158. desktopSharingSources,
  159. // Copy array to avoid mutations inside library.
  160. devices: options.devices.slice(0),
  161. effects,
  162. firefox_fake_device, // eslint-disable-line camelcase
  163. firePermissionPromptIsShownEvent,
  164. fireSlowPromiseEvent,
  165. micDeviceId,
  166. resolution,
  167. timeout
  168. })
  169. .catch(err => {
  170. logger.error('Failed to create local tracks', options.devices, err);
  171. return Promise.reject(err);
  172. });
  173. }));
  174. }
  175. /**
  176. * Returns an object containing a promise which resolves with the created tracks &
  177. * the errors resulting from that process.
  178. *
  179. * @returns {Promise<JitsiLocalTrack>}
  180. *
  181. * @todo Refactor to not use APP.
  182. */
  183. export function createPrejoinTracks() {
  184. const errors = {};
  185. const initialDevices = [ 'audio' ];
  186. const requestedAudio = true;
  187. let requestedVideo = false;
  188. const { startAudioOnly, startWithAudioMuted, startWithVideoMuted } = APP.store.getState()['features/base/settings'];
  189. // Always get a handle on the audio input device so that we have statistics even if the user joins the
  190. // conference muted. Previous implementation would only acquire the handle when the user first unmuted,
  191. // which would results in statistics ( such as "No audio input" or "Are you trying to speak?") being available
  192. // only after that point.
  193. if (startWithAudioMuted) {
  194. APP.store.dispatch(setAudioMuted(true));
  195. }
  196. if (!startWithVideoMuted && !startAudioOnly) {
  197. initialDevices.push('video');
  198. requestedVideo = true;
  199. }
  200. let tryCreateLocalTracks;
  201. if (!requestedAudio && !requestedVideo) {
  202. // Resolve with no tracks
  203. tryCreateLocalTracks = Promise.resolve([]);
  204. } else {
  205. tryCreateLocalTracks = createLocalTracksF({
  206. devices: initialDevices,
  207. firePermissionPromptIsShownEvent: true
  208. })
  209. .catch(err => {
  210. if (requestedAudio && requestedVideo) {
  211. // Try audio only...
  212. errors.audioAndVideoError = err;
  213. return (
  214. createLocalTracksF({
  215. devices: [ 'audio' ],
  216. firePermissionPromptIsShownEvent: true
  217. }));
  218. } else if (requestedAudio && !requestedVideo) {
  219. errors.audioOnlyError = err;
  220. return [];
  221. } else if (requestedVideo && !requestedAudio) {
  222. errors.videoOnlyError = err;
  223. return [];
  224. }
  225. logger.error('Should never happen');
  226. })
  227. .catch(err => {
  228. // Log this just in case...
  229. if (!requestedAudio) {
  230. logger.error('The impossible just happened', err);
  231. }
  232. errors.audioOnlyError = err;
  233. // Try video only...
  234. return requestedVideo
  235. ? createLocalTracksF({
  236. devices: [ 'video' ],
  237. firePermissionPromptIsShownEvent: true
  238. })
  239. : [];
  240. })
  241. .catch(err => {
  242. // Log this just in case...
  243. if (!requestedVideo) {
  244. logger.error('The impossible just happened', err);
  245. }
  246. errors.videoOnlyError = err;
  247. return [];
  248. });
  249. }
  250. return {
  251. tryCreateLocalTracks,
  252. errors
  253. };
  254. }
  255. /**
  256. * Returns local audio track.
  257. *
  258. * @param {Track[]} tracks - List of all tracks.
  259. * @returns {(Track|undefined)}
  260. */
  261. export function getLocalAudioTrack(tracks) {
  262. return getLocalTrack(tracks, MEDIA_TYPE.AUDIO);
  263. }
  264. /**
  265. * Returns the local desktop track.
  266. *
  267. * @param {Track[]} tracks - List of all tracks.
  268. * @param {boolean} [includePending] - Indicates whether a local track is to be returned if it is still pending.
  269. * A local track is pending if {@code getUserMedia} is still executing to create it and, consequently, its
  270. * {@code jitsiTrack} property is {@code undefined}. By default a pending local track is not returned.
  271. * @returns {(Track|undefined)}
  272. */
  273. export function getLocalDesktopTrack(tracks, includePending = false) {
  274. return (
  275. getLocalTracks(tracks, includePending)
  276. .find(t => t.mediaType === MEDIA_TYPE.SCREENSHARE || t.videoType === VIDEO_TYPE.DESKTOP));
  277. }
  278. /**
  279. * Returns the stored local desktop jitsiLocalTrack.
  280. *
  281. * @param {Object} state - The redux state.
  282. * @returns {JitsiLocalTrack|undefined}
  283. */
  284. export function getLocalJitsiDesktopTrack(state) {
  285. const track = getLocalDesktopTrack(getTrackState(state));
  286. return track?.jitsiTrack;
  287. }
  288. /**
  289. * Returns local track by media type.
  290. *
  291. * @param {Track[]} tracks - List of all tracks.
  292. * @param {MEDIA_TYPE} mediaType - Media type.
  293. * @param {boolean} [includePending] - Indicates whether a local track is to be
  294. * returned if it is still pending. A local track is pending if
  295. * {@code getUserMedia} is still executing to create it and, consequently, its
  296. * {@code jitsiTrack} property is {@code undefined}. By default a pending local
  297. * track is not returned.
  298. * @returns {(Track|undefined)}
  299. */
  300. export function getLocalTrack(tracks, mediaType, includePending = false) {
  301. return (
  302. getLocalTracks(tracks, includePending)
  303. .find(t => t.mediaType === mediaType));
  304. }
  305. /**
  306. * Returns an array containing the local tracks with or without a (valid)
  307. * {@code JitsiTrack}.
  308. *
  309. * @param {Track[]} tracks - An array containing all local tracks.
  310. * @param {boolean} [includePending] - Indicates whether a local track is to be
  311. * returned if it is still pending. A local track is pending if
  312. * {@code getUserMedia} is still executing to create it and, consequently, its
  313. * {@code jitsiTrack} property is {@code undefined}. By default a pending local
  314. * track is not returned.
  315. * @returns {Track[]}
  316. */
  317. export function getLocalTracks(tracks, includePending = false) {
  318. // XXX A local track is considered ready only once it has its `jitsiTrack`
  319. // property set by the `TRACK_ADDED` action. Until then there is a stub
  320. // added just before the `getUserMedia` call with a cancellable
  321. // `gumInProgress` property which then can be used to destroy the track that
  322. // has not yet been added to the redux store. Once GUM is cancelled, it will
  323. // never make it to the store nor there will be any
  324. // `TRACK_ADDED`/`TRACK_REMOVED` actions dispatched for it.
  325. return tracks.filter(t => t.local && (t.jitsiTrack || includePending));
  326. }
  327. /**
  328. * Returns local video track.
  329. *
  330. * @param {Track[]} tracks - List of all tracks.
  331. * @returns {(Track|undefined)}
  332. */
  333. export function getLocalVideoTrack(tracks) {
  334. return getLocalTrack(tracks, MEDIA_TYPE.VIDEO);
  335. }
  336. /**
  337. * Returns the media type of the local video, presenter or video.
  338. *
  339. * @param {Track[]} tracks - List of all tracks.
  340. * @returns {MEDIA_TYPE}
  341. */
  342. export function getLocalVideoType(tracks) {
  343. const presenterTrack = getLocalTrack(tracks, MEDIA_TYPE.PRESENTER);
  344. return presenterTrack ? MEDIA_TYPE.PRESENTER : MEDIA_TYPE.VIDEO;
  345. }
  346. /**
  347. * Returns the stored local video track.
  348. *
  349. * @param {Object} state - The redux state.
  350. * @returns {Object}
  351. */
  352. export function getLocalJitsiVideoTrack(state) {
  353. const track = getLocalVideoTrack(getTrackState(state));
  354. return track?.jitsiTrack;
  355. }
  356. /**
  357. * Returns the stored local audio track.
  358. *
  359. * @param {Object} state - The redux state.
  360. * @returns {Object}
  361. */
  362. export function getLocalJitsiAudioTrack(state) {
  363. const track = getLocalAudioTrack(getTrackState(state));
  364. return track?.jitsiTrack;
  365. }
  366. /**
  367. * Returns track of specified media type for specified participant.
  368. *
  369. * @param {Track[]} tracks - List of all tracks.
  370. * @param {Object} participant - Participant Object.
  371. * @returns {(Track|undefined)}
  372. */
  373. export function getVideoTrackByParticipant(
  374. tracks,
  375. participant) {
  376. if (!participant) {
  377. return;
  378. }
  379. let participantId;
  380. let mediaType;
  381. if (participant?.isFakeScreenShareParticipant) {
  382. participantId = getFakeScreenShareParticipantOwnerId(participant.id);
  383. mediaType = MEDIA_TYPE.SCREENSHARE;
  384. } else {
  385. participantId = participant.id;
  386. mediaType = MEDIA_TYPE.VIDEO;
  387. }
  388. return getTrackByMediaTypeAndParticipant(tracks, mediaType, participantId);
  389. }
  390. /**
  391. * Returns track of specified media type for specified participant id.
  392. *
  393. * @param {Track[]} tracks - List of all tracks.
  394. * @param {MEDIA_TYPE} mediaType - Media type.
  395. * @param {string} participantId - Participant ID.
  396. * @returns {(Track|undefined)}
  397. */
  398. export function getTrackByMediaTypeAndParticipant(
  399. tracks,
  400. mediaType,
  401. participantId) {
  402. return tracks.find(
  403. t => Boolean(t.jitsiTrack) && t.participantId === participantId && t.mediaType === mediaType
  404. );
  405. }
  406. /**
  407. * Returns track of given fakeScreenshareParticipantId.
  408. *
  409. * @param {Track[]} tracks - List of all tracks.
  410. * @param {string} fakeScreenshareParticipantId - Fake Screenshare Participant ID.
  411. * @returns {(Track|undefined)}
  412. */
  413. export function getFakeScreenshareParticipantTrack(tracks, fakeScreenshareParticipantId) {
  414. const participantId = getFakeScreenShareParticipantOwnerId(fakeScreenshareParticipantId);
  415. return getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.SCREENSHARE, participantId);
  416. }
  417. /**
  418. * Returns track source name of specified media type for specified participant id.
  419. *
  420. * @param {Track[]} tracks - List of all tracks.
  421. * @param {MEDIA_TYPE} mediaType - Media type.
  422. * @param {string} participantId - Participant ID.
  423. * @returns {(string|undefined)}
  424. */
  425. export function getTrackSourceNameByMediaTypeAndParticipant(
  426. tracks,
  427. mediaType,
  428. participantId) {
  429. const track = getTrackByMediaTypeAndParticipant(
  430. tracks,
  431. mediaType,
  432. participantId);
  433. return track?.jitsiTrack?.getSourceName();
  434. }
  435. /**
  436. * Returns the track if any which corresponds to a specific instance
  437. * of JitsiLocalTrack or JitsiRemoteTrack.
  438. *
  439. * @param {Track[]} tracks - List of all tracks.
  440. * @param {(JitsiLocalTrack|JitsiRemoteTrack)} jitsiTrack - JitsiTrack instance.
  441. * @returns {(Track|undefined)}
  442. */
  443. export function getTrackByJitsiTrack(tracks, jitsiTrack) {
  444. return tracks.find(t => t.jitsiTrack === jitsiTrack);
  445. }
  446. /**
  447. * Returns tracks of specified media type.
  448. *
  449. * @param {Track[]} tracks - List of all tracks.
  450. * @param {MEDIA_TYPE} mediaType - Media type.
  451. * @returns {Track[]}
  452. */
  453. export function getTracksByMediaType(tracks, mediaType) {
  454. return tracks.filter(t => t.mediaType === mediaType);
  455. }
  456. /**
  457. * Checks if the local video camera track in the given set of tracks is muted.
  458. *
  459. * @param {Track[]} tracks - List of all tracks.
  460. * @returns {Track[]}
  461. */
  462. export function isLocalCameraTrackMuted(tracks) {
  463. const presenterTrack = getLocalTrack(tracks, MEDIA_TYPE.PRESENTER);
  464. const videoTrack = getLocalTrack(tracks, MEDIA_TYPE.VIDEO);
  465. // Make sure we check the mute status of only camera tracks, i.e.,
  466. // presenter track when it exists, camera track when the presenter
  467. // track doesn't exist.
  468. if (presenterTrack) {
  469. return isLocalTrackMuted(tracks, MEDIA_TYPE.PRESENTER);
  470. } else if (videoTrack) {
  471. return videoTrack.videoType === 'camera'
  472. ? isLocalTrackMuted(tracks, MEDIA_TYPE.VIDEO) : true;
  473. }
  474. return true;
  475. }
  476. /**
  477. * Checks if the first local track in the given tracks set is muted.
  478. *
  479. * @param {Track[]} tracks - List of all tracks.
  480. * @param {MEDIA_TYPE} mediaType - The media type of tracks to be checked.
  481. * @returns {boolean} True if local track is muted or false if the track is
  482. * unmuted or if there are no local tracks of the given media type in the given
  483. * set of tracks.
  484. */
  485. export function isLocalTrackMuted(tracks, mediaType) {
  486. const track = getLocalTrack(tracks, mediaType);
  487. return !track || track.muted;
  488. }
  489. /**
  490. * Checks if the local video track is of type DESKtOP.
  491. *
  492. * @param {Object} state - The redux state.
  493. * @returns {boolean}
  494. */
  495. export function isLocalVideoTrackDesktop(state) {
  496. const videoTrack = getLocalVideoTrack(getTrackState(state));
  497. return videoTrack && videoTrack.videoType === VIDEO_TYPE.DESKTOP;
  498. }
  499. /**
  500. * Returns true if the remote track of the given media type and the given
  501. * participant is muted, false otherwise.
  502. *
  503. * @param {Track[]} tracks - List of all tracks.
  504. * @param {MEDIA_TYPE} mediaType - The media type of tracks to be checked.
  505. * @param {*} participantId - Participant ID.
  506. * @returns {boolean}
  507. */
  508. export function isRemoteTrackMuted(tracks, mediaType, participantId) {
  509. const track = getTrackByMediaTypeAndParticipant(
  510. tracks, mediaType, participantId);
  511. return !track || track.muted;
  512. }
  513. /**
  514. * Returns whether or not the current environment needs a user interaction with
  515. * the page before any unmute can occur.
  516. *
  517. * @param {Object} state - The redux state.
  518. * @returns {boolean}
  519. */
  520. export function isUserInteractionRequiredForUnmute(state) {
  521. return browser.isUserInteractionRequiredForUnmute()
  522. && window
  523. && window.self !== window.top
  524. && !state['features/base/user-interaction'].interacted;
  525. }
  526. /**
  527. * Mutes or unmutes a specific {@code JitsiLocalTrack}. If the muted state of the specified {@code track} is already in
  528. * accord with the specified {@code muted} value, then does nothing.
  529. *
  530. * @param {JitsiLocalTrack} track - The {@code JitsiLocalTrack} to mute or unmute.
  531. * @param {boolean} muted - If the specified {@code track} is to be muted, then {@code true}; otherwise, {@code false}.
  532. * @param {Object} state - The redux state.
  533. * @returns {Promise}
  534. */
  535. export function setTrackMuted(track, muted, state) {
  536. muted = Boolean(muted); // eslint-disable-line no-param-reassign
  537. // Ignore the check for desktop track muted operation. When the screenshare is terminated by clicking on the
  538. // browser's 'Stop sharing' button, the local stream is stopped before the inactive stream handler is fired.
  539. // We still need to proceed here and remove the track from the peerconnection.
  540. if (track.isMuted() === muted
  541. && !(track.getVideoType() === VIDEO_TYPE.DESKTOP && getMultipleVideoSupportFeatureFlag(state))) {
  542. return Promise.resolve();
  543. }
  544. const f = muted ? 'mute' : 'unmute';
  545. return track[f]().catch(error => {
  546. // Track might be already disposed so ignore such an error.
  547. if (error.name !== JitsiTrackErrors.TRACK_IS_DISPOSED) {
  548. logger.error(`set track ${f} failed`, error);
  549. return Promise.reject(error);
  550. }
  551. });
  552. }
  553. /**
  554. * Determines whether toggle camera should be enabled or not.
  555. *
  556. * @param {Function|Object} stateful - The redux store or {@code getState} function.
  557. * @returns {boolean} - Whether toggle camera should be enabled.
  558. */
  559. export function isToggleCameraEnabled(stateful) {
  560. const state = toState(stateful);
  561. const { videoInput } = state['features/base/devices'].availableDevices;
  562. return isMobileBrowser() && videoInput.length > 1;
  563. }