Skip to content

Commit 1a2937d

Browse files
committed
feat: Configure HLS player for faster startup with prefetch and buffer settings, and remove the history downloader.
1 parent 3bc2f78 commit 1a2937d

3 files changed

Lines changed: 5 additions & 67 deletions

File tree

app/layout.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import "./globals.css";
44
import { ThemeProvider } from "@/components/ThemeProvider";
55
import { Analytics } from "@vercel/analytics/react";
66
import { ServiceWorkerRegister } from "@/components/ServiceWorkerRegister";
7-
import { HistoryDownloader } from "@/lib/hooks/useHistoryDownloader";
7+
88

99
const geistSans = Geist({
1010
variable: "--font-geist-sans",
@@ -39,7 +39,6 @@ export default function RootLayout({
3939
{children}
4040
<Analytics />
4141
<ServiceWorkerRegister />
42-
<HistoryDownloader />
4342
</ThemeProvider>
4443

4544
{/* ARIA Live Region for Screen Reader Announcements */}

components/player/hooks/useHlsPlayer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ export function useHlsPlayer({
4545
hls = new Hls({
4646
enableWorker: true,
4747
lowLatencyMode: true,
48+
startFragPrefetch: true, // Fetch first segment immediately while parsing manifest
49+
// Reduce buffering requirement for startup
50+
maxBufferLength: 30,
51+
backBufferLength: 30,
4852
});
4953
hlsRef.current = hls;
5054

lib/hooks/useHistoryDownloader.ts

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)