diff --git a/k-tv-frontend/app/(main)/tv/page.tsx b/k-tv-frontend/app/(main)/tv/page.tsx index e298649..1298246 100644 --- a/k-tv-frontend/app/(main)/tv/page.tsx +++ b/k-tv-frontend/app/(main)/tv/page.tsx @@ -89,7 +89,6 @@ function TvPageContent() { error: broadcastError, } = useCurrentBroadcast(channel?.id ?? "", passwords.channelPassword); - // blockPassword derived from broadcast.slot.id after broadcast loads const blockPassword = passwords.getBlockPassword(broadcast?.slot.id); const { data: epgSlots } = useEpg( diff --git a/k-tv-frontend/hooks/use-tv.ts b/k-tv-frontend/hooks/use-tv.ts index 0475ddf..2da18d1 100644 --- a/k-tv-frontend/hooks/use-tv.ts +++ b/k-tv-frontend/hooks/use-tv.ts @@ -132,10 +132,10 @@ export function useStreamUrl( slotId: string | undefined, channelPassword?: string, blockPassword?: string, - quality?: string, + bitrateBps?: number, ) { return useQuery({ - queryKey: ["stream-url", channelId, slotId, channelPassword, blockPassword, quality], + queryKey: ["stream-url", channelId, slotId, channelPassword, blockPassword, bitrateBps], queryFn: async (): Promise => { const params = new URLSearchParams(); if (token) params.set("token", token); @@ -151,8 +151,8 @@ export function useStreamUrl( const msg = body?.error ?? `Stream resolve failed: ${res.status}`; throw new Error(msg); } - const { url } = await res.json(); - return url as string; + const { url } = (await res.json()) as { url: string }; + return bitrateBps ? `${url}&VideoBitRate=${bitrateBps}` : url; }, enabled: !!channelId && !!slotId, staleTime: Infinity,