modified lib-jitsi-meet dev repo
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

FeatureFlags.js 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import browser from '../browser';
  2. /**
  3. * A global module for accessing information about different feature flags state.
  4. */
  5. class FeatureFlags {
  6. /**
  7. * Configures the module.
  8. *
  9. * @param {object} flags - The feature flags.
  10. * @param {boolean=} flags.runInLiteMode - Enables lite mode for testing to disable media decoding.
  11. * @param {boolean=} flags.ssrcRewritingEnabled - Use SSRC rewriting. Requires sourceNameSignaling to be enabled.
  12. */
  13. init(flags) {
  14. this._runInLiteMode = Boolean(flags.runInLiteMode);
  15. this._ssrcRewriting = Boolean(flags.ssrcRewritingEnabled);
  16. }
  17. /**
  18. * Checks if multiple local video streams support is enabled.
  19. *
  20. * @returns {boolean}
  21. */
  22. isMultiStreamSendSupportEnabled() {
  23. return browser.supportsUnifiedPlan();
  24. }
  25. /**
  26. * Checks if the run in lite mode is enabled.
  27. * This will cause any media to be received and not decoded. (Insertable streams are used to discard
  28. * all media before it is decoded). This can be used for various test scenarios.
  29. *
  30. * @returns {boolean}
  31. */
  32. isRunInLiteModeEnabled() {
  33. return this._runInLiteMode && browser.supportsInsertableStreams();
  34. }
  35. /**
  36. * Checks if the clients supports re-writing of the SSRCs on the media streams by the bridge.
  37. * @returns {boolean}
  38. */
  39. isSsrcRewritingSupported() {
  40. return this._ssrcRewriting;
  41. }
  42. }
  43. export default new FeatureFlags();