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.

12345678910111213141516171819202122232425262728293031323334
  1. import { API_ID } from '../API';
  2. import { getJitsiMeetGlobalNS } from '../util/helpers';
  3. import Transport from './Transport';
  4. import PostMessageTransportBackend from './PostMessageTransportBackend';
  5. /**
  6. * Option for the default low level transport.
  7. *
  8. * @type {Object}
  9. */
  10. const postisOptions = {};
  11. if (typeof API_ID === 'number') {
  12. postisOptions.scope
  13. = `jitsi_meet_external_api_${API_ID}`;
  14. }
  15. export const transport = new Transport({
  16. transport: new PostMessageTransportBackend({
  17. enableLegacyFormat: true,
  18. postisOptions
  19. })
  20. });
  21. /**
  22. * Sets the transport to passed transport.
  23. *
  24. * @param {Object} newTransport - The new transport.
  25. * @returns {void}
  26. */
  27. getJitsiMeetGlobalNS().useNewExternalTransport = function(newTransport) {
  28. transport.setTransport(newTransport);
  29. };