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 9b11d09 commit 8e9df21
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 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,15 +26,15 @@ 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;
}
}
Expand Down

0 comments on commit 8e9df21

Please sign in to comment.