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:
parent
50cc4a1346
commit
eaea04e219
@ -80,15 +80,19 @@ export default function VideoCard({ video, onClick, className = "" }: VideoCardP
|
|||||||
console.log('Setting up HLS preview for:', video.title);
|
console.log('Setting up HLS preview for:', video.title);
|
||||||
hlsRef.current = new Hls({
|
hlsRef.current = new Hls({
|
||||||
enableWorker: false,
|
enableWorker: false,
|
||||||
lowLatencyMode: false,
|
lowLatencyMode: true,
|
||||||
backBufferLength: 30,
|
backBufferLength: 10,
|
||||||
maxBufferLength: 60,
|
maxBufferLength: 15,
|
||||||
maxMaxBufferLength: 120,
|
maxMaxBufferLength: 30,
|
||||||
maxBufferSize: 60 * 1000 * 1000,
|
maxBufferSize: 30 * 1000 * 1000,
|
||||||
maxBufferHole: 0.5,
|
maxBufferHole: 0.1,
|
||||||
startLevel: 0,
|
startLevel: -1, // Auto select lowest quality for fast start
|
||||||
autoStartLoad: true,
|
autoStartLoad: true,
|
||||||
debug: false,
|
debug: false,
|
||||||
|
liveSyncDurationCount: 3,
|
||||||
|
liveMaxLatencyDurationCount: 10,
|
||||||
|
startFragPrefetch: true,
|
||||||
|
testBandwidth: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
hlsRef.current.loadSource(video.videoUrl);
|
hlsRef.current.loadSource(video.videoUrl);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user