From f4f2d37aeaf7462f29c40ae7818e9106d530f454 Mon Sep 17 00:00:00 2001 From: Fredrik Burmester Date: Wed, 14 Aug 2024 08:13:02 +0200 Subject: [PATCH] fix: add headers to hls stream url --- components/CurrentlyPlayingBar.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/CurrentlyPlayingBar.tsx b/components/CurrentlyPlayingBar.tsx index c13c675e..f6d44b61 100644 --- a/components/CurrentlyPlayingBar.tsx +++ b/components/CurrentlyPlayingBar.tsx @@ -25,6 +25,7 @@ import { useRouter, useSegments } from "expo-router"; import { BlurView } from "expo-blur"; import { writeToLog } from "@/utils/log"; import { getBackdropUrl } from "@/utils/jellyfin/image/getBackdropUrl"; +import { getAuthHeaders } from "@/utils/jellyfin/jellyfin"; export const currentlyPlayingItemAtom = atom<{ item: BaseItemDto; @@ -184,7 +185,7 @@ export const CurrentlyPlayingBar: React.FC = () => { } }, [cp?.playbackUrl]); - if (!cp) return null; + if (!cp || !api) return null; return ( { uri: cp.playbackUrl, isNetwork: true, startPosition, + headers: getAuthHeaders(api), }} onBuffer={(e) => e.isBuffering ? console.log("Buffering...") : null