Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

index.web.js 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* global APP */
  2. import React from 'react';
  3. import ReactDOM from 'react-dom';
  4. import { getJitsiMeetTransport } from '../modules/transport';
  5. import { App } from './features/app';
  6. import { Platform } from './features/base/react';
  7. const logger = require('jitsi-meet-logger').getLogger(__filename);
  8. const OS = Platform.OS;
  9. /**
  10. * Renders the app when the DOM tree has been loaded.
  11. */
  12. document.addEventListener('DOMContentLoaded', () => {
  13. const now = window.performance.now();
  14. APP.connectionTimes['document.ready'] = now;
  15. logger.log('(TIME) document ready:\t', now);
  16. // Render the main/root Component.
  17. ReactDOM.render(<App />, document.getElementById('react'));
  18. });
  19. // Workaround for the issue when returning to a page with the back button and
  20. // the page is loaded from the 'back-forward' cache on iOS which causes nothing
  21. // to be rendered.
  22. if (OS === 'ios') {
  23. window.addEventListener('pageshow', event => {
  24. // Detect pages loaded from the 'back-forward' cache
  25. // (https://webkit.org/blog/516/webkit-page-cache-ii-the-unload-event/)
  26. if (event.persisted) {
  27. // Maybe there is a more graceful approach but in the moment of
  28. // writing nothing else resolves the issue. I tried to execute our
  29. // DOMContentLoaded handler but it seems that the 'onpageshow' event
  30. // is triggered only when 'window.location.reload()' code exists.
  31. window.location.reload();
  32. }
  33. });
  34. }
  35. /**
  36. * Stops collecting the logs and disposing the API when the user closes the
  37. * page.
  38. */
  39. window.addEventListener('beforeunload', () => {
  40. // Stop the LogCollector
  41. if (APP.logCollectorStarted) {
  42. APP.logCollector.stop();
  43. APP.logCollectorStarted = false;
  44. }
  45. APP.API.notifyConferenceLeft(APP.conference.roomName);
  46. APP.API.dispose();
  47. getJitsiMeetTransport().dispose();
  48. });