feat(backend): add SIMPLE_STREAMING WebRTC control-path streaming
This commit is contained in:
@@ -25,10 +25,29 @@ const parsePositiveNumber = (value: string | undefined): number | null => {
|
||||
return parsed;
|
||||
};
|
||||
|
||||
export const parseFeatureFlag = (value: string | undefined, defaultValue: boolean): boolean => {
|
||||
if (value === undefined) {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
const normalized = value.trim().toLowerCase();
|
||||
if (['1', 'true', 'yes', 'on'].includes(normalized)) {
|
||||
return true;
|
||||
}
|
||||
if (['0', 'false', 'no', 'off'].includes(normalized)) {
|
||||
return false;
|
||||
}
|
||||
return defaultValue;
|
||||
};
|
||||
|
||||
export const mediaMode: MediaMode = parseMediaMode(process.env.MEDIA_MODE);
|
||||
export const simpleStreamingEnabled = parseFeatureFlag(process.env.SIMPLE_STREAMING, false);
|
||||
export const streamRecordingEnabled = parseFeatureFlag(process.env.STREAM_RECORDINGS_ENABLED, false);
|
||||
|
||||
export const mediaConfig = {
|
||||
mode: mediaMode,
|
||||
simpleStreamingEnabled,
|
||||
streamRecordingEnabled,
|
||||
turn: {
|
||||
urls: parseCsv(process.env.TURN_URLS),
|
||||
username: process.env.TURN_USERNAME ?? '',
|
||||
@@ -40,4 +59,3 @@ export const mediaConfig = {
|
||||
maxSubscribersPerRoom: parsePositiveNumber(process.env.MEDIA_MAX_SUBSCRIBERS_PER_ROOM),
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user