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
This commit is contained in:
sebastjanartic 2025-08-29 10:09:40 +00:00
parent 50cc4a1346
commit eaea04e219

View File

@ -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);