Skip to content

Commit

Permalink
ref: convert to TS.
Browse files Browse the repository at this point in the history
  • Loading branch information
jallamsetty1 committed Mar 28, 2024
1 parent 07e86cb commit 835c034
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions modules/flags/FeatureFlags.js → modules/flags/FeatureFlags.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@

import browser from '../browser';

/**
* A global module for accessing information about different feature flags state.
*/
class FeatureFlags {
private _runInLiteMode: boolean;
private _ssrcRewriting: boolean;

/**
* Configures the module.
*
* @param {object} flags - The feature flags.
* @param {boolean=} flags.runInLiteMode - Enables lite mode for testing to disable media decoding.
* @param {boolean=} flags.ssrcRewritingEnabled - Use SSRC rewriting.
*/
init(flags) {
init(flags: { runInLiteMode?: boolean | undefined; ssrcRewritingEnabled?: boolean | undefined; }) {
this._runInLiteMode = Boolean(flags.runInLiteMode);
this._ssrcRewriting = Boolean(flags.ssrcRewritingEnabled);
}
Expand All @@ -24,17 +26,17 @@ class FeatureFlags {
*
* @returns {boolean}
*/
isRunInLiteModeEnabled() {
isRunInLiteModeEnabled(): boolean {
return this._runInLiteMode && browser.supportsInsertableStreams();
}

/**
* Checks if the clients supports re-writing of the SSRCs on the media streams by the bridge.
* @returns {boolean}
*/
isSsrcRewritingSupported() {
isSsrcRewritingSupported(): boolean {
return this._ssrcRewriting;
}
}

export default new FeatureFlags();
export default new FeatureFlags();

0 comments on commit 835c034

Please sign in to comment.