chore: update Discord-video-stream subproject to latest commit

This commit is contained in:
MythEclipse
2026-05-17 04:52:20 +07:00
parent 518577d79d
commit 71889ab689
15 changed files with 268 additions and 19 deletions
+25
View File
@@ -60,6 +60,10 @@ interface SharedUIState {
isStreaming: boolean;
}
interface MediaSettings {
musicVolume: number;
}
type SharedUIStatePatch = Partial<SharedUIState> & {
selectedGuild?: string;
};
@@ -74,6 +78,10 @@ const defaultSharedUIState: SharedUIState = {
isStreaming: false,
};
const defaultMediaSettings: MediaSettings = {
musicVolume: 1,
};
let sharedUIState: SharedUIState = { ...defaultSharedUIState };
export function normalizeSharedUIState(
@@ -101,6 +109,17 @@ async function initializeSharedUIState() {
);
}
async function initializeMediaSettings(): Promise<MediaSettings> {
const stored = await getPersistedValue(
"media-settings",
defaultMediaSettings,
);
return {
...defaultMediaSettings,
...(stored as MediaSettings),
};
}
function getSharedUIState(): SharedUIState {
return { ...sharedUIState };
}
@@ -174,6 +193,7 @@ export async function startWebserver(
voiceController: VoiceController,
) {
await initializeSharedUIState();
let mediaSettings = await initializeMediaSettings();
const app = express();
const server = http.createServer(app);
@@ -200,6 +220,11 @@ export async function startWebserver(
isBrowserStreaming: () => sharedUIState.isStreaming,
screenController,
onStateChange: (state) => broadcaster.mediaState(state),
initialMusicVolume: mediaSettings.musicVolume,
onMusicVolumeChange: async (volume) => {
mediaSettings = { ...mediaSettings, musicVolume: volume };
await setPersistedValue("media-settings", mediaSettings);
},
});
// Security headers. CSP disabled because the current static UI uses inline scripts/styles.