feat(stream): add stream quality selection and update stream URL handling

This commit is contained in:
2026-03-14 04:03:54 +01:00
parent 8f42164bce
commit cf92cc49c2
11 changed files with 346 additions and 107 deletions

View File

@@ -132,14 +132,16 @@ export function useStreamUrl(
slotId: string | undefined,
channelPassword?: string,
blockPassword?: string,
quality?: string,
) {
return useQuery({
queryKey: ["stream-url", channelId, slotId, channelPassword, blockPassword],
queryKey: ["stream-url", channelId, slotId, channelPassword, blockPassword, quality],
queryFn: async (): Promise<string | null> => {
const params = new URLSearchParams();
if (token) params.set("token", token);
if (channelPassword) params.set("channel_password", channelPassword);
if (blockPassword) params.set("block_password", blockPassword);
if (quality) params.set("quality", quality);
const res = await fetch(`/api/stream/${channelId}?${params}`, {
cache: "no-store",
});