feat(backend): add SIMPLE_STREAMING WebRTC control-path streaming

This commit is contained in:
2026-03-05 13:30:00 +00:00
parent c458857f0a
commit 19baf76169
14 changed files with 448 additions and 189 deletions

View File

@@ -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),
},
};