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.

FeatureFlags.js 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { getLogger } from '@jitsi/logger';
  2. const logger = getLogger('FeatureFlags');
  3. /**
  4. * A global module for accessing information about different feature flags state.
  5. */
  6. class FeatureFlags {
  7. /**
  8. * Configures the module.
  9. *
  10. * @param {boolean} flags.sourceNameSignaling - Enables source names in the signaling.
  11. */
  12. init(flags) {
  13. this._sourceNameSignaling = Boolean(flags.sourceNameSignaling);
  14. this._sendMultipleVideoStreams = Boolean(flags.sendMultipleVideoStreams);
  15. logger.info(`Source name signaling: ${this._sourceNameSignaling},`
  16. + ` Send multiple video streams: ${this._sendMultipleVideoStreams}`);
  17. }
  18. /**
  19. * Checks if multiple local video streams support is enabled.
  20. *
  21. * @returns {boolean}
  22. */
  23. isMultiStreamSupportEnabled() {
  24. return this._sourceNameSignaling && this._sendMultipleVideoStreams;
  25. }
  26. /**
  27. * Checks if the source name signaling is enabled.
  28. *
  29. * @returns {boolean}
  30. */
  31. isSourceNameSignalingEnabled() {
  32. return this._sourceNameSignaling;
  33. }
  34. }
  35. export default new FeatureFlags();