feat: enhance stream URL handling and add initial offset support in VideoPlayer

This commit is contained in:
2026-03-11 19:51:51 +01:00
parent c9aa36bb5f
commit 4789dca679
5 changed files with 47 additions and 13 deletions

View File

@@ -57,7 +57,11 @@ export default function TvPage() {
const { data: broadcast, isLoading: isLoadingBroadcast } =
useCurrentBroadcast(channel?.id ?? "");
const { data: epgSlots } = useEpg(channel?.id ?? "");
const { data: streamUrl } = useStreamUrl(channel?.id, token);
const { data: streamUrl } = useStreamUrl(
channel?.id,
token,
broadcast?.slot.id,
);
// ------------------------------------------------------------------
// Derived display values
@@ -176,7 +180,11 @@ export default function TvPage() {
}
if (streamUrl) {
return (
<VideoPlayer src={streamUrl} className="absolute inset-0 h-full w-full" />
<VideoPlayer
src={streamUrl}
className="absolute inset-0 h-full w-full"
initialOffset={broadcast?.offset_secs}
/>
);
}
// Broadcast exists but stream URL resolving — show no-signal until ready