feat(stream): add stream quality selection and update stream URL handling
This commit is contained in:
@@ -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",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user