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.

JitsiMeetJS.ts 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  1. import Logger from '@jitsi/logger';
  2. import { merge } from 'lodash-es';
  3. import JitsiConference from './JitsiConference';
  4. import * as JitsiConferenceErrors from './JitsiConferenceErrors';
  5. import * as JitsiConferenceEvents from './JitsiConferenceEvents';
  6. import JitsiConnection from './JitsiConnection';
  7. import * as JitsiConnectionErrors from './JitsiConnectionErrors';
  8. import { JitsiConnectionEvents } from './JitsiConnectionEvents';
  9. import JitsiMediaDevices from './JitsiMediaDevices';
  10. import * as JitsiMediaDevicesEvents from './JitsiMediaDevicesEvents';
  11. import JitsiTrackError from './JitsiTrackError';
  12. import * as JitsiTrackErrors from './JitsiTrackErrors';
  13. import * as JitsiTrackEvents from './JitsiTrackEvents';
  14. import * as JitsiTranscriptionStatus from './JitsiTranscriptionStatus';
  15. import JitsiLocalTrack from './modules/RTC/JitsiLocalTrack';
  16. import RTC from './modules/RTC/RTC';
  17. import RTCStats from './modules/RTCStats/RTCStats';
  18. import * as RTCStatsEvents from './modules/RTCStats/RTCStatsEvents';
  19. import browser from './modules/browser';
  20. import NetworkInfo from './modules/connectivity/NetworkInfo';
  21. import { TrackStreamingStatus } from './modules/connectivity/TrackStreamingStatus';
  22. import getActiveAudioDevice from './modules/detection/ActiveDeviceDetector';
  23. import * as DetectionEvents from './modules/detection/DetectionEvents';
  24. import TrackVADEmitter from './modules/detection/TrackVADEmitter';
  25. import ProxyConnectionService
  26. from './modules/proxyconnection/ProxyConnectionService';
  27. import recordingConstants from './modules/recording/recordingConstants';
  28. import Settings from './modules/settings/Settings';
  29. import LocalStatsCollector from './modules/statistics/LocalStatsCollector';
  30. import runPreCallTest, { IIceServer, IPreCallResult } from './modules/statistics/PreCallTest';
  31. import Statistics from './modules/statistics/statistics';
  32. import Deferred from './modules/util/Deferred';
  33. import ScriptUtil from './modules/util/ScriptUtil';
  34. import * as VideoSIPGWConstants from './modules/videosipgw/VideoSIPGWConstants';
  35. import AudioMixer from './modules/webaudio/AudioMixer';
  36. import { MediaType } from './service/RTC/MediaType';
  37. import { VideoType } from './service/RTC/VideoType';
  38. import * as ConnectionQualityEvents
  39. from './service/connectivity/ConnectionQualityEvents';
  40. import * as E2ePingEvents from './service/e2eping/E2ePingEvents';
  41. import { createGetUserMediaEvent } from './service/statistics/AnalyticsEvents';
  42. import { COMMIT_HASH } from './version';
  43. const logger = Logger.getLogger('JitsiMeetJS');
  44. // Settin the default log levels to info early so that we avoid overriding a log level set externally.
  45. Logger.setLogLevel(Logger.levels.INFO);
  46. /**
  47. * Indicates whether GUM has been executed or not.
  48. */
  49. let hasGUMExecuted = false;
  50. /**
  51. * Extracts from an 'options' objects with a specific format (TODO what IS the
  52. * format?) the attributes which are to be logged in analytics events.
  53. *
  54. * @param options gum options (???)
  55. * @returns {*} the attributes to attach to analytics events.
  56. */
  57. function getAnalyticsAttributesFromOptions(options) {
  58. const attributes: any = {};
  59. /* eslint-disable */
  60. attributes.audio_requested = options.devices.includes(MediaType.AUDIO);
  61. attributes.video_requested = options.devices.includes(MediaType.VIDEO);
  62. attributes.screen_sharing_requested = options.devices.includes(VideoType.DESKTOP);
  63. if (attributes.video_requested) {
  64. attributes.resolution = options.resolution;
  65. }
  66. /* eslint-enable */
  67. return attributes;
  68. }
  69. interface ICreateLocalTrackOptions {
  70. cameraDeviceId?: string;
  71. devices?: any[];
  72. fireSlowPromiseEvent?: boolean;
  73. micDeviceId?: string;
  74. resolution?: string;
  75. }
  76. type desktopSharingSourceType = 'screen' | 'window';
  77. interface IJitsiMeetJSOptions {
  78. analytics?: {
  79. rtcstatsLogFlushSizeBytes?: number;
  80. rtcstatsStoreLogs?: boolean;
  81. };
  82. desktopSharingSources?: Array<desktopSharingSourceType>;
  83. enableAnalyticsLogging?: boolean;
  84. enableWindowOnErrorHandler?: boolean;
  85. externalStorage?: Storage;
  86. flags?: {
  87. runInLiteMode?: boolean;
  88. ssrcRewritingEnabled?: boolean;
  89. };
  90. }
  91. interface ICreateLocalTrackFromMediaStreamOptions {
  92. mediaType: MediaType;
  93. sourceType: string;
  94. stream: MediaStream;
  95. track: any;
  96. videoType?: VideoType;
  97. }
  98. export interface IJoinConferenceOptions {
  99. conferenceOptions?: any;
  100. connectionOptions?: any;
  101. jaas?: {
  102. release?: boolean;
  103. useStaging?: boolean;
  104. };
  105. tracks?: JitsiLocalTrack[];
  106. }
  107. /**
  108. * The public API of the Jitsi Meet library (a.k.a. {@code JitsiMeetJS}).
  109. */
  110. export default {
  111. version: COMMIT_HASH,
  112. JitsiConnection,
  113. /**
  114. * {@code ProxyConnectionService} is used to connect a remote peer to a
  115. * local Jitsi participant without going through a Jitsi conference. It is
  116. * currently used for room integration development, specifically wireless
  117. * screensharing. Its API is experimental and will likely change; usage of
  118. * it is advised against.
  119. */
  120. ProxyConnectionService,
  121. constants: {
  122. recording: recordingConstants,
  123. sipVideoGW: VideoSIPGWConstants,
  124. transcriptionStatus: JitsiTranscriptionStatus,
  125. trackStreamingStatus: TrackStreamingStatus
  126. },
  127. events: {
  128. conference: JitsiConferenceEvents,
  129. connection: JitsiConnectionEvents,
  130. detection: DetectionEvents,
  131. track: JitsiTrackEvents,
  132. mediaDevices: JitsiMediaDevicesEvents,
  133. connectionQuality: ConnectionQualityEvents,
  134. e2eping: E2ePingEvents,
  135. rtcstats: RTCStatsEvents
  136. },
  137. errors: {
  138. conference: JitsiConferenceErrors,
  139. connection: JitsiConnectionErrors,
  140. track: JitsiTrackErrors
  141. },
  142. errorTypes: {
  143. JitsiTrackError
  144. },
  145. logLevels: Logger.levels,
  146. mediaDevices: JitsiMediaDevices as unknown,
  147. analytics: Statistics.analytics as unknown,
  148. init(options: IJitsiMeetJSOptions = {}) {
  149. // Start capturing and sending logs to the rtcstats server as soon as possible.
  150. const {
  151. analytics: {
  152. rtcstatsStoreLogs,
  153. rtcstatsLogFlushSizeBytes
  154. } = {}
  155. } = options;
  156. if (rtcstatsStoreLogs) {
  157. Logger.addGlobalTransport(RTCStats.getDefaultLogCollector(rtcstatsLogFlushSizeBytes));
  158. }
  159. // @ts-ignore
  160. logger.info(`This appears to be ${browser.getName()}, ver: ${browser.getVersion()}`);
  161. JitsiMediaDevices.init();
  162. Settings.init(options.externalStorage);
  163. Statistics.init(options);
  164. // Initialize global window.connectionTimes
  165. // FIXME do not use 'window'
  166. if (!window.connectionTimes) {
  167. window.connectionTimes = {};
  168. }
  169. if (options.enableAnalyticsLogging !== true) {
  170. logger.warn('Analytics disabled, disposing.');
  171. this.analytics.dispose();
  172. }
  173. return RTC.init(options);
  174. },
  175. /**
  176. * Returns whether the desktop sharing is enabled or not.
  177. *
  178. * @returns {boolean}
  179. */
  180. isDesktopSharingEnabled() {
  181. return RTC.isDesktopSharingEnabled();
  182. },
  183. /**
  184. * Returns whether the current execution environment supports WebRTC (for
  185. * use within this library).
  186. *
  187. * @returns {boolean} {@code true} if WebRTC is supported in the current
  188. * execution environment (for use within this library); {@code false},
  189. * otherwise.
  190. */
  191. isWebRtcSupported() {
  192. return RTC.isWebRtcSupported();
  193. },
  194. setLogLevel(level) {
  195. Logger.setLogLevel(level);
  196. },
  197. /**
  198. * Expose rtcstats to the public API.
  199. */
  200. rtcstats: {
  201. /**
  202. * Checks if the rtcstats trace is available.
  203. * The trace is the abstraction for the underlying rtcstats websocket connection.
  204. *
  205. * @returns {boolean} <tt>true</tt> if the rtcstats trace is available or
  206. * <tt>false</tt> otherwise.
  207. */
  208. isTraceAvailable() {
  209. return RTCStats.isTraceAvailable();
  210. },
  211. /**
  212. * Sends identity data to the rtcstats server. This data is used
  213. * to identify the specifics of a particular client, it can be any object
  214. * and will show in the generated rtcstats dump under "identity" entries.
  215. *
  216. * @param {Object} identityData - Identity data to send.
  217. * @returns {void}
  218. */
  219. sendIdentityEntry(identityData) {
  220. RTCStats.sendIdentity(identityData);
  221. },
  222. /**
  223. * Sends a stats entry to rtcstats server.
  224. * @param {string} statsType - The type of stats to send.
  225. * @param {Object} data - The stats data to send.
  226. */
  227. sendStatsEntry(statsType, data) {
  228. RTCStats.sendStatsEntry(statsType, null, data);
  229. },
  230. /**
  231. * Events generated by rtcstats, such as PeerConnections state,
  232. * and websocket connection state.
  233. *
  234. * @param {RTCStatsEvents} event - The event name.
  235. * @param {function} handler - The event handler.
  236. */
  237. on(event, handler) {
  238. RTCStats.events.on(event, handler);
  239. }
  240. },
  241. /**
  242. * Sets the log level to the <tt>Logger</tt> instance with given id.
  243. *
  244. * @param {Logger.levels} level the logging level to be set
  245. * @param {string} id the logger id to which new logging level will be set.
  246. * Usually it's the name of the JavaScript source file including the path
  247. * ex. "modules/xmpp/ChatRoom.js"
  248. */
  249. setLogLevelById(level, id) {
  250. Logger.setLogLevelById(level, id);
  251. },
  252. /**
  253. * Registers new global logger transport to the library logging framework.
  254. *
  255. * @param globalTransport
  256. * @see Logger.addGlobalTransport
  257. */
  258. addGlobalLogTransport(globalTransport) {
  259. Logger.addGlobalTransport(globalTransport);
  260. },
  261. /**
  262. * Removes global logging transport from the library logging framework.
  263. *
  264. * @param globalTransport
  265. * @see Logger.removeGlobalTransport
  266. */
  267. removeGlobalLogTransport(globalTransport) {
  268. Logger.removeGlobalTransport(globalTransport);
  269. },
  270. /**
  271. * Sets global options which will be used by all loggers. Changing these
  272. * works even after other loggers are created.
  273. *
  274. * @param options
  275. * @see Logger.setGlobalOptions
  276. */
  277. setGlobalLogOptions(options) {
  278. Logger.setGlobalOptions(options);
  279. },
  280. /**
  281. * Creates local media tracks.
  282. *
  283. * @param options Object with properties / settings specifying the tracks
  284. * which should be created. should be created or some additional
  285. * configurations about resolution for example.
  286. * @param {Array} options.effects optional effects array for the track
  287. * @param {Array} options.devices the devices that will be requested
  288. * @param {string} options.resolution resolution constraints
  289. * @param {string} options.cameraDeviceId
  290. * @param {string} options.micDeviceId
  291. *
  292. * @returns {Promise.<{Array.<JitsiTrack>}, JitsiConferenceError>} A promise
  293. * that returns an array of created JitsiTracks if resolved, or a
  294. * JitsiConferenceError if rejected.
  295. */
  296. createLocalTracks(options: ICreateLocalTrackOptions = {}) {
  297. let isFirstGUM = false;
  298. const startTS = window.performance.now();
  299. if (!window.connectionTimes) {
  300. window.connectionTimes = {};
  301. }
  302. if (!hasGUMExecuted) {
  303. hasGUMExecuted = true;
  304. isFirstGUM = true;
  305. window.connectionTimes['firstObtainPermissions.start'] = startTS;
  306. }
  307. window.connectionTimes['obtainPermissions.start'] = startTS;
  308. return RTC.obtainAudioAndVideoPermissions(options)
  309. .then(tracks => {
  310. const endTS = window.performance.now();
  311. window.connectionTimes['obtainPermissions.end'] = endTS;
  312. if (isFirstGUM) {
  313. window.connectionTimes['firstObtainPermissions.end'] = endTS;
  314. }
  315. Statistics.sendAnalytics(
  316. createGetUserMediaEvent(
  317. 'success',
  318. getAnalyticsAttributesFromOptions(options)));
  319. if (this.isCollectingLocalStats()) {
  320. for (let i = 0; i < tracks.length; i++) {
  321. const track = tracks[i];
  322. if (track.getType() === MediaType.AUDIO) {
  323. Statistics.startLocalStats(track,
  324. track.setAudioLevel.bind(track));
  325. }
  326. }
  327. }
  328. // set real device ids
  329. const currentlyAvailableMediaDevices
  330. = RTC.getCurrentlyAvailableMediaDevices();
  331. if (currentlyAvailableMediaDevices) {
  332. for (let i = 0; i < tracks.length; i++) {
  333. const track = tracks[i];
  334. track._setRealDeviceIdFromDeviceList(
  335. currentlyAvailableMediaDevices);
  336. }
  337. }
  338. return tracks;
  339. })
  340. .catch(error => {
  341. if (error.name === JitsiTrackErrors.SCREENSHARING_USER_CANCELED) {
  342. Statistics.sendAnalytics(
  343. createGetUserMediaEvent(
  344. 'warning',
  345. {
  346. reason: 'extension install user canceled'
  347. }));
  348. } else if (error.name === JitsiTrackErrors.NOT_FOUND) {
  349. const attributes
  350. = getAnalyticsAttributesFromOptions(options);
  351. attributes.reason = 'device not found';
  352. attributes.devices = error.gum.devices.join('.');
  353. Statistics.sendAnalytics(
  354. createGetUserMediaEvent('error', attributes));
  355. } else {
  356. const attributes
  357. = getAnalyticsAttributesFromOptions(options);
  358. attributes.reason = error.name;
  359. Statistics.sendAnalytics(
  360. createGetUserMediaEvent('error', attributes));
  361. }
  362. const endTS = window.performance.now();
  363. window.connectionTimes['obtainPermissions.end'] = endTS;
  364. if (isFirstGUM) {
  365. window.connectionTimes['firstObtainPermissions.end'] = endTS;
  366. }
  367. return Promise.reject(error);
  368. });
  369. },
  370. /**
  371. * Manually create JitsiLocalTrack's from the provided track info, by exposing the RTC method
  372. *
  373. * @param {Array<ICreateLocalTrackFromMediaStreamOptions>} tracksInfo - array of track information
  374. * @returns {Array<JitsiLocalTrack>} - created local tracks
  375. */
  376. createLocalTracksFromMediaStreams(tracksInfo: ICreateLocalTrackFromMediaStreamOptions[]) {
  377. return RTC.createLocalTracks(tracksInfo.map(trackInfo => {
  378. const tracks = trackInfo.stream.getTracks()
  379. .filter(track => track.kind === trackInfo.mediaType);
  380. if (!tracks || tracks.length === 0) {
  381. // eslint-disable-next-line @typescript-eslint/only-throw-error
  382. throw new JitsiTrackError(JitsiTrackErrors.TRACK_NO_STREAM_TRACKS_FOUND, null, null);
  383. }
  384. if (tracks.length > 1) {
  385. // eslint-disable-next-line @typescript-eslint/only-throw-error
  386. throw new JitsiTrackError(JitsiTrackErrors.TRACK_TOO_MANY_TRACKS_IN_STREAM, null, null);
  387. }
  388. trackInfo.track = tracks[0];
  389. return trackInfo;
  390. }));
  391. },
  392. /**
  393. * Create a TrackVADEmitter service that connects an audio track to an VAD (voice activity detection) processor in
  394. * order to obtain VAD scores for individual PCM audio samples.
  395. * @param {string} localAudioDeviceId - The target local audio device.
  396. * @param {number} sampleRate - Sample rate at which the emitter will operate. Possible values 256, 512, 1024,
  397. * 4096, 8192, 16384. Passing other values will default to closes neighbor.
  398. * I.e. Providing a value of 4096 means that the emitter will process 4096 PCM samples at a time, higher values mean
  399. * longer calls, lowers values mean more calls but shorter.
  400. * @param {Object} vadProcessor - VAD Processors that does the actual compute on a PCM sample.The processor needs
  401. * to implement the following functions:
  402. * - <tt>getSampleLength()</tt> - Returns the sample size accepted by calculateAudioFrameVAD.
  403. * - <tt>getRequiredPCMFrequency()</tt> - Returns the PCM frequency at which the processor operates.
  404. * i.e. (16KHz, 44.1 KHz etc.)
  405. * - <tt>calculateAudioFrameVAD(pcmSample)</tt> - Process a 32 float pcm sample of getSampleLength size.
  406. * @returns {Promise<TrackVADEmitter>}
  407. */
  408. createTrackVADEmitter(localAudioDeviceId, sampleRate, vadProcessor) {
  409. return TrackVADEmitter.create(localAudioDeviceId, sampleRate, vadProcessor);
  410. },
  411. /**
  412. * Create AudioMixer, which is essentially a wrapper over web audio ChannelMergerNode. It essentially allows the
  413. * user to mix multiple MediaStreams into a single one.
  414. *
  415. * @returns {AudioMixer}
  416. */
  417. createAudioMixer() {
  418. return new AudioMixer();
  419. },
  420. /**
  421. * Go through all audio devices on the system and return one that is active, i.e. has audio signal.
  422. *
  423. * @returns Promise<Object> - Object containing information about the found device.
  424. */
  425. getActiveAudioDevice() {
  426. return getActiveAudioDevice();
  427. },
  428. /**
  429. * Checks if the current environment supports having multiple audio
  430. * input devices in use simultaneously.
  431. *
  432. * @returns {boolean} True if multiple audio input devices can be used.
  433. */
  434. isMultipleAudioInputSupported() {
  435. return this.mediaDevices.isMultipleAudioInputSupported();
  436. },
  437. /**
  438. * Checks if local tracks can collect stats and collection is enabled.
  439. *
  440. * @param {boolean} True if stats are being collected for local tracks.
  441. */
  442. isCollectingLocalStats() {
  443. return Statistics.audioLevelsEnabled && LocalStatsCollector.isLocalStatsSupported();
  444. },
  445. /**
  446. * Simple way to create a {JitsiConference}. All options are optional and sane defaults
  447. * will be chosen for JaaS users.
  448. *
  449. * @param roomName - The name of the conference.
  450. * @param appId - The application id (also known as tenant).
  451. * @param token - The token (JWT) to use for authentication.
  452. * @param options - The options to use for joining the conference.
  453. */
  454. async joinConference(
  455. roomName: string,
  456. appId: string = '',
  457. token: string | null = null,
  458. options: IJoinConferenceOptions = {}): Promise<JitsiConference> {
  459. const d = new Deferred();
  460. let connectionOptions = options.connectionOptions ?? {};
  461. // Provide a solid default config in case of JaaS.
  462. if (appId.startsWith('vpaas-magic-cookie')) {
  463. // Initialize RTCStats logging.
  464. Logger.addGlobalTransport(RTCStats.getDefaultLogCollector());
  465. const useStage = options.jaas?.useStaging ?? false;
  466. const jaasDomain = useStage ? 'staging.8x8.vc' : '8x8.vc';
  467. const opts = {
  468. hosts: {
  469. domain: jaasDomain,
  470. muc: `conference.${appId}.${jaasDomain}`
  471. },
  472. conferenceRequestUrl: `https://${jaasDomain}/${appId}/conference-request/v1?room=${roomName}`,
  473. serviceUrl: `wss://${jaasDomain}/${appId}/xmpp-websocket?room=${roomName}`,
  474. websocketKeepAliveUrl: `https://${jaasDomain}/${appId}/_unlock?room=${roomName}`,
  475. analytics: {
  476. rtcstatsEnabled: true,
  477. rtcstatsEndpoint: `wss://rtcstats-server-${useStage ? 'pilot' : '8x8'}.jitsi.net/`,
  478. rtcstatsSendSdp: true,
  479. },
  480. };
  481. connectionOptions = merge(connectionOptions, opts);
  482. }
  483. const conn = new JitsiConnection(appId, token, connectionOptions);
  484. function cleanupListeners() {
  485. conn.removeEventListener(
  486. JitsiConnectionEvents.CONNECTION_ESTABLISHED, onConnectionEstablished);
  487. conn.removeEventListener(
  488. JitsiConnectionEvents.CONNECTION_FAILED, onConnectionFailed);
  489. }
  490. function onConnectionEstablished() {
  491. cleanupListeners();
  492. const conf = conn.initJitsiConference(roomName, options.conferenceOptions ?? {});
  493. d.resolve(conf);
  494. // Make sure this runs after the promise was resolved so that local track events can be
  495. // listened to.
  496. queueMicrotask(() => {
  497. for (const track of options.tracks || []) {
  498. conf.addTrack(track);
  499. }
  500. conf.join();
  501. // Default to receiving 720p for everyone.
  502. conf.setReceiverConstraints({
  503. lastN: -1,
  504. defaultConstraints: { maxHeight: 720 },
  505. });
  506. });
  507. }
  508. function onConnectionFailed(error: string) {
  509. cleanupListeners();
  510. d.reject(error);
  511. }
  512. conn.addEventListener(
  513. JitsiConnectionEvents.CONNECTION_ESTABLISHED, onConnectionEstablished);
  514. conn.addEventListener(
  515. JitsiConnectionEvents.CONNECTION_FAILED, onConnectionFailed);
  516. conn.connect({ name: roomName });
  517. return d as unknown as Promise<JitsiConference>;
  518. },
  519. /**
  520. * Informs lib-jitsi-meet about the current network status.
  521. *
  522. * @param {object} state - The network info state.
  523. * @param {boolean} state.isOnline - {@code true} if the internet connectivity is online or {@code false}
  524. * otherwise.
  525. */
  526. setNetworkInfo({ isOnline }) {
  527. NetworkInfo.updateNetworkInfo({ isOnline });
  528. },
  529. /**
  530. * Run a pre-call test to check the network conditions.
  531. *
  532. * @param {IIceServer} iceServers - The ICE servers to use for the test,
  533. * @returns {Promise<PreCallResult | any>} - A Promise that resolves with the test results or rejects with an error
  534. * message.
  535. */
  536. runPreCallTest(iceServers: IIceServer[]): Promise<IPreCallResult | any> {
  537. return runPreCallTest(iceServers);
  538. },
  539. /**
  540. * Represents a hub/namespace for utility functionality which may be of
  541. * interest to lib-jitsi-meet clients.
  542. */
  543. util: {
  544. ScriptUtil,
  545. browser
  546. }
  547. };