From eaea04e21930adb08a3771e61ababd14c5e3f318 Mon Sep 17 00:00:00 2001 From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com> Date: Fri, 29 Aug 2025 10:09:40 +0000 Subject: [PATCH] Improve video playback speed and responsiveness during initial loading Adjust HLS.js configuration for low-latency streaming, reducing initial buffer lengths and optimizing start-up quality selection for faster video playback initiation. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 2eb1084e-b728-4449-9231-f1665924c8d5 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/2eb1084e-b728-4449-9231-f1665924c8d5/P3O2FU7 --- client/src/components/video-card.tsx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/client/src/components/video-card.tsx b/client/src/components/video-card.tsx index f914da5..0f3471c 100644 --- a/client/src/components/video-card.tsx +++ b/client/src/components/video-card.tsx @@ -80,15 +80,19 @@ export default function VideoCard({ video, onClick, className = "" }: VideoCardP console.log('Setting up HLS preview for:', video.title); hlsRef.current = new Hls({ enableWorker: false, - lowLatencyMode: false, - backBufferLength: 30, - maxBufferLength: 60, - maxMaxBufferLength: 120, - maxBufferSize: 60 * 1000 * 1000, - maxBufferHole: 0.5, - startLevel: 0, + lowLatencyMode: true, + backBufferLength: 10, + maxBufferLength: 15, + maxMaxBufferLength: 30, + maxBufferSize: 30 * 1000 * 1000, + maxBufferHole: 0.1, + startLevel: -1, // Auto select lowest quality for fast start autoStartLoad: true, debug: false, + liveSyncDurationCount: 3, + liveMaxLatencyDurationCount: 10, + startFragPrefetch: true, + testBandwidth: false, }); hlsRef.current.loadSource(video.videoUrl);